My issue deals specifically with binary data not being sent properly via an RPC in gSOAP. I'm restricted to storing the binary as a std::string. In most cases, only a small fraction of the intended binary data is sent over the wire. I believe it is because gSOAP can't handle certain characters properly that are contained within the populated std::string.
My gSOAP client application is required to send a corresponding gSOAP server application a few different binary files, including an RPM of a 3rd party application. After the xml to h and cpp conversion process, I am restricted to the auto-generated C++ interface. I am providing the class below.
The programUpdate class looks something like this:
class SOAP_CMAC _ns1__setProgramUpdate
{
public:
std::string programPatch;
struct soap *soap;
....
}
Therefore, I am restricted to storing the binary data as a std::string. From my research, it appears std::strings are able to work with all types of characters; at the heart strings are just a container of chars.
So what would cause truncating of the data by sending the data over the wire via a gSOAP RPC?
XML, and thus SOAP, does not allow for arbitrary binary data without some provision made to encode characters that are illegal in XML. To accomplish what you want in gSOAP you need to look at section 11.12 of the gSOAP 2.8.17 User's Guide. It will help you with setting up an array of binary data that gSOAP will then base64 encode before inclusion into the SOAP envelope. There is also provision for handling binary data via hex encoding; see section 11.13.
For your case, a declaration akin to this might suffice: