Hello all!

Recently I downloaded the most recent version of gSOAP toolkit and
try to build c++ client/server application based on the same WSDL
document.
The WSDL file contains only one operation with no arguments in request.

I have to compile the WSDL into .h stub using command "wsdl2h -f
-Iimport -oservice.h ./service.wsdl".
The second step was generating .cpp and .h stubs for server and client
applications using command "soapcpp2 -1 -Iimport -i -x service.h"

The service stub has been completed with the empty function and making
the standalone threaded c++ server.
Client app has been created with the simpliest c++ example from gSOAP
documentation and samples.

Both apps has been compiled with -DDEBUG macro defined:
g++ -DDEBUG -o server soapserviceSOAPService.cpp soapC.cpp
stdsoap2.cpp server.cpp -lstdc++ -lpthread
g++ -DDEBUG -o client soapserviceSOAPProxy.cpp soapC.cpp stdsoap2.cpp
client.cpp -lstdc++


But when I run server and try to connect with client app, I got fault with
the "No XML element tag" error in logs.

Here is the parts of RECV and SENT logs of the server:
==============
POST / HTTP/1.1
Host: 12.dev.tosick.net:8000
User-Agent: gSOAP/2.7
Content-Type: text/xml; charset=utf-8
Content-Length: 347
Connection: close
SOAPAction: "urn:test/logout"

<?xml version="1.0" encoding="UTF-8"?>
<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:tse="urn:test"><SOAP-ENV:Body></SO
AP-ENV:Body></SOAP-ENV:Envelope>
==============
HTTP/1.1 500 Internal Server Error
Server: gSOAP/2.7
Content-Type: text/xml; charset=utf-8
Content-Length: 563
Connection: close

<?xml version="1.0" encoding="UTF-8"?>
<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:tse="urn:test">
       <SOAP-ENV:Body
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
               <SOAP-ENV:Fault>
                       <faultcode>SOAP-ENV:Client</faultcode>
                       <faultstring>No XML element tag</faultstring>
               </SOAP-ENV:Fault>
       </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
==============

WSDL document is
==============
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:tns="urn:test" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
name="wservice" targetNamespace="urn:
test" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";>
 <wsdl:message name="logoutRequest"/>
 <wsdl:message name="logoutResponse">
       <wsdl:part name="result" type="xsd:boolean"></wsdl:part>
 </wsdl:message>
 <wsdl:portType name="port">
       <wsdl:operation name="logout">
               <wsdl:input message="tns:logoutRequest"></wsdl:input>
               <wsdl:output message="tns:logoutResponse"></wsdl:output>
       </wsdl:operation>
 </wsdl:portType>
 <wsdl:binding name="serviceSOAP" type="tns:port">
       <soap:binding style="document"
               transport="http://schemas.xmlsoap.org/soap/http"; />
       <wsdl:operation name="logout">
               <soap:operation soapAction="urn:test/logout" />
               <wsdl:input>
                       <soap:body use="literal" />
               </wsdl:input>
               <wsdl:output>
                       <soap:body use="literal" />
               </wsdl:output>
       </wsdl:operation>
 </wsdl:binding>
 <wsdl:service name="service">
   <wsdl:port binding="tns:serviceSOAP" name="remote">
     <soap:address location="http://localhost:8000/"; required="true"/>
   </wsdl:port>
 </wsdl:service>
</wsdl:definitions>
==============

OS: Linux, GCC Version is 4.1.2

And finally the question is: where I am wrong?


-- 
WBR,
Stanislav Yadykin

Reply via email to