Author |
Message
|
chaitu |
Posted: Tue Mar 03, 2015 3:14 am Post subject: calling multiple services |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hello All,
My requirement is I have to call a web service depending on the operation which I have in input request. My flow is like http inputnode>compute>soap request node. If operation is 1 then i have to call service1 if it is 2 then i have to call service2. I am overriding the soap request node property webservice URL in compute node. But i am unable to achieve. Could anyone please help me
Thanks in advance. |
|
Back to top |
|
 |
Simbu |
Posted: Tue Mar 03, 2015 3:20 am Post subject: |
|
|
 Master
Joined: 17 Jun 2011 Posts: 289 Location: Tamil Nadu, India
|
Hi, What is the error message you are getting? What is the MB version you are using? |
|
Back to top |
|
 |
chaitu |
Posted: Tue Mar 03, 2015 3:25 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hi Simbu,
I am using IIB v9. And if i give operation1 it is working fine because the soap request node is configured for to call service1, if i give operation2 it is not calling service2 .
Thanks in advance. |
|
Back to top |
|
 |
chaitu |
Posted: Tue Mar 03, 2015 3:34 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hi,
the code is
IF OP = 'operation1' THEN
SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.WebServiceURL = 'http://myurl?Wsdll';
SET OutputLocalEnvironment.Destination.SOAP.Request.Operation = 'opname1';
elseIF OP = 'operation2' THEN
SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.WebServiceURL = 'http://myurl?Wsdll';
SET OutputLocalEnvironment.Destination.SOAP.Request.Operation = 'opname2';.
Error is
Unable to find a valid matching Operation in the WSDL file for the operation: 'opname2'.
Thanks |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Mar 03, 2015 4:07 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Have you?
Set the mode for the compute Node to 'Message and Local Environment'?
don't you have to set the URL and the URI in different Local Environment variables?
for example.{copied from the V7 Inforcentre}
Code: |
SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.RequestURI =
'/abc/def?x=y&g=h';
SET OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.WebServiceURL =
'http://ibm.com/abc/';
|
It could be that 'Operation1' works because it is the default operation of the WSDL.
This ESQL calls a WebService
Code: |
create field OutputLocalEnvironment.Destination.SOAP.Request;
declare lenvRef REFERENCE to OutputLocalEnvironment.Destination.SOAP.Request;
SET lenvRef.Operation = 'SendBankEvent';
SET lenvRef.Transport.HTTP.WebServiceURL = 'http://PAYSYSTEM:8901';
|
the default WebService URL as configured in the HTTP Transport part of the SOAP Request node says something like
Code: |
http://localhost:7800/PAYWeb/PAYWebService_V1.svc
|
so the two lines of ESQL can override the 'http://localhost:7800' part leaving the URI alone and set the Operation as 'SendBankEvent'. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
chaitu |
Posted: Tue Mar 03, 2015 9:49 pm Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hello,
yep I set the compute node property and also i tried the below code but still same error.Still I am trying to resolve it. Is there any other way to do this?
Thanks in advance. |
|
Back to top |
|
 |
Simbu |
Posted: Tue Mar 03, 2015 10:34 pm Post subject: |
|
|
 Master
Joined: 17 Jun 2011 Posts: 289 Location: Tamil Nadu, India
|
Are you using different wsdl file for both the services? Try switching SOAPRequest node to Gateway node and test. |
|
Back to top |
|
 |
chaitu |
Posted: Tue Mar 03, 2015 10:38 pm Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Yes I am using two different WSDL files and I also tested in Gateway mode.
Thanks for your reply. |
|
Back to top |
|
 |
Simbu |
Posted: Tue Mar 03, 2015 11:01 pm Post subject: |
|
|
 Master
Joined: 17 Jun 2011 Posts: 289 Location: Tamil Nadu, India
|
If it still not working with Gateway mode then I think the problem may be with the Endpoint you are hitting or the way you set the endpoint in LE.
One more option is to use two different SOAPRequest nodes( hard-code the endpoint in code) for each wsdl and route to these nodes based on the operations. |
|
Back to top |
|
 |
chaitu |
Posted: Tue Mar 03, 2015 11:09 pm Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hi,
Now I am trying to implement with two request node I will get you back if i achieve it.
Thanks Simbhu. |
|
Back to top |
|
 |
chaitu |
Posted: Wed Mar 04, 2015 1:45 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hi All,
I used two soap request nodes in my flow now its working fine.
Thanks for your support.  |
|
Back to top |
|
 |
ganesh |
Posted: Wed Mar 04, 2015 9:57 am Post subject: |
|
|
Master
Joined: 18 Jul 2010 Posts: 294
|
chaitu wrote: |
Hi All,
I used two soap request nodes in my flow now its working fine.
Thanks for your support.  |
What Simbu suggested was just a test to see if the endpoints are up and running. If your service grows and now if you have 10 operations then will you put 10 soap request nodes in your flow ?
For a permanent fix you should try and figure out why you are getting operation not found error. |
|
Back to top |
|
 |
mgk |
Posted: Wed Mar 04, 2015 12:49 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
Yes I am using two different WSDL files and I also tested in Gateway mode |
if you are using two different WSDLs then you have only two choices - use Gateway mode, or use two different SOAPRequest nodes (ope per WSDL file). The dynamic override for the Operation is only to choose a different Operation within the same WSDL as the one specified on the node. In Gateway mode, as you have no WSDL, there is no need to set the operation dynamically. In either case you cannot download the WDSL to use using ?wsdl dynamically. In both cases you can set the location of the service dynamically using the WebServiceURL override but this does not switch the WSDL used.
Kind regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
chaitu |
Posted: Thu Mar 05, 2015 1:31 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2014 Posts: 89
|
Hi All,
For now we are using only two services so i achieved it but as mgk said i will work in gateway mode and try to trace out it.
Thanks for your suggestions. |
|
Back to top |
|
 |
|