Download gSOAP 2.7.0 User Guide

Transcript
fields in the struct/class, but additional fields and methods may appear after the field declarations.
An extended xsd hexBinary declaration is similar.
The id and type fields contain text. The set the DIME-specific options field, you can use the
soap dime option function:
char *soap dime option(struct soap *soap, unsigned short type, const char *option)
returns a string with this encoding. For example
struct xsd base64Binary image;
image. ptr = ...;
image. size = ...;
image.id = "uuid:09233523-345b-4351-b623-5dsf35sgs5d6";
image.type = "image/jpeg";
image.options = soap dime option(soap, 0, "My wedding picture");
When either the id or type field values are non-NULL at run time, the data will be serialized as
a DIME attachment. The SOAP/XML message refers to the attachments using href attributes.
This generally works will with SOAP RPC, because href attributes are permitted. However, with
document/literal style the referencing mechanism must be explicitly defined in the schema of the
binary type. The gSOAP declaration of an extended binary type is
struct ns myBinaryDataType
{
unsigned char * ptr;
int size;
char *id;
char *type;
char *options;
};
C++ programmers can use inheritance instead of textual extension required in C, as in
class xsd base64Binary
{
unsigned char * ptr;
int size;
};
class ns myBinaryDataType : xsd base64Binary
{
char *id;
char *type;
char *options;
};
This defines an extension of xsd:base64Binary, such that the data can be serialized as DIME
attachments using href attributes for referencing. When a different attribute name is in fact used,
it must be explicitly defined:
//gsoap WSref schema import: http://schemas.xmlsoap.org/ws/2002/04/reference/
struct ns myBinaryDataType
143