4

Now, I developed a gSOAP stand-alone server on 8080 port and it's working for SOAP RPC.

But I want to return wsdl content of a wsdl file in my file system when clients request for getting wsdl on the 8080 port.

what I can do to return wsdl to clients?

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
softghost
  • 1,167
  • 1
  • 10
  • 16
  • After a bad time, I find the solution on online gSOAP user guide :http://www.cs.fsu.edu/~engelen/soapdoc2.html#tth_sEc19.10 – softghost Feb 17 '12 at 17:53

1 Answers1

1

I used xd tool to generate a embbed version of my wsdl and store it a wsdl.h file with this command line (I`m doing 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, that can be better to lead with parameters in GET request:

int http_get(struct soap *soap)
{
  soap_response(soap, SOAP_HTML); // HTTP response header with text/html
  soap_send(soap, (const char*)wsdl);
  soap_end_send(soap);
  return SOAP_OK;
}

So, I configure this function to lead with all GET commands received by gSoap:

.
.
.
struct soap soap;
soap_init(&soap);
soap.fget = http_get;
.
.
.

Then, when your server receive a HTTP/GET request, your function will be called and send the wsdl file. If you want, you can read WSDL file at runtime and send in soap_send() instead to embbed WSDL in your code like I did.

Celino
  • 325
  • 1
  • 9