|  | Home | Documentation | xsd__base64Binary Struct Reference updated by Robert van Engelen |

xsd__base64Binary Struct Reference
DIME attachment functions

XSD base64Binary structure with attachment data. More...

`#include <stdsoap2.h>`

## Public Attributes

unsigned char * | __ptr
| pointer to binary data
int | __size
| size of the binary data
char * | id
| extra member: NULL to generate an id or assign this member variable a unique UUID
char * | type
| extra member: MIME type of the data
char * | options
| extra member: DIME options or a description of the MIME attachment or NULL

## Detailed Description

XSD base64Binary structure with attachment data.

This structure may be declared in the interface header file for soapcpp2 and defines a XSD base64Binary type with optional DIME/MIME/MTOM attachment data. This structure is auto-generated by wsdl2h for the XSD base64Binary type to serialize binary data in base64 or as a DIME/MIME/MTOM attachment. An attachment is serialized when either id, type or options member variables are non-NULL.

Example:

// example .h file for soapcpp2
//gsoap ns service name: example
//gsoap ns service namespace: urn:example
struct xsd__base64Binary {
unsigned char *__ptr; // pointer to binary data
int __size; // size of the binary data
char *id; // NULL to generate an id or assign this member variable a unique UUID
char *type; // MIME type of the data
char *options; // DIME options or an optional description of the MIME attachment
};
int ns__webmethod(struct xsd__base64Binary *data, struct xsd__base64Binary *result);
xsd__base64Binary
XSD base64Binary structure with attachment data.
Definition stdsoap2.h:10034
xsd__base64Binary::options
char * options
extra member: DIME options or a description of the MIME attachment or NULL
Definition stdsoap2.h:10039
xsd__base64Binary::id
char * id
extra member: NULL to generate an id or assign this member variable a unique UUID
Definition stdsoap2.h:10037
xsd__base64Binary::__ptr
unsigned char * __ptr
pointer to binary data
Definition stdsoap2.h:10035
xsd__base64Binary::__size
int __size
size of the binary data
Definition stdsoap2.h:10036
xsd__base64Binary::type
char * type
extra member: MIME type of the data
Definition stdsoap2.h:10038
// example client implementation based on the above example .h file for soapcpp2
#include "soapH.h"
int main()
{
struct soap *soap = soap_new();
struct xsd__base64Binary data, result;
data.__ptr = ...; // points to binary image data to send
data.__size = ...; // size of the image data to send
data.id = soap_strdup(soap, soap_rand_uuid(soap, NULL));
data.type = "image/jpg";
data.options = "A picture";
if (soap_call_ns__webmethod(soap, endpoint, NULL, &data, &result))
soap_print_fault(soap, stderr);
else
... // success, use the result
soap_destroy(soap);
soap_end(soap);
soap_free(soap);
}
soap_destroy
*Delete all dynamically allocated C objects managed by the specified ::soap context void soap_destroy(struct soap *soap)
soap_strdup
*Copy a string to managed memory char * soap_strdup(struct soap *soap, const char *string) * @returns copy of string or NULL when the specified string is NULL or on failure to allocate(out of memory)
soap_end
*Delete all data from heap memory managed by the specified ::soap context and release the freed memory back to the heap void soap_end(struct soap *soap)
soap_free
*Finalize and free the given ::soap context from unmanaged heap memory void soap_free(struct soap *soap)
soap_print_fault
void soap_print_fault(struct soap *soap, FILE *fd)
Print error message on the specified output.
soap_rand_uuid
const char * soap_rand_uuid(struct soap *soap, const char *prefix)
Returns a randomized unique UUID string.
soap
Context with the engine state.
Definition stdsoap2.h:2929
// example service implementation based on the above example .h file for soapcpp2
#include "soapH.h"
int main()
{
struct soap *soap = soap_new();
... // serve requests with soap_bind, soap_accept, soap_ssl_accept, and soap_serve
}
int ns__webmethod(struct soap *soap, struct xsd__base64Binary *data, struct xsd__base64Binary *result)
{
// echo back the structure (as a MIME attachment)
result->__ptr = data->__ptr;
result->__size = data->__size;
retult->id = data->id;
retult->type = data->type;
retult->options = data->options;
return SOAP_OK;
}
SOAP_OK
#define SOAP_OK
The soap_status code for no error (zero).
Definition stdsoap2.h:2392

See also
  xsd__hexBinary, _xop__Include.

## Member Data Documentation

## ◆ __ptr

unsigned char* xsd__base64Binary::__ptr

pointer to binary data

## ◆ __size

int xsd__base64Binary::__size

size of the binary data

## ◆ id

char* xsd__base64Binary::id

extra member: NULL to generate an id or assign this member variable a unique UUID

## ◆ options

char* xsd__base64Binary::options

extra member: DIME options or a description of the MIME attachment or NULL

## ◆ type

char* xsd__base64Binary::type

extra member: MIME type of the data