Web services, JAX-RPC, SOAP and Tomcat

S

smirks

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
 
Joined
Dec 22, 2009
Messages
1
Reaction score
0
Hello,

I have a webservice (in jaxrpc) deployed on glassfish and I need to transfer to tomcat.

can you help with that? (jaxrpc in tomcat)

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,006
Latest member
LauraSkx64

Latest Threads

Top