chrizonline
chrizonline

Reputation: 4979

compiling gsoap sample hello service

i downloaded gsoap 2.8.14, configure and install with the following commands:

./configure --disable-ssl --enable-samples --enable-debug
make
make install

im tried to compile gsoap sample "hello". so i took the the wsdl file from the sample and did the following:

wsdl2h -s -o hello.h h.wsdl
soapcpp2 hello.h

i copied the generated files into a new eclipse c++ project and excluded soapClientLib.cpp and soapServerLib.cpp because i was receiving errors like

multiple definition of .....

i then created a helloserver.cpp and here is the content:

#include "soapH.h"
#include "Service.nsmap"

int main() 
{
  return soap_serve(soap_new);
}

int __ns1__hello(struct soap *soap, char* helloReq, char* &helloResponse)
{
  return SOAP_OK;
}

when i build in eclipse, i receives an error:

...soapServer.cpp:77 undefined reference to __ns1__hello(soap*,_ns2_hello*, _ns__helloResponse*)

when i trace to soapServer.cpp, this line is getting the error:

soap->error=__ns1_hello(soap,soap_tmp___ns1_hello.ns2__hello,&ns2__helloResponse);

why am i getting this error? im using the sample hello wsdl from gsoap

Upvotes: 0

Views: 2998

Answers (1)

john
john

Reputation: 8027

Well as you can see from the error message (and the soapServer.cpp code) you are supposed to write a function

int __ns1__hello(struct soap *soap, 
    _ns2_hello* helloReq, 
    _ns__helloResponse* helloResponse)
{
  return SOAP_OK;
}

not the function you wrote.

Upvotes: 1

Related Questions