File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes JAX WS not producing correct HTTP request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAX WS not producing correct HTTP request" Watch "JAX WS not producing correct HTTP request" New topic
Author

JAX WS not producing correct HTTP request

Somak Dalui
Ranch Hand

Joined: Apr 19, 2005
Posts: 40
I have generated the stub files through wsimport from the remote wsdl and have created a standalone client. Now when I am running the client, the HTTP request that is produced is this :

---[HTTP request - http://www.transportdirect.info/EnhancedExposedServices/CarJourneyPlannerSynchronous/v1/CarJourneyPlannerSynchronousService.asmx]---
Content-type: text/xml;charset="utf-8"
Soapaction: "http://www.transportdirect.info/TransportDirect.EnhancedExposedServices.CarJourneyPlannerSynchronous.V1/GetGridReference"
Accept: text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
<?xml version="1.0" ?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>USERNAME</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</S:Header>
<S:Body>
<GetGridReference xmlns="http://www.transportdirect.info/TransportDirect.EnhancedExposedServices.CarJourneyPlannerSynchronous.V1">
<transactionId>bfe2ccbe-9197-4992-9073-cd3a3c0e5c47</transactionId>
<locationType>Postcode</locationType>
<locationValue>W11</locationValue>
</GetGridReference>
</S:Body>
</S:Envelope>
--------------------

Now, the SOAP Envelope part is perfectly alright as I have tested it with SOAP tools and have got correct output. But the above HTTP request is always giving me


---[HTTP response - http://www.transportdirect.info/EnhancedExposedServices/CarJourneyPlannerSynchronous/v1/CarJourneyPl
annerSynchronousService.asmx - 500]---
null: HTTP/1.1 500 Internal Server Error
Cache-control: private
X-ua-compatible: IE=EmulateIE7
Content-type: text/html; charset=utf-8
Content-length: 7424
Connection: close
X-powered-by: ASP.NET

followed by lots of html tags, describing some error.

My Java client code looks like this -



Can you please tell me what am I missing here ? Please let me know if you want to see more code.

Thanks.


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAX WS not producing correct HTTP request
 
Similar Threads
ORA-29532: Java call terminated by uncaught Java exception:
HeaderElements must be namespace qualified when create soap client
Error: MustUnderstand headers:[{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-s
how to implement ws-security in soap request header
Java Client for a SOAP wsdl with basic authentication