Web services, JAX-RPC, SOAP and Tomcat



Hi,

I am serving a web service on Tomcat 5.5 using JAX-RPC and have
encountered a problem.

I have genereated and used a client for my web service using JWSDP 1.5
and it works successfully. However, when a colleague tries to access
the service using a client generated by Axis 1.2RC3, it gives him an
HTTP 415 error (Unsupported media type).

When analysing what I'm sending and comparing it to what he is sending,
I found that the content-type and accept http headers are different. My
HTTP Content-Type header is set to text/xml, while his is set to
application/soap+xml. My Accept header is set to text/html, image/gif,
image/jpeg, *; q=.2, */*; q=.2 while his is set to
application/soap+xml, application/dime, multipart/related, text/*

The problem is that with the text/xml MIME-type, my request works as
can be seen below:

(Request)

POST /MNPInterconnectWS-Live/MNPInterconnectWS HTTP/1.1
Content-Type: text/xml; charset=utf-8
Content-Length: 818
SOAPAction: ""
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Java/1.5.0_03
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:ns0="http://mnp.com.mt/MNPInterconnectWS";
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";><env:Body><ns0:authorizationRequest><long_1
xsi:type="xsd:long">0</long_1><int_2 xsi:type="xsd:int">0</int_2><int_3
xsi:type="xsd:int">0</int_3><String_4
xsi:type="xsd:string"></String_4><String_5
xsi:type="xsd:string"></String_5><String_6
xsi:type="xsd:string"></String_6><int_7
xsi:type="xsd:int">0</int_7><String_8
xsi:type="xsd:string"></String_8><String_9
xsi:type="xsd:string"></String_9></ns0:authorizationRequest></env:Body></env:Envelope>

(Response)

HTTP/1.1 200 OK
Date: Tue, 14 Jun 2005 17:56:45 GMT
Server: Apache/2.0.54 (Unix) mod_jk/1.2.10
SOAPAction: ""
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked

1d9
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:ns0="http://mnp.com.mt/MNPInterconnectWS";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";><env:Body><ns0:authorizationRequestResponse><result
xsi:type="xsd:int">0</result></ns0:authorizationRequestResponse></env:Body></env:Envelope>
0


On the other hand, my colleague's request doesn't work and the server
immediately returns HTTP error 415. I have noticed that the SOAP
message doesn't even reach the SOAP message handlers that I have
configured for the web service.

(Request)

POST /MNPInterconnectWS-Live/MNPInterconnectWS HTTP/1.0
Content-Type: application/soap+xml; charset=UTF-8
Accept: application/soap+xml, application/dime, multipart/related,
text/*
User-Agent: Axis/1.2RC3
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 818

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><soapenv:Body><ns1:authorizationRequest
soapenv:encodingStyle="http://www.w3.org/2003/05/soap-encoding";
xmlns:ns1="http://mnp.com.mt/MNPInterconnectWS";><long_1 id="id0"
xsi:type="xsd:long">0</long_1><int_2 id="id1"
xsi:type="xsd:int">0</int_2><int_3 id="id2"
xsi:type="xsd:int">0</int_3><String_4
xsi:type="xsd:string"></String_4><String_5
xsi:type="xsd:string"></String_5><String_6
xsi:type="xsd:string"></String_6><int_7 id="id3"
xsi:type="xsd:int">0</int_7><String_8
xsi:type="xsd:string"></String_8><String_9
xsi:type="xsd:string"></String_9></ns1:authorizationRequest></soapenv:Body></soapenv:Envelope>

(Response)

HTTP/1.1 415 Unsupported Media Type
Date: Tue, 14 Jun 2005 13:29:53 GMT
Server: Apache/2.0.54 (Unix) mod_jk/1.2.10
Content-Length: 487
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>415 Unsupported Media Type</title>
</head><body>
<h1>Unsupported Media Type</h1>
<p>The supplied request data is not in a format
acceptable for processing by this resource.</p>
<p>Additionally, a 415 Unsupported Media Type
error was encountered while trying to use an ErrorDocument to handle
the request.</p>
<hr>
</body></html>

Does anyone know what's going on? Do I have to configure JAX-RPC to
support the above mime-types? How would I do that?

I would be very grateful if you could help me, as I'm quite lost at
this point and I have spent a whole day trying to fix it, to no avail!

I thank you in advance.

Regards,
Clyde

.



Relevant Pages

  • Re: Connection limit
    ... If I start the program generating threads every 200 milliseconds each wanting to call the web service. ... Sometimes these threads back up for no apparent reason and there will be for example 50 threads concurrently running each trying to make web request. ... If I have the program stop creating threads at that point, I see in Fiddler that it takes over a minute for those all of those threads to make their http calls to the web service, get their responses and end. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Events from a web service ?
    ... Perhaps HTTP chunking to get events from web service to ... Or one could issue a GetEvent request to a web service in a separate ... ASP.NET thread pool threads for large number of clients? ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: How complex is this, really?
    ... take calls when customers call and complain they did not get the ... it's a way to make a request over HTTP, with or without data being sent; ... services and if learning to write a web service to do this project is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Dynamic WSDL Generation
    ... that performs SSL termination. ... load balancer terminates the SSL connection and passes the request to ... the web server via http. ... This all works fine for accessing the web service itself. ...
    (microsoft.public.dotnet.xml)
  • Re: Asynchronous Web Service Call
    ... I think I understand your request so here goes.... ... How is the request handled from a consumer perpective? ... stage later when the web service process is complete, ... The background of my question adresses server to ...
    (microsoft.public.dotnet.framework.aspnet.webservices)