Menu

#107 base64 serialization with std::string

closed
None
5
2019-01-21
2018-12-31
No
// 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
};

Discussion

  • Robert van Engelen

    Just convert the string with raw data to base64 and then store it to serialize it with the req1 structure. Won't that work?

    r.input_id = soap_s2base64(soap, rawdata, NULL, rawdatalen);
    
     
  • Robert van Engelen

    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB