0

I have implemented a service in C++ using gSoap. I have created it from a multiple existing WSDL files.

And now I need to give a definition to every virtual method of the service.

Let's take a look at one generated method declaration in the file soapMyServiceService.h:

///
/// Service operations (you should define these):
/// Note: compile with -DWITH_PURE_VIRTUAL for pure virtual methods
///

/// Web service operation 'Initialize' (returns error code or SOAP_OK)

virtual int Initialize(_ns5__Initialize *ns5__Initialize, _ns5__InitializeResponse *ns5__InitializeResponse);

Actually, I was expecting to get :

virtial string Initialize(int var_a , int var_b , string var_c);

But now, I need to implement it what I got generated and return the SOAP code :

int MyService::Initialize(_ns5__Initialize *ns5__Initialize, _ns5__InitializeResponse *ns5__InitializeResponse)
{
    // HOW can I get here the received values for that I can able to implement my logic?
    return SOAP_OK;
}

How can I get the received values ( the values sent by the client for var_a, var_b, and var_c) and then set for him the returned for the string and in the same time return the error code...

How do you normally implement the logic of the services?

Thank you.

Farah
  • 2,469
  • 5
  • 31
  • 52

1 Answers1

0

In your service method implementation MyService::Initialize(_ns5__Initialize *ns5__Initialize, _ns5__InitializeResponse *ns5__InitializeResponse) the last argument is the response argument all the rest are input argument, here you have only one input parameter that is of type _ns5__Initialize which probably wud be a structure, if you access its member, you will get all the input parameters of the request.

Asna
  • 108
  • 8
  • Effectively you are right. The members of ns5_Initialize are var_a, var_b, var_c but I guess there is a problem somewhere. Because it's not me who defined the above structure, it was generated. It would have been better if there was a way to have the right arguments... – Farah Apr 22 '14 at 10:16
  • 1
    Yes, it is generated via your wsdl, wsdl define your method parameters their type, name. etc – Asna Apr 22 '14 at 12:15
  • Can you tell me the exact WSDL tag to check? Thank you a lot! – Farah Apr 22 '14 at 13:07