2

I am trying to get a simple hello world web service working. I used WSDL2CPP to generate the service code from my wsdl file. This builds and shows up in service list at localhost:8080/axis2/services

Now, I have created a simple client to access the service. When I try to do a request to the web service, I see the following in my axis2.log:


[Tue Aug 27 09:50:31 2013] [debug] http_worker.c(186) Client HTTP version HTTP/1.1
[Tue Aug 27 09:50:31 2013] [debug] soap_builder.c(882) identified soap version is soap12
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler request_uri_based_dispatcher within the phase Transport
[Tue Aug 27 09:50:31 2013] [debug] req_uri_disp.c(97) Checking for service using target endpoint address : http://127.0.0.1:8080/axis2/services/Hello_Service
[Tue Aug 27 09:50:31 2013] [debug] req_uri_disp.c(117) Service found using target endpoint address
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler AddressingInHandler within the phase Transport
[Tue Aug 27 09:50:31 2013] [info]  Starting addressing in handler
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler addressing_based_dispatcher within the phase Transport
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler rest_dispatcher within the phase Dispatch
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler soap_message_body_based_dispatcher within the phase Dispatch
[Tue Aug 27 09:50:31 2013] [debug] soap_body_disp.c(200) Checking for operation using SOAP messagebody's first child's local name : sayHello
[Tue Aug 27 09:50:31 2013] [debug] soap_body_disp.c(207) Operation found using SOAP message body's first child's local name
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler soap_action_based_dispatcher within the phase Dispatch
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler dispatch_post_conditions_evaluator within the phase PostDispatch
[Tue Aug 27 09:50:31 2013] [debug] phase.c(202) Invoke the handler context_handler within the phase PostDispatch
[Tue Aug 27 09:50:31 2013] [error] class_loader.c(152) Loading shared library ..//services/Hello_Service/libHello_Service.so  Failed. DLERROR IS ..//services/Hello_Service/libHello_Service.so: undefined symbol: _ZN7wso2wsf11Environment6getEnvEv
[Tue Aug 27 09:50:31 2013] [error] wsf_cpp_msg_recv.cpp(185) IMPL object for service 'Hello_Service' not set in message receiver. 103 :: Failed in creating DLL

The line of interest being:


[Tue Aug 27 09:50:31 2013] [error] class_loader.c(152) Loading shared library ..//services/Hello_Service/libHello_Service.so  Failed. DLERROR IS ..//services/Hello_Service/libHello_Service.so: undefined symbol: _ZN7wso2wsf11Environment6getEnvEv

This looks like some name mangling shenanigans between the WSO C++ code and the axis server's C code. Any ideas?

kalden
  • 273
  • 1
  • 3
  • 5
  • @paul-ogilvie : Hi Paul, I found [my question](http://stackoverflow.com/questions/33692127/unhandled-exception-at-x-in-axis2-http-server-exe?noredirect=1#comment55156440_33692127) a duplicate of this one, So closed it. Please consider this an update. – sjsam Nov 14 '15 at 06:40
  • See also http://stackoverflow.com/questions/33706609/what-does-actually-mean by @sjsam. – tripleee Nov 16 '15 at 08:19

1 Answers1

0

Possibly you forgot to link against WSO2 WSF/C++ itself.

Try to recompiling your service adding -lwso2_wsf to LDFLAGS.

loentar
  • 5,111
  • 1
  • 24
  • 25
  • I am building with: `g++ -g -shared -olibHello_Service.so -I$WSFCPP_HOME/include -I. -I$WSFCPP_HOME/include/axis2-1.6.0 -I$WSFCPP_HOME/include/axis2-1.6.0/platforms -L$WSFCPP_HOME/lib \ -laxutil \ -laxis2_axiom \ -laxis2_engine \ -laxis2_parser \ -lpthread \ -laxis2_http_sender \ -laxis2_http_receiver \ -lguththila \ -lwso2_wsf \ *.cpp` so, I believe it is built properly. It's odd because the server loads the service fine initially. – kalden Aug 28 '13 at 13:22
  • `c++filt _ZN7wso2wsf11Environment6getEnvEv` gives `wso2wsf::Environment::getEnv()` -- it should be in `libwso2_wsf.so`. Try to check it by starting `nm /path/to/libwso2_wsf.so | grep _ZN7wso2wsf11Environment6getEnvEv` and write result here. – loentar Aug 28 '13 at 13:33
  • 00017750 T _ZN7wso2wsf11Environment6getEnvEv – kalden Aug 31 '13 at 15:24
  • Well, symbol is there and this library is exporting that symbol (symbol type is "T"). Make sure you are starting with the same library as your service linked. I mean you could have two different libraries: one is in LD_LIBRARY_PATH (does not contain that symbol) another in `$WSFCPP_HOME/lib`. One more good thing is to disable undefined symbols while linking your service: add `-Wl,--no-undefined` to `LDFLAGS` to see which symbols are missing at link time. – loentar Aug 31 '13 at 16:52
  • I'm now thinking I'm an idiot and didn't set LD_LIBRARY_PATH in the shell that was running the server. Face-palm. I'll have to try again on monday – kalden Sep 01 '13 at 17:48