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 » How to call webservice in loop?

Post new topic  Reply to topic
 How to call webservice in loop? « View previous topic :: View next topic » 
Author Message
Pallavi31
PostPosted: Wed Jan 23, 2013 12:34 am    Post subject: How to call webservice in loop? Reply with quote

Newbie

Joined: 23 Jan 2013
Posts: 3

Hi

How to call service for each loop of while in Java compute node or esql.
I have a requirment that I have to call service for each element in message. So how does control come back after calling a service
Back to top
View user's profile Send private message
exerk
PostPosted: Wed Jan 23, 2013 12:45 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

This sounds like Broker to me, so moving it to that forum...
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
Pallavi31
PostPosted: Wed Jan 23, 2013 12:54 am    Post subject: Reply with quote

Newbie

Joined: 23 Jan 2013
Posts: 3

Can you please link me there
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jan 23, 2013 1:21 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/topic/com.ibm.etools.mft.doc/ac56190_.htm
Back to top
View user's profile Send private message
Pallavi31
PostPosted: Wed Jan 23, 2013 1:35 am    Post subject: Reply with quote

Newbie

Joined: 23 Jan 2013
Posts: 3

Throgh SOAP request we can call the service once
If we want to call service multiple times throgh loop in previous ESQL/JCN, Then how to do that
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jan 23, 2013 1:59 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

pallavi.bhasme wrote:
Throgh SOAP request we can call the service once
If we want to call service multiple times throgh loop in previous ESQL/JCN, Then how to do that


using propagate.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Jan 23, 2013 5:47 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

pallavi.bhasme wrote:
Throgh SOAP request we can call the service once
If we want to call service multiple times throgh loop in previous ESQL/JCN, Then how to do that


Do you have a coach or mentor on your site? Have you read the InfoCentre? Have you attended the required training?

Your question is a basic question answered in all these other forums. This forum is generally used by people who get stuck on a particular problem after having attended the training or read thoroughly the InfoCentre.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
arun4ruu
PostPosted: Mon Jan 28, 2013 12:29 pm    Post subject: Reply with quote

Newbie

Joined: 13 Jan 2012
Posts: 8

Hello Pallavi,

Here is the code:

Before the soap request Node write this part of code in compute node:

Code:
SET Environment.RequestRecords = CARDINALITY (InputRoot.SOAP.Body.Records[]);

WHILE ( Environment.RequestRecords > 0 )  DO 
            
SET OutPutRoot.SOAP.Body.Address = SET InputRoot.SOAP.Body.Address[Environment.RequestRecords];

PROPAGATE;
END WHILE;
RETURN FALSE;


After the soap request node, write this part of code in compute node:

Code:
IF (Environment.RequestRecords > 0)  THEN
      
SET Environment.address[Environment.ResponseRecords]   = InputRoot.XMLNSC.address;
      
SET Environment.RequestRecords = Environment.RequestRecords - 1;
SET Environment.ResponseRecords = Environment.ResponseRecords +1;
   
END IF;
 
  IF (Environment.RequestRecords = 0) THEN
      
DECLARE NEXT INTEGER 1;
SET Environment.ResponseRecords = Environment.ResponseRecords - 1;
   
       WHILE ( Environment.ResponseRecords > 0 ) DO
          
SET OutputRoot.XMLNSC.address = Environment.address[Environment.ResponseRecords];
                
SET Environment.ResponseRecords = Environment.ResponseRecords - 1;
SET NEXT = NEXT + 1;
      
    END WHILE;
     PROPAGATE;
   END IF;

RETURN FALSE;
   END;



Hope this will help you to call service multiple times through loop.

Good Luck
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon Jan 28, 2013 12:33 pm    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

arun4ruu wrote:
Hello Pallavi,

Here is the code:

Before the soap request Node write this part of code in compute node:

Code:
SET Environment.RequestRecords = CARDINALITY (InputRoot.SOAP.Body.Records[]);

WHILE ( Environment.RequestRecords > 0 )  DO 
            
SET OutPutRoot.SOAP.Body.Address = SET InputRoot.SOAP.Body.Address[Environment.RequestRecords];

PROPAGATE;
END WHILE;
RETURN FALSE;


After the soap request node, write this part of code in compute node:

Code:
IF (Environment.RequestRecords > 0)  THEN
      
SET Environment.address[Environment.ResponseRecords]   = InputRoot.XMLNSC.address;
      
SET Environment.RequestRecords = Environment.RequestRecords - 1;
SET Environment.ResponseRecords = Environment.ResponseRecords +1;
   
END IF;
 
  IF (Environment.RequestRecords = 0) THEN
      
DECLARE NEXT INTEGER 1;
SET Environment.ResponseRecords = Environment.ResponseRecords - 1;
   
       WHILE ( Environment.ResponseRecords > 0 ) DO
          
SET OutputRoot.XMLNSC.address = Environment.address[Environment.ResponseRecords];
                
SET Environment.ResponseRecords = Environment.ResponseRecords - 1;
SET NEXT = NEXT + 1;
      
    END WHILE;
     PROPAGATE;
   END IF;

RETURN FALSE;
   END;



Hope this will help you to call service multiple times through loop.

Good Luck


This is hardly the solution as the message tree is not reset before every call and therefore has extraneous elements in it left over from previous iterations.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Mon Jan 28, 2013 3:05 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:

This is hardly the solution as the message tree is not reset before every call and therefore has extraneous elements in it left over from previous iterations.


It's also not using the right way to access the next child of the response set. You should always code using references rather than [ indexVariable ] syntax.

always.

No, really. Always.
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 » How to call webservice in loop?
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.