You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Chris Mannion <ch...@nonstopgov.com> on 2010/01/26 09:51:05 UTC

http headers on axis soap messages

Hi All

I'm having a problem with a system that's using Axis 1 to send SOAP
messages to an external web-service.  I have two version of the
system, both run Tomcat with Axis 1.4 and ws calls are made through a
pretty simple, low level client program.  The client builds and sends
a call as follows -

    InputStream in = new ByteArrayInputStream(envelope.getBytes()); //
envelope is a string containing the XML of a full SOAP message
    MessageFactory mf = MessageFactory.newInstance();
    SOAPMessage message = mf.createMessage(new MimeHeaders(), in);
    message.getMimeHeaders().setHeader("SOAPAction", soapAction);
    // Put the http basic auth in the mime-headers if required
    if(!NSGTools.isValueNull(httpAuthString))
        message.getMimeHeaders().setHeader("Authorization", httpAuthString);

    SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
    SOAPConnection con = scf.createConnection();
    SOAPMessage response = con.call(message, endpointAddress);

The problem I'm having is that one of the two systems calls the
web-service successfully, the second fails.  As I said, both are
running the same code, same versions of libraries etc.  We've captured
the HTTP messaging going out to the web-service and while the SOAP
envelope being sent looks the same in each case, there are some
differences in the HTTP headers.  I'm really not familiar with headers
so would appreciate any help in trying to interpret the differences,
what could be causing them and if they could potentially break the
message.

The headers on the successful web-service call are -
POST
/webservices/services/WebServicesCareConnect
HTTP/1.0
Content-Type:text/xml;
charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: 10.1.1.90:10051
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 1060
Authorization: Basic.d2Vic2VydmljZXVzZXI6d2Vic2VydmljZXVzZXI=

The headers on the failing call are -
POST
/webservices/services/WebServicesCareConnect
HTTP/1.1
Content-Type: text/xml;
charset=utf-8
SOAPAction: ""
User-Agent: Axis/1.4
Authorization: Basic.b2xtZ3JvdXA6b2xtZ3JvdXA=
Host: 10.1.1.69:8101
Transfer-Encoding: chunked
404

So, the obvious worry is that last 404, it is shown at the end of the
headers immediately before the actual SOAP content is show but I have
no idea where it comes from or what it relates to, so any suggestions
would be gratefully received.  The other thing that stands out is the
use of HTTP1.1 on the failing server, I've asked the people
maintaining the server to check for any settings that could have
specified this but are there any inside Axis that could?  And am I
right in thinking that the Transfer-Encoding: chunked is just a
consequence of HTTP1.1 being used?

-- 
Chris Mannion
iCasework and LocalAlert implementation team
0208 144 4416