|  | Home | Documentation | xsd__hexBinary Struct Reference updated Thu Jun 24 2021 by Robert van Engelen |

- Main Page
- Modules
- Classes
- Files

- Class List
- Class Members

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

XSD hexBinary 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 hexBinary structure with attachment data.

This structure may be declared in the interface header file for soapcpp2 and defines a XSD hexBinary type with optional DIME/MIME/MTOM attachment data. This structure is auto-generated by wsdl2h for the XSD hexBinary type to serialize binary data in hex 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__hexBinary {
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__hexBinary *data, struct xsd__hexBinary *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__hexBinary 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__hexBinary *data, struct xsd__hexBinary *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__base64Binary`, `_xop__Include`.

## Member Data Documentation

unsigned char* xsd__hexBinary::__ptr

pointer to binary data

int xsd__hexBinary::__size

size of the binary data

char* xsd__hexBinary::id

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

char* xsd__hexBinary::options

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

char* xsd__hexBinary::type

extra member: MIME type of the data