-2

I am struggling with gsoap's return parameter binding. I have a function which returns char** which is composed like this: {char*, ..., char*, NULL}. I want the generated web service to be able to transmit and process multiple strings in one parameter. Gsoap however generates only: <element name="retVal" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>

I would like it to return an array of strings, not a single string.

2 Answers 2

0

If I undesrstand your question

You can develop your own function which call the gSoap function to get the returned string from the gSoap function then split the gSoap sting to sub strings and put them into an array and then return your array of strings

0

I found an answer in the documentation. It turns out that I had to create a structure to be used to return the value and name the variables appropriately. In my case:

struct ns_cl_get_indexes_retVal {
  int __sizeIndex;
  char** index;
};

and the function in the WS-base header:

int ns__cl_get_indexes ( int32_t db_id,  struct ns_cl_get_indexes_retVal& retVal );

Which resulted in a proper xml generation, as seen in wsdl:

<element name="index" type="xsd:string" minOccurs="0" maxOccurs="unbounded" nillable="true"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.