Reputation: 366
I wrote a JAX-WS client using classes generated from wsimport to invoke a webservice. To test my client locally, I wrote an implementation of the webservice and published it locally and called it. Everything worked as expected.
One thing I noticed is that my client connects to the endpoint and issues a GET followed by another connection with a GET against the endpoint looking for the wsdl, and finally issues the POST with my payload in the same connection.
Here is the tcpmon output (edited to protect the guilty):
GET /someWS HTTP/1.1
User-Agent: Java/1.7.0_03
Host: 127.0.0.1:9877
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
----------------------------------
GET /someWS?wsdl HTTP/1.1
User-Agent: Java/1.7.0_03
Host: 127.0.0.1:9877
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
POST /someWS HTTP/1.1
Accept: text/xml, multipart/related
Content-Type: text/xml; charset=utf-8
SOAPAction: "document/http://someUrl"
User-Agent: JAX-WS RI 2.2.4-b01
Host: 127.0.0.1:9877
Connection: keep-alive
Content-Length: 610
<Valid Soap message here/>
Is this standard behaviour or I have messed something up? I am using JAX-WS RI 2.2. This works fine locally, but a certain production WS is quite unhappy with the initial GET request and throws a 500 and I was hoping that I could suppress the GET requests and just skip to the POST.
Upvotes: 2
Views: 2862
Reputation: 427
The client is not caching the wsdl file locally and hence you will see a GET request before every POST. The GET is for getting the wsdl file and the POST is for the actual web service request. Ask the client to cache the wsdl locally and refer to it.
Upvotes: 3