|  | Home | Documentation | xsd__base64Binary Struct Reference updated Mon Mar 24 2025 by Robert van Engelen |

- Main Page
- Modules
- Classes
- Files

- Class List
- Class Members

Public Attributes | List of all members
xsd__base64Binary Struct Reference
DIME attachment functions

XSD base64Binary structure with attachment data. More...

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

## 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);
// 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);
}
// 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;
}

See also
  `xsd__hexBinary`, `_xop__Include`.

## Member Data Documentation

unsigned char* xsd__base64Binary::__ptr

pointer to binary data

int xsd__base64Binary::__size

size of the binary data

char* xsd__base64Binary::id

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

char* xsd__base64Binary::options

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

char* xsd__base64Binary::type

extra member: MIME type of the data