Hi, does anyone have a problem using complex types in GSoap?

I am using a GSoap client (2.7.13) that connects to an Axis Java Web Service 
server and I'm having a problem with the return values from the Web Service 
functions. Also please note that I am developing the client side code in 
Windows XP using Microsoft Visual Studio C++ 2008.

To call the Web Service I use the following code:

WSBiometriaBinding webServiceBiometria;
wsbio1__matchResponse matchResponse;

webServiceBiometria.endpoint = webServiceEndpoint;
webServiceResponse = webServiceBiometria.wsbio1__match("1112", xsdBir1, 
xsdBir2, matchResponse);

The values returned by the Web Service are inside the matchResponse struct 
defined below:

struct wsbio1__matchResponse
{
    wsbio1__ValidationReturn*           response;
};

As you can see it contains the wsbio1__ValidationReturn class.

class wsbio1__ValidationReturn
{ public:
/// Element status of type xs:int.
    int status 1;       ///< Required element.
/// Element userID of type xs:string.
    std::string userID 1;       ///< Required element.
/// Element percentage of type xs:double.
    double percentage 1;        ///< Required element.
/// A handle to the soap struct that manages this instance (automatically set)
    struct soap *soap;
};

The problem is that when I read the values of returned by the Web Service using 
calls like: matchResponse.response->percentage; I get uninitialized values like 
-6.27744e+066.

I've done some debugging and I found out that the correct value is being send 
to my client and that it is also being read correctly by GSoap from the xml in 
which it arrives.

However when my program gets to the code below (inside the auto-generated code 
generated by soapcpp2.exe):

if (soap_flag_percentage1 && soap->error == SOAP_TAG_MISMATCH)
{
if (soap_in_double(soap, "percentage", &(a->ns1__ValidationReturn::percentage), 
"xsd:double"))
{
soap_flag_percentage1--;
continue;
}
}

The assingment to &(a->ns1__ValidationReturn::percentage) just doesn't work.

Can anyone help me?

Is there a way to use complex types inside GSoap or I should just change the 
Web Service so that it only returns simple types?

Thanks,
Felipe

Reply via email to