Hi Friends, I am trying to communicate with another application from our application based on XML request and response scenario.
Initially, I sent a XML request using HttpConnection (open connection, write a stream and flush it) and go successfull response back.. But when I tried to send the same request using HttpClient ( post method) am getting XML Malformed error message. I am guessing, will HttpClient (common's) implementation may add some kind of HTTP enevlope the XML request. 1. Is my guess correct? 2. Please explain what is happening there?? (it is working with HttpConnection but not with HttpClient)
There's no such thing as an HTTP envelope, just an HTTP header (which may differ slightly between HTTP libraries). But that should have no impact on the HTTP body.
Is the request being received by the other side the same in both cases? It sounds like it is not, and investigating how it differs would be an important first step in tracking this down. You could write the full request stream to a file in both cases and compare them.
Ping & DNS - updated with new look and Ping home screen widget
Joined: Jan 17, 2006
Incase of HttpClient, it is adding some escape characters in the request. That is causing the problem. Please help how to avoid this.. here is the request info..