Имею WSDL файл (приаттачен) Теперь описание метода NewQuery
Код | <operation name="NewQuery"> <documentation>Service definition of function ns1__NewQuery</documentation> <input message="tns:NewQueryRequest"/> <output message="tns:QueryResponse"/> </operation>
|
Создаю .h файл:
Код | c:\gSOAP_DIR...\Bin>wsdl2h -o WSDmlServer.h dml_server.wsdl
|
Мне gSOAP сгенерировал такой код
Код | /// Operation "ns1__NewQuery" of service binding "dml_USCOREserver"
/**
Operation details:
Service definition of function ns1__NewQuery - SOAP RPC encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
C stub function (defined in soapClient.c[pp] generated by soapcpp2): @code int soap_call_ns1__NewQuery( struct soap *soap, NULL, // char *endpoint = NULL selects default endpoint for this operation NULL, // char *action = NULL selects default action for this operation // request parameters: std::string body, // response parameters: struct ns1__NewQueryResponse& ); @endcode
C server function (called from the service dispatcher defined in soapServer.c[pp]): @code int ns1__NewQuery( struct soap *soap, // request parameters: std::string body, // response parameters: struct ns1__NewQueryResponse& ); @endcode
C++ proxy class (defined in soapdml_USCOREserverProxy.h): class dml_USCOREserver;
Note: use soapcpp2 option '-i' to generate improved proxy and service classes;
*/
//gsoap ns1 service method-style: NewQuery rpc //gsoap ns1 service method-encoding: NewQuery http://schemas.xmlsoap.org/soap/encoding/ //gsoap ns1 service method-action: NewQuery "" int ns1__NewQuery( std::string body, ///< Request parameter struct ns1__NewQueryResponse & ///< Response struct parameter );
|
Собственно, откуда структура NewQueryResponse взялась? Ведь указано, QueryResponse... Дальше, уже в сгенерированом с помощью утилитки soapcpp2.exe коде встречаю (метод) int dml_USCOREserverProxy::NewQuery(std::string body, struct ns1__NewQueryResponse &_param_1):
Код | ... soap_get_ns1__NewQueryResponse(soap, &_param_1, "ns1:NewQueryResponse", ""); ...
|
То есть он явно с чего-то решил, что возвращаемоэ значение именно в теге <NewQueryResponse>
Я бы конечно думал, что WSDL корявый. Однако програмка http://www.soapui.org/ этот WSDL кушает и прекрасно с ним работает. Результат:
Код | <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://omnitel.lt/ws/dml_server"> <SOAP-ENV:Header/> <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <QueryResponse> <id>97518440635616</id> <status>1</status> </QueryResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
|
Так же работает и Микрософтовский тулс MSSoap3.0...
Сама серверная часть написана с помощью того же gSOAP'a
В чем проблема? |