axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Primož Führer <>
Subject AXIS httppost
Date Wed, 18 Jan 2006 11:07:49 GMT
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 /idoc/services/Prijava HTTP/1.1


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

SOAPAction: ""

Content-Length: 462

<?xml version='1.0' encoding='utf-8' ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:xsd=""
<ns1:checkLogin xmlns:ns1="">
<username xsi:type="xsd:string">primozf</username>
<pswd xsi:type="xsd:string">primozf</pswd>


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


<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv=""
xmlns:xsd="" xmlns:xsi=""><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>org.xml.sax.SAXParseException:
Premature end of file.</faultstring><detail><ns1:hostname xmlns:ns1="">lexus</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>


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

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


<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv=""
xmlns:xsd="" xmlns:xsi=""><soapenv:Body><ns1:checkLoginResponse
soapenv:encodingStyle="" xmlns:ns1=""><checkLoginReturn
xsi:type="ns2:UserPrijava" xmlns:ns2="urn:Prijava"><idInstalacije xsi:type="soapenc:int"
xsi:type="soapenc:int" xmlns:soapenc="">30</idUsr><jezik
xsi:type="soapenc:int" xmlns:soapenc="">1</jezik><shema
xsi:type="soapenc:string" xsi:nil="true" xmlns:soapenc=""/></checkLoginReturn></ns1:checkLoginResponse></soapenv:Body></soapenv:Envelope>



<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="" xmlns:apachesoap=""
xmlns:impl="" xmlns:intf=""
xmlns:soapenc="" xmlns:tns1="urn:Prijava" xmlns:wsdl=""
xmlns:wsdlsoap="" xmlns:xsd="">
<!--WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)-->
  <schema targetNamespace="urn:Prijava" xmlns="">
   <import namespace=""/>
   <complexType name="UserPrijava">
     <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"/>

   <wsdl:message name="checkLoginResponse">

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


   <wsdl:message name="checkLoginRequest">

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

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


   <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:binding name="PrijavaSoapBinding" type="impl:Prijava">

      <wsdlsoap:binding style="rpc" transport=""/>

      <wsdl:operation name="checkLogin">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="checkLoginRequest">

            <wsdlsoap:body encodingStyle="" namespace=""


         <wsdl:output name="checkLoginResponse">

            <wsdlsoap:body encodingStyle="" namespace=""




   <wsdl:service name="PrijavaService">

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

         <wsdlsoap:address location=""/>




View raw message