base64 serialization with std::string
Development toolkit for Web Services and XML data bindings for C & C++
Brought to you by:
engelen
// input file to soapcpp2
struct xsd__base64Binary {
unsigned char *__ptr;
int __size;
};
struct req1 {
int moonphase;
struct xsd__base64Binary *input_id;
};
int request_blah(const struct req1 *x);
When making this call, the input_id gets sent over the line as a base64-encoded string of whatever is in __ptr. The magic for base64 encoding lies within the unsigned char pointer. Changing the input_id field to a std::string will transmit the field in plain instead (expectedly so). Is there a way to combine std::string and base64 encoding?
struct req1 {
int moonphase;
std::string input_id; // not base64 normally
};
Just convert the string with raw data to base64 and then store it to serialize it with the
req1structure. Won't that work?