This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Web Services and the fly likes Getting Bad Response from Web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Getting Bad Response from Web service" Watch "Getting Bad Response from Web service" New topic
Author

Getting Bad Response from Web service

Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Hi,

I'm trying to post to the web service http://www.webservicex.net/CurrencyConvertor.asmx?WSDL using SOAP.

My java program generates the following XML :



But I get the following response:



Can sum1 tell me wats wrong?? A detailed description of the service can be found here

Any sorta help wud be gr8ly appreciated.

Thanx
[ December 26, 2005: Message edited by: Mamu Jan ]

There is no patch for ignorance...
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2061
What value is in your html request for the header SOAPAction?

The link you provided showed an example with the text below

SOAPAction: "http://www.webserviceX.NET/ConversionRate"

Maybe you should do same.
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Originally posted by Jesus Angeles:
What value is in your html request for the header SOAPAction?

The link you provided showed an example with the text below

SOAPAction: "http://www.webserviceX.NET/ConversionRate"

Maybe you should do same.


When I used the above link I get an HTTP Error 404. Try opening the link in IE you'll get the same error.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42919
    
  68
You're not supposed to access that URL, you should use it as value of the SOAPAction HTTP header as was suggested.
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Originally posted by Ulf Dittmer:
You're not supposed to access that URL, you should use it as value of the SOAPAction HTTP header as was suggested.


Plz can u show me how I can set a value for the SOAPAction HTTP header. I've never heard of SOAPAction b4

Thanx
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
This is the XML Message I need to generate :



and this is my code



I cudnt find any error in the code ?!! Can sum1 help me !
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42919
    
  68
You can set HTTP headers like so:

MimeHeaders hd = message.getMimeHeaders();
hd.addHeader("SOAPAction", "http://www.webserviceX.NET/ConversionRate");
[ December 29, 2005: Message edited by: Ulf Dittmer ]
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Thanx every1 ! My program is working now !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting Bad Response from Web service