Author |
|
kkarthikjgd
Joined: 01 Jul 2009 Posts: 4
|
Posted: Wed 01 Jul '09 16:15 Post subject: Apache 2 proxying webservices issue |
|
|
Hi,
I wrote an Apache proxy to jboss recently to route webservice requests from our clients.
There has been some strange behavior. Whenever the clients contact the server through a Java based client (like SoapUI) they are getting a valid response back.
But when they use a .NET client, the response that goes back has some strange characters in the XML.
Ex:
1f40
<?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><SomeResponse xmlns="http://abc.com/ws/indicationsxsd">
"><SortS
c0
eqNbr>110
As you can see, there are some spurious characters (1f40 and c0) that are getting added to the response.
I checked the jboss logs and our own logging system of when the response gets built and these cahracters are not there, but when wee do a packet dump at the TCP level these are showing up.
I am at wits' end figuring out what is happening. Has anyone encountered this issue?
Any help appreciated
Thanks
Karthik |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Mon 06 Jul '09 22:35 Post subject: |
|
|
It seems that those are not valid UTF-8 charakters. You have to make sure that the xml file is saved in UTF8 format and that apache servs it as a utf8 file (headers from apache).
Just my 5 cents |
|
Back to top |
|
kkarthikjgd
Joined: 01 Jul 2009 Posts: 4
|
Posted: Mon 06 Jul '09 22:38 Post subject: |
|
|
Thanks for the reply James.
The issue is not with Jboss as we had originally thought but with Apache proxying.
When connecting directly to the jboss server, the response is fine.
It looks like the apache is adding these characters to the response.
We have not been able to figure out why so far.
If you have any ideas/suggestions, please do share.
Thank You
Karthik |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Mon 06 Jul '09 22:50 Post subject: |
|
|
first idea: Sometimes tthrough the proxing the charater set is broken.
Well on a reverse proxy with mod_proxy_html I had to reset the encoding
I'm not sure if that helps in your situation, but you ca try.
Code: |
RequestHeader unset Accept-Encoding
|
in context
Code: |
ProxyPass /home http://otherserver/home
ProxyPassReverse /home http://otherserver/home
ProxyHTMLURLMap http://otherserver/home /home
<Location /home>
ProxyPassReverse /home
SetOutputFilter proxy-html
ProxyHTMLURLMap /home /
RequestHeader unset Accept-Encoding
</Location>
|
Second idea:
Maybe you have to change the CharsetDefault to UTF-8 |
|
Back to top |
|
kkarthikjgd
Joined: 01 Jul 2009 Posts: 4
|
Posted: Mon 06 Jul '09 22:53 Post subject: |
|
|
Thanks James.
I will try this here and post the results back here shortly.
Karthik |
|
Back to top |
|
tdonovan Moderator
Joined: 17 Dec 2005 Posts: 611 Location: Milford, MA, USA
|
Posted: Tue 07 Jul '09 4:26 Post subject: |
|
|
That looks like chunked encoding, as described in RFC2616.
Look for the response header: Code: | Transfer-Encoding: chunked | in the response to confirm that it is chunked encoding.
Each chunk of the response is a hexadecimal length (like 1f40), followed by that number of bytes. The last chunk should be length 0.
If so, then this is a correct way for Apache to respond. Any HTTP-1.1 client should handle chunked encoding correctly.
-tom- |
|
Back to top |
|
kkarthikjgd
Joined: 01 Jul 2009 Posts: 4
|
Posted: Tue 07 Jul '09 15:45 Post subject: |
|
|
Thank you Tom.
I will confirm shortly if that indeed is the case.
Karthik |
|
Back to top |
|