Can anyone help me out in getting it to work using gSOAP?
When I execute my program it just halt when I call the soap function
that produce this output
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-
ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://soap.amazon.com"><SOAP-ENV:Body SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
id="_0"><ns1:AuthorSearchRequest><AuthorSearchRequest
xsi:type="ns1:AuthorRequest"><author>king</author><page>1</page><mode
>books</mode><tag>webservices-
20</tag><type>lite</type><devtag>DEVTAG</devtag></AuthorSearchRequest
></ns1:AuthorSearchRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
Here is my code :
#include "soapAmazonSearchBindingObject.h"
#include "soapAmazonSearchBindingProxy.h"
#include "soapH.h" // obtain the generated stub
#include "AmazonSearchBinding.nsmap" // obtain the namespace mapping
table
int main()
{
struct soap soap; // gSOAP runtime environment
soap_init(&soap); // initialize runtime environment (only
once)
struct ns1__AuthorSearchRequestResponse r;
struct ns1__AuthorRequest req;
req.author="king";
req.page="1";
req.mode="books";
req.tag="webservices-20";
req.type="lite";
req.devtag="XXXXXXXXXXX";
cout << "calling now\n";
if(soap_call_ns1__AuthorSearchRequest(&soap,"","",&req,&r)
==SOAP_OK)
cout << "Current Product=" <<r.return_->Details-
>__ptr[0]->ProductName;
else // an error occurred
soap_print_fault(&soap, stderr); // display the SOAP
fault message on the stderr str$
soap_destroy(&soap); // delete deserialized class instances
(for C++ only)
soap_end(&soap); // remove deserialized data and clean up
return 0;
}
|