I am trying to use the databinding functionality of gSoap to create an XML string in C to pass onto another application via a message queue. I have managed to get an small applicaiton to combine my XSD and data and output to the screen the resultant XML but I need to capture it in a char string to be able to use it - any help ???
Am using C on HPUX - below is the small sample I have managed to get working - I am REALLY new to this - like 3 days worth of effort !
int xml_test_main(char *AppName, FILE *fpLog )
{
char LogString[ DEF_ARRAY_LEN ]; /* String to go to log file */
struct soap *soap = soap_new1(SOAP_XML_STRICT | SOAP_XML_INDENT | SOAP_XML_CANONICAL);
struct ns2__trackingNumberType X;
X.trackId = "1234567890";
X.trackIdTypeCd = "ABC";
X.formTypeCode = "0400";
if (soap_write_ns2__trackingNumberType(soap, &X) != SOAP_OK)
PrintToLog( fpLog, "Error!!!\n");
soap_destroy(soap); // clean up allocated class instances
soap_end(soap); // clean up allocated temporaries
soap_free(soap); // delete context
return(OK);
}
Am using C on HPUX - below is the small sample I have managed to get working - I am REALLY new to this - like 3 days worth of effort !
int xml_test_main(char *AppName, FILE *fpLog )
{
char LogString[ DEF_ARRAY_LEN ]; /* String to go to log file */
struct soap *soap = soap_new1(SOAP_XML_STRICT | SOAP_XML_INDENT | SOAP_XML_CANONICAL);
struct ns2__trackingNumberType X;
X.trackId = "1234567890";
X.trackIdTypeCd = "ABC";
X.formTypeCode = "0400";
if (soap_write_ns2__trackingNumberType(soap, &X) != SOAP_OK)
PrintToLog( fpLog, "Error!!!\n");
soap_destroy(soap); // clean up allocated class instances
soap_end(soap); // clean up allocated temporaries
soap_free(soap); // delete context
return(OK);
}