aspose file tools*
The moose likes Web Services and the fly likes Extrange codes in the response from axis Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Extrange codes in the response from axis" Watch "Extrange codes in the response from axis" New topic
Author

Extrange codes in the response from axis

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi all, i'm sending a request for a services to my axis module. This is the message i send:
POST /axis/services HTTP/1.1
SOAPAction: OfertaServicio#seleccionar
Content-Type: text/xml
Content-Length: 528
User-Agent: kSOAP/1.0
Host: localhost
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<seleccionar xmlns="OfertaServicio" id="o0" SOAP-ENC:root="1">
<nombreServicio xmlns="" xsi:type="xsd:string">servicio1</nombreServicio>
</seleccionar>
</SOAP-ENV:Body></SOAP-ENV:Envelope>
as you can say, i use ksoap from a MIDLET to send my message. The problem is that the response i get from axis contains 'extrange characters' (I think this term is not correct) causing my parser to rise a ParseException (I'm using kxml). This is the response:
HTTP/1.1 200 OK
Date: Tue, 25 Mar 2003 13:28:20 GMT
Server: WebLogic WebLogic Server 6.1 SP4 11/08/2002 21:50:43 #221641
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: Chunked
0204
<?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:seleccionarResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="OfertaServicio">
<seleccionarReturn xsi:type="xsd:string">Hola majete, tu mensaje: servicio1</seleccionarReturn>
</ns1:seleccionarResponse>
</soapenv:Body>
</soapenv:Envelope>
0000

Why axis put the '0204' and '0000' at the begining and the end of the mesagge? Is it related with the Transfer Encoding: Chunked?
Any idea is welcome.
Thank in advance.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
"Chunked" Transfer Coding is basically another way to tell the client "how much stuff I intended to send".
When serving a static file, the web server can use the Content-Length HTTP header to say "I'm sending out 2142 bytes, hope you get it all". When the content is generated dynamically, the server would either need to load the whole data into memory, measure the length, and then send it to the client, OR use another scheme, which is the Chunked Transfer Coding.
In the Chunked Transfer Coding, there is the length of the following chunk before the chunk itself. See chapter 3.6.1 of the HTTP 1.1 RFC at http://www.ietf.org/rfc/rfc2616.txt for details.
[ March 25, 2003: Message edited by: Lasse Koskela ]

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
As far as i could read, the codes come from the chunked transfer encoding. Now this is right, but how can I read these mesagges from my MIDLET? And why the KSOAP-MIDLET fails but not the one for Standar Edition?
Thanks
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Have you checked the kSOAP mailing lists at ksoap.enhydra.org? There used to be something about a HttpTransport class not being included or a wrong version was included in the distribution archive, which caused the server to use chunked encoding (or something like that).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Extrange codes in the response from axis