0

For a project i need to use a WCF service (not created by me).
I had created the appropriate classes using the gSoap toolkit and everything was working great!

That was until the developer of the service decided to update it and require WS-Addressing!

I have tested the service using the soapUI tool, and in order to get a response I need to check the "add default wsa:To" option under WS-A.

I assume I need to do something similar in my code. I read about using the wsa plugin, but I couldn't find sufficient instructions. What I have done so far is:

I used wsdl2h -o outfile.h url_to_service -t typemap.dat

and in the typemap.dat I put:

SOAP_ENV__Header =\
#import "wsa.h"\n\
struct SOAP_ENV__Header\n\
{\n\
    mustUnderstand _wsa__MessageID    wsa__MessageID 0;\n\
    mustUnderstand _wsa__RelatesTo *  wsa__RelatesTo 0;\n\
    mustUnderstand _wsa__From *       wsa__From      0;\n\
    mustUnderstand _wsa__ReplyTo *    wsa__ReplyTo   0;\n\
    mustUnderstand _wsa__FaultTo *    wsa__FaultTo   0;\n\
    mustUnderstand _wsa__To           wsa__To        0;\n\
    mustUnderstand _wsa__Action       wsa__Action    0;\n\
};

when using the soapcpp2 tool, I am getting an error stating:

wsa5.h(288): ERROR: remote method name clash: struct/class 'SOAP_ENV__Fault' already declared at line 274

Finally, when I try to call the service methods from my code (C++, without changing anything from the previous version were WS-A was not required) the program freezes, and I can see the used memory increase to a point (~700MB), then drop and the program remains frozen!

I am using windows, VS2010 and gSoap 2.8.17.
Can someone point me towards the right direction about how to add WSA?

Thank you in advance!

stavrop
  • 465
  • 2
  • 8
  • 20

1 Answers1

0

I guess you are mixing several releases of WS-Addressing :

In the gSOAP typemap.dat we could see :

wsa = <http://schemas.xmlsoap.org/ws/2004/08/addressing>
wsa3 = <http://schemas.xmlsoap.org/ws/2003/03/addressing>
wsa4 = <http://schemas.xmlsoap.org/ws/2004/03/addressing>
wsa5 = <http://www.w3.org/2005/08/addressing>

If the WS-Addressing header is defined in your wsdl, its definition will be done without custom header definition in typemap.dat. I think you should remove the SOAP_ENV__Header definition and add the definition of the wsa namespaces managed by the wsa plugins (if not present).

You will find information on wsa plugin usage from gSOAP documentation doc/wsa/html/index.html and from the wsa plugin sample samples/wsa/wsademo.c.

Take care that gSOAP plugins are provided as source file, so you will need to compile and link the plugin/wsaapi.c file.

mpromonet
  • 11,326
  • 43
  • 62
  • 91