# HttpGateway loop

**URL:** <https://techcommunity.softwareag.com/t/httpgateway-loop/59582>\
**Category:** Forum\
**Tags:** Former-Crossvision-Products, Service-Orchestrator\
**Created:** [February 7, 2006, 5:15pm UTC](https://techcommunity.softwareag.com/t/httpgateway-loop/59582 "2006-02-07T17:15:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raffaele\_Apisa](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@Raffaele\_Apisa](https://techcommunity.softwareag.com/u/Raffaele_Apisa)\
**Post date:** [February 7, 2006, 5:15pm UTC](https://techcommunity.softwareag.com/t/httpgateway-loop/59582/1 "2006-02-07T17:15:09Z")

</div>

Hi Mediators,

I have a problem invoking a SagHttpGateway inside a while loop.  
My sequence performs a XQuery in Tamino and transforms the result by a SagTransformer component.  
The XSL transformation make a list of Mediator sequences url, like:

[http://localhost:8080/mediator/ServletPortal?xbd.sequence.uri=http://localhost:8080/slide/files/MediatorRepository/Cisalpina/XML/Components/AutoRecoveryINSequence.xml&user.id=telecom&user.xbm.id=77&user.doctype=Document&xbd.resource.cache=false&user.sequenceName=AS400TSequence.xml&user.ino.id=77&user.pro.id=77&user.pro.child.id=3&user.codazienda=03](http://localhost:8080/mediator/ServletPortal?xbd.sequence.uri=http://localhost:8080/slide/files/MediatorRepository/Cisalpina/XML/Components/AutoRecoveryINSequence.xml&user.id=telecom&user.xbm.id=77&user.doctype=Document&xbd.resource.cache=false&user.sequenceName=AS400TSequence.xml&user.ino.id=77&user.pro.id=77&user.pro.child.id=3&user.codazienda=03)

These urls are invoked in a while component by HttpGateway.

Now if I have more than 1 sequence to call, it seems HttpGateway is invoked only once.

- Have I got a synchronization problem?

May anyone help me?

Regards

---

<div class="post-metadata">

**Author:** ![Matthew](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Matthew](https://techcommunity.softwareag.com/u/Matthew)\
**Post date:** [February 8, 2006, 11:52am UTC](https://techcommunity.softwareag.com/t/httpgateway-loop/59582/2 "2006-02-08T11:52:54Z")

</div>

Hi Raffaele,

Deterministic in this case is of course the sequence you defined and the document resulting from your transformation.

In general, what you want to do is possible but your while loop will have to utilize an iteration value obtained by counting the appropriate nodes in your document which contains the URLs.

If you believe the logic in your sequence to be 100% correct, then you should look at what is happenning with the HTTP Gateway call.

For instance: Is the current payload, and therefore your list of URLs to call, being replaced by the HTTP Gateway result?

If this is the case, then you will have to apply some of the Multi-part message support we provide in sequence processing and direct the result to a new content ID.

---

<div class="post-metadata">

**Author:** ![Raffaele\_Apisa](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@Raffaele\_Apisa](https://techcommunity.softwareag.com/u/Raffaele_Apisa)\
**Post date:** [February 8, 2006, 5:19pm UTC](https://techcommunity.softwareag.com/t/httpgateway-loop/59582/3 "2006-02-08T17:19:38Z")

</div>

Hi Matthew,

I have just worked out the problem described above.  
The first time I called the HttpGateway inside the while loop, I lost the payload and therefore the next mediator’s urls.

I have stored by a while loop the urls into mediator properties and after invoked them by another while loop.

Here is below my sequence

\<?xml version="1.0" encoding="UTF-8"?\> 

Thanks so much

Raffaele

---

<div class="post-metadata">

**Author:** ![Matthew](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Matthew](https://techcommunity.softwareag.com/u/Matthew)\
**Post date:** [February 9, 2006, 12:34pm UTC](https://techcommunity.softwareag.com/t/httpgateway-loop/59582/4 "2006-02-09T12:34:59Z")

</div>

Hi Raffaele,

After I looked at your sequence… I have some concerns about the performance of your sequence.

Running through 2 loops is of course the main issue but I am also interested in what you are trying to do in the first place.

If I interpret the sequence correctly, you are trying to restart some messages in the persistence store. There are much easier methods to do this.

The most direct way would be to place a copy the query you are placing against Tamino into a loop and changing the accessor type to xml. This causes only one result set at a time to be returned.  
When you have that result, you can use the message ID to call the restart statement to send the returned message object to the original sequence. The very basic logic would look like:

1. Tamino Connection
2. Tamino XQuery (XML Accessor)
3. set messageID to the reurned message ID in the Xquery result document.
4. restart using the messageID
5. While statement - check for existence Tamino itteration property
6. Tamino XQuery (XML Accessor) - using the same query as in the original.
7. set messageID to the reurned message ID in the Xquery result document.
8. restart using the messageID  
9 End While

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:39pm UTC](https://techcommunity.softwareag.com/t/httpgateway-loop/59582/5 "2021-04-02T14:39:55Z")

</div>


