2

On a linux system, I want to create a client app using gSOAP-2.8.8 that interacts with a SOAP service build upon WCF. Therefore, I went through the following:

wsdl2h -t typemap.dat -o myService.h myService.wsdl    
soapcpp2 -Igsoap/import -CLix myService.h

And replaced '#include soapH.h' in wsseapi.h with soapcpp2-generated soapH.h as mentioned in wsseapi.h

Then, the critical step is to manually add the following lines to myService.h

#import "wsse.h"

struct SOAP_ENV__Header"
{
    mustUnderstand  // must be understood by receiver
    _wsse__Security *wsse__Security;    ///< TODO: Check element type (imported type)
};

...and compile those files like

g++ -DWITH_DOM -DWITH_OPENSSL -Igsoap -Igsoap/import -Igsoap/plugin -o test \
   myService.cpp soapC.cpp soapmyServiceProxy.cpp gsoap/stdsoap2.cpp gsoap/dom.cpp \
   gsoap/custom/duration.c gsoap/plugin/wsseapi.cpp gsoap/plugin/smdevp.c gsoap/plugin/mecevp.c \
   -L/usr/lib -lssl -lcrypt

I do get object files for all my sources;-) but still end up with two errors at linking stage.

soapC.cpp:203: undefined reference to `soap_in_ns4__duration(soap*, char const*, long long*, char const*)'
soapC.cpp:676: undefined reference to `soap_in_ns4__duration(soap*, char const*, long long*, char const*)'

Edit: As a workaround I currently substitute soap_in_ns4__duration() with soap_in_xsd__duration(), which is implemented in custom/duration.c

Nevertheless, can anyone give me a hint whats going wrong here?! Thanks in advance

user696597
  • 41
  • 2
  • 6

1 Answers1

1

you have to include "soapH.h" file in your main file that you write.

krishna555
  • 223
  • 5
  • 18
  • I didn't get your point, I already include soapmyServiceProxy.h which in turn includes soapH.h So, how should this help? – user696597 May 31 '12 at 05:14
  • sorry i didn't realize that but after including also you are getting this errors means its some thing to deal with the header files and the way you are calling the methods. I had the similar kind of problem when i started using gsoap 2.8.8 and i am able to fix it, so if you can provide some detail code that you are doing i can try fixing it. I know its hard to fix these gsoap issues i struggled a lot on this. Please provide detailed code i will try to help you figure it out. – krishna555 May 31 '12 at 16:47