I used the xd tool to create an embedded version of my wsdl and saved the wsdl.h file with this command line (I do this in my CMakeList.txt):
${GSOAP_ROOT_DIR}/bin/win32/xd -dwsdl ${CMAKE_CURRENT_BINARY_DIR}/${SOAP_NAME_SERVICE}.wsdl > ${CMAKE_CURRENT_BINARY_DIR}/wsdl.h
After that, I implemented this function, which might be better done with parameters in the GET request:
int http_get(struct soap *soap) { soap_response(soap, SOAP_HTML);
So, I am setting up this function to execute all the GET commands received by gSoap:
. . . struct soap soap; soap_init(&soap); soap.fget = http_get; . . .
Then, when your server receives an HTTP / GET request, your function will be called and send the wsdl file. If you want, you can read the WSDL file at runtime and send to soap_send () instead, to use WSDL in your code, like me.
source share