axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Primož Führer <primoz.fuh...@i-rose.si>
Subject AXIS httppost
Date Wed, 18 Jan 2006 11:07:49 GMT
Hi, 
I'm using web services on tomcat. As client i use Visual studio 6.0 c++ with axis client stubs.

With wsdl2ws i generate client stubs from wsdl. When i tried out some simple web services
which are published on Internet, work vs c++ with axis client stubs OK(RPc style). but when
i tried to use web services on tomcat(complex types), the program gave exception in generated
stub in line ...invoke() web service...

i looked with tcpmon and find out that in httppost header a parameter "Content-Length:" is
set to a number which is smaller than the actual length of the envelope. so if i set this
number from let's say 350 to 356 and in tcpmon clik send to server, i get the correct answer
else not. 
In ultra edit i see that some spaces are added at the end of lines in envelope.

i'd like to know why the spaces are added in envelope or why ,when the content-length is calculated,is
set wrong length in header?

yes and where code is actually generated header and envelope, so i could see what's wrong.
Thanks for reply.... 

Post:

POST /idoc/services/Prijava HTTP/1.1

Host: 192.168.0.210:8070

Content-Type: text/xml; charset=UTF-8

SOAPAction: ""

Content-Length: 462



<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:checkLogin xmlns:ns1="http://192.168.0.210:8070/idoc/services/Prijava">
<username xsi:type="xsd:string">primozf</username>
<pswd xsi:type="xsd:string">primozf</pswd>
</ns1:checkLogin>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Response:

HTTP/1.1 500 Internal Server Error

Content-Type: text/xml; charset=utf-8

Transfer-Encoding: chunked

Date: Wed, 18 Jan 2006 11:02:53 GMT

Server: Apache Coyote/1.0

Connection: close



202

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>org.xml.sax.SAXParseException:
Premature end of file.</faultstring><detail><ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">lexus</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

0

So if i replace Content-Length: 462 with Content-Length: 468 or put lines in envelope in one
line:

HTTP/1.1 200 OK

Content-Type: text/xml; charset=utf-8

Transfer-Encoding: chunked

Date: Wed, 18 Jan 2006 11:04:23 GMT

Server: Apache Coyote/1.0



3ab

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:checkLoginResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://192.168.0.210:8070/idoc/services/Prijava"><checkLoginReturn
xsi:type="ns2:UserPrijava" xmlns:ns2="urn:Prijava"><idInstalacije xsi:type="soapenc:int"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</idInstalacije><idUsr
xsi:type="soapenc:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">30</idUsr><jezik
xsi:type="soapenc:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1</jezik><shema
xsi:type="soapenc:string" xsi:nil="true" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/></checkLoginReturn></ns1:checkLoginResponse></soapenv:Body></soapenv:Envelope>

0


WSDL:



<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://192.168.0.210:8070/idoc/services/Prijava" xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://192.168.0.210:8070/idoc/services/Prijava" xmlns:intf="http://192.168.0.210:8070/idoc/services/Prijava"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="urn:Prijava" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)-->
 <wsdl:types>
  <schema targetNamespace="urn:Prijava" xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="UserPrijava">
    <sequence>
     <element name="idInstalacije" nillable="true" type="soapenc:int"/>
     <element name="idUsr" nillable="true" type="soapenc:int"/>
     <element name="jezik" nillable="true" type="soapenc:int"/>
     <element name="shema" nillable="true" type="soapenc:string"/>
    </sequence>
   </complexType>
  </schema>
 </wsdl:types>

   <wsdl:message name="checkLoginResponse">

      <wsdl:part name="checkLoginReturn" type="tns1:UserPrijava"/>

   </wsdl:message>

   <wsdl:message name="checkLoginRequest">

      <wsdl:part name="username" type="soapenc:string"/>

      <wsdl:part name="pswd" type="soapenc:string"/>

   </wsdl:message>

   <wsdl:portType name="Prijava">

      <wsdl:operation name="checkLogin" parameterOrder="username pswd">

         <wsdl:input message="impl:checkLoginRequest" name="checkLoginRequest"/>

         <wsdl:output message="impl:checkLoginResponse" name="checkLoginResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="PrijavaSoapBinding" type="impl:Prijava">

      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="checkLogin">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="checkLoginRequest">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://axis.idoc.irose.si"
use="encoded"/>

         </wsdl:input>

         <wsdl:output name="checkLoginResponse">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://192.168.0.210:8070/idoc/services/Prijava"
use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="PrijavaService">

      <wsdl:port binding="impl:PrijavaSoapBinding" name="Prijava">

         <wsdlsoap:address location="http://192.168.0.210:8070/idoc/services/Prijava"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>




Mime
View raw message