Try turning off HTTP chunking. Look here: http://wso2.org/library/209
________________________________ From: Anish P S [mailto:[email protected]] Sent: Wednesday, January 20, 2010 7:24 AM To: [email protected] Subject: [Axis2] Hi, I am new to Axis Web Service development. I am writing an Axis2 web service client code to invoke a web service deployed by Swiss customs. I generated my client and stubs using wsdl2java tool provided by Axis2 When I tried to run my client and monitor this HTTP traffic using TCPMonitor tool, I get the following message from the server: org.apache.axis2.AxisFault: org.xml.sax.SAXParseException: Premature end of file. The complete response below. <?xml version='1.0' encoding='utf-8'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server.Exception</faultcode> <faultstring>org.xml.sax.SAXParseException: Premature end of file.</faultstring> <detail /> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope> At the same time I have been able to call this webservice through SoapUI( A tool for sending SOAP Message ) with the SOAP envelope generated by the Axis2 client code. It seems that Axis2 send request which cannot be parsed by server I believe this issue happens on account of HTTP Request got some junk values before and after the SOAP Envelope(i am not sure). See below the HTTP request monitored over TCP Monitor, junk values are made green.(i dont know whether it is junk or something else) POST / HTTP/1.1 Content-Type: text/xml; charset=UTF-8 SOAPAction: "goodsDeclarations" User-Agent: Axis2 Host: 162.23.37.24:443 Transfer-Encoding: chunked 728 <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:goodsDeclarations<http://schemas.xmlsoap.org/soap/envelope/> xmlns:ns1="http://www.e-dec.ch/xml/schema/edec/v2" schemaVersion="2.2"><ns1:goodsDeclaration><ns1:serviceType>1</ns1:serviceType><ns1:traderDeclarationNumber>2258</ns1:traderDeclarationNumber><ns1:clearanceLocation>2</ns1:clearanceLocation><ns1:declarationTime>99</ns1:declarationTime><ns1:declarationType>99</ns1:declarationType><ns1:correctionCode>0</ns1:correctionCode><ns1:language>de</ns1:language><ns1:transportMeans><ns1:transportMode>2</ns1:transportMode></ns1:transportMeans><ns1:transportInContainer>0</ns1:transportInContainer><ns1:consignee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:consignee_type0"><ns1:name>212</ns1:name><ns1:street>212</ns1:street><ns1:postalCode>212</ns1:postalCode><ns1:city>212</ns1:city><ns1:country>22</ns1:country></ns1:consignee><ns1:declarant><ns1:traderIdentificationNumber>132</ns1:traderIdentificationNumber><ns1:declarantNumber>132</ns1:declarantNumber></ns1:declarant><ns1:business /><ns1:goodsItem><ns1:traderItemID>212</ns1:traderItemID><ns1:description>222</ns1:description><ns1:commodityCode>123</ns1:commodityCode><ns1:grossMass>2.12</ns1:grossMass><ns1:permitObligation>2122</ns1:permitObligation><ns1:nonCustomsLawObligation>2311</ns1:nonCustomsLawObligation><ns1:statistic><ns1:customsClearanceType>2323</ns1:customsClearanceType><ns1:commercialGood>1</ns1:commercialGood><ns1:statisticalValue>123</ns1:statisticalValue></ns1:statistic><ns1:packaging><ns1:packagingType>123</ns1:packagingType><ns1:quantity>2</ns1:quantity><ns1:packagingReferenceNumber>2122</ns1:packagingReferenceNumber></ns1:packaging></ns1:goodsItem></ns1:goodsDeclaration></ns1:goodsDeclarations></soapenv:Body></soapenv:Envelope> 0 If i paste the above code over SoapUI after junk values being removed,it works pretty well and return a valid soap response. So i feel the problem is with the Axis2 client code. I dont know how to go about this,please help me to get this issue over. Thanks in Advance. Regards, Anish P S CS-Techno Pvt Ltd Cochin,India Mob:9539299747 www.cs-techno.com<http://www.cs-techno.com> ________________________________ STATEMENT OF CONFIDENTIALITY: The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify WHI Solutions immediately at [email protected], and destroy all copies of this message and any attachments.
