ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Calling external webservice thru HTTP Request.

Post new topic  Reply to topic
 Calling external webservice thru HTTP Request. « View previous topic :: View next topic » 
Author Message
er_pankajgupta84
PostPosted: Mon May 18, 2009 4:57 am    Post subject: Calling external webservice thru HTTP Request. Reply with quote

Master

Joined: 14 Nov 2008
Posts: 203
Location: charlotte,NC, USA

There is a web service hosted on the internet that converts one currency into another..

http://www.webservicex.net/CurrencyConvertor.asmx

I need to create a flow that can send a request to this service and receive a response back.

The input message this service needs is:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<web:ConversionRate xmlns:web="http://www.webserviceX.NET/">
<web:FromCurrency>USD</web:FromCurrency>
<web:ToCurrency>INR</web:ToCurrency>
</web:ConversionRate>
</soapenv:Body>
</soapenv:Envelope>


I am able to invoke this service using a third party web service client like NetTool & SOAPUI. But not from my message broker. I am getting an HTTP/1.1 500 Internal Server Error

I need to use HTTP Request node to invoke this web service.

Here is a brief description on my flow.

I tried 2 flavours:

1. MQInput -> SOAPEnvelope -> HTTP Request -> MQOutput.
2. MQINPUT -> HTTP Request -> MQOutput.

But both of them are not working. HTTP/1.1 500 Internal Server Error


NOTE:
I have set XMLNSC as parser on my MQInput node.
URL to invoke has been hardcoded in HTTPRequest node's properties with all other properties as default.

For 1st flow i have used the following message as input:

<web:ConversionRate>
<web:FromCurrency>INR</web:FromCurrency>
<web:ToCurrency>USD</web:ToCurrency>
</web:ConversionRate>


For Second flow i have used the SOAP message used to invoke the web service directly from NetTool.

Can anybody try this small flow and let me know what i am missing.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
mqjeff
PostPosted: Mon May 18, 2009 5:04 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You need to figure out what the message you are giving to the HTTPRequest looks like.

Then you can figure out how to change it to match what it SHOULD be.
Back to top
View user's profile Send private message
er_pankajgupta84
PostPosted: Mon May 18, 2009 5:16 am    Post subject: Reply with quote

Master

Joined: 14 Nov 2008
Posts: 203
Location: charlotte,NC, USA

Can you please elaborate...on your statement...

This is a web service...and all the clients should send the same kind of message in order to invoke it...

I have already provided the message i used for invoking it using a tool. Now I need to invoke it thru a flow..using HttpRequest node..

I believe "HTTP/1.1 500 Internal Server Error" is not due to message structure...its something because of connectivity as we received this error message on the FAULT terminal of HTTPRequest node.

Is there any kind of property i need to check...while invoking any external webservice using HTTPRequest node??
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
mqjeff
PostPosted: Mon May 18, 2009 5:30 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

No, there is no property. And, no, you do NOT know for sure that you have provided a good message to the HTTPRequest.

The first thing you need to do is understand what the message looks like when it leaves the MQInput node's "out" terminal. Then you need to understand what it looks like just before it goes into the HTTPRequest node's "in" terminal.

Or you could spend a bit more time looking at the error that's produced and seeing what the webservice is complaining about besides just providing HTTP error 500.
Back to top
View user's profile Send private message
er_pankajgupta84
PostPosted: Mon May 18, 2009 5:31 am    Post subject: Reply with quote

Master

Joined: 14 Nov 2008
Posts: 203
Location: charlotte,NC, USA

Just for your information,

I have not set any HTTPRequest Header manually using any Compute/JCN node, it is defualt. Do we need to generate them manually for invoking web services?
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
mqjeff
PostPosted: Mon May 18, 2009 5:40 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You need to make sure that the message that is passed to the HTTPRequest node is properly formatted for the options that you have set on the HTTPRequest node, and that it matches what the HTTP service is expecting.

Since you have not mentioned using any compute or Java compute nodes, it was clear that you were not doing anything specific to construct an HTTP header.

However, since you have also failed to specify what version of Message Broker you are using, it is entirely unclear if you need to do this or not.
Back to top
View user's profile Send private message
er_pankajgupta84
PostPosted: Mon May 18, 2009 5:58 am    Post subject: Reply with quote

Master

Joined: 14 Nov 2008
Posts: 203
Location: charlotte,NC, USA

I am using 6.1....

Please note that i am able to invoke the web service using SOAP Request node.
[/img]
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Vitor
PostPosted: Mon May 18, 2009 6:02 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

er_pankajgupta84 wrote:
Please note that i am able to invoke the web service using SOAP Request node.


Which begs the question:

er_pankajgupta84 wrote:
I need to use HTTP Request node to invoke this web service


Why?

It also begs the question "what's different about my message?" between using the SOAP Request & SOAP Envelope/HTTP Request again.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
recallsunny
PostPosted: Mon May 18, 2009 1:24 pm    Post subject: Reply with quote

Disciple

Joined: 15 Jun 2005
Posts: 163
Location: Massachusetts

You need to determine the difference between the messages coming out of your HTTPRequest nodes Vs the working version of SOAP request.

An easy way to debug this:

On the NetTool window, there is a tab for "TCP Tunnel" > Click on this and enter the Port number on Local Address to be the same port as target

Example if target is http://www.webservicex.net:7080/CurrencyConvertor.asmx then enter the port as 7080

On the Tunnel To section, enter the Target name/IP and the port of target (7080).

Now in your HTTPRequest node change the URL to point to http://Localhost:7080/CurrencyConvertor.asmx

Start the HTTP tunnel and run a transaction through your flow. The actual request sent out of HTTPRequest node is tunneled through nettool and should now appear in the TCP tunnel window. Compare this with the working version of SOAP message to find out where it differs.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Calling external webservice thru HTTP Request.
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.