• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Extrange codes in the response from axis  RSS feed

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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 ]
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!