Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top