Re: [Dev] Foreach is not working properly under AggregateMediator's scope in response flow

2017-07-13 Thread Sudharma Subasinghe
Hi Aditya,

I have tested your configs and could observe the same behavior. Foreach
mediator is working properly.
This behavior is happening due to the Log mediator and it is fixed in [1].

[1] https://wso2.org/jira/browse/ESBJAVA-5202

Thanks
Sudharma

On Wed, Jul 12, 2017 at 2:04 PM, Vinod Kavinda  wrote:

> Hi Aditya,
> Please use Iterate mediator with the Aggregate mediator. Please refer [1],
> it explains the difference between the forEach and Iterate mediators.
>
> [1] - https://docs.wso2.com/display/ESB490/ForEach+Mediator
>
> Thanks,
> Vinod
>
> On Wed, Jul 12, 2017 at 1:34 PM, Sudharma Subasinghe 
> wrote:
>
>> Hi,
>>
>> Foreach mediator is working properly, above issue can be occurred when
>> log mediator is invoking.
>>
>> On Tue, Jul 11, 2017 at 2:48 PM, aditya shivankar <
>> shivankar.adit...@gmail.com> wrote:
>>
>>> Foreach is not working properly under AggregateMediator's scope in
>>> response flow
>>>
>>> Input request :
>>>
>>> [
>>> {
>>> "name" : "Home"
>>> },
>>> {
>>> "name" : "Car"
>>> },
>>> {
>>> "name" : "Mobile"
>>> }
>>> ]
>>>
>>>
>>> I am using iterate, to send each element of above array as request to a
>>> passthrough service( In myactual project this is not pass through. for
>>> better understanding of issue I kept it like this ).
>>>
>>> The responses of the pass through service are aggregated in one soap xml
>>> by AggregateMediator.
>>>
>>>
>>> Below is response from AggregateMediator
>>>
>>> 
>>> http://schemas.
>>> xmlsoap.org/soap/envelope/">
>>> 
>>> 
>>> 
>>> Mobile
>>> 
>>> 
>>> Car
>>> 
>>> 
>>> Home
>>> 
>>> 
>>> 
>>> 
>>>
>>>
>>> Using foreach to modify each response depending on some parameters
>>> coming in response.
>>> But Foreach is not working properly under Aggregator scope in response
>>> flow . Its response is weird.
>>> 
>>> -
>>> For-each response :
>>>
>>> [2017-07-11 14:07:44,696]  INFO - LogMediator msg4 = "Inside Foreach"
>>> [2017-07-11 14:07:44,697]  INFO - LogMediator To:
>>> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction:
>>> , MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
>>> response, Envelope: 
>>> http://schemas.
>>> xmlsoap.org/soap/envelope/">
>>> 
>>> 
>>> Home
>>> 
>>> 
>>> 
>>>
>>> [2017-07-11 14:07:44,697]  INFO - LogMediator msg4 = "Inside Foreach"
>>> [2017-07-11 14:07:44,697]  INFO - LogMediator To:
>>> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction:
>>> , MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
>>> response, Payload: {"name":"Home"}
>>>
>>> [2017-07-11 14:07:44,697]  INFO - LogMediator msg4 = "Inside Foreach"
>>> [2017-07-11 14:07:44,698]  INFO - LogMediator To:
>>> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction:
>>> , MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
>>> response, Payload: {"name":"Home"}
>>>
>>> 
>>> 
>>> The second and third iterate of foreach should have been like below :
>>>
>>> http://schemas.
>>> xmlsoap.org/soap/envelope/">
>>> 
>>> 
>>> Mobile
>>> 
>>> 
>>> 
>>>
>>> http://schemas.
>>> xmlsoap.org/soap/envelope/">
>>> 
>>> 
>>> Car
>>> 
>>> 
>>> 
>>>
>>> Instead of :
>>>
>>>  Payload: {"name":"Home"}
>>>  Payload: {"name":"Home"}
>>>
>>>  Please find attached flow xml's.
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Sudharma Subasinghe,
>> Software Engineer,
>> WSO2 Inc.
>> Email: sudhar...@wso2.com 
>> Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Vinod Kavinda
> Senior Software Engineer
> *WSO2 Inc. - lean . enterprise . middleware .*
> Mobile : +94 (0) 712 415544
> Blog : http://soatechflicks.blogspot.com/
> [image: http://wso2.com/signature]
> 
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com 
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Foreach is not working properly under AggregateMediator's scope in response flow

2017-07-12 Thread Vinod Kavinda
Hi Aditya,
Please use Iterate mediator with the Aggregate mediator. Please refer [1],
it explains the difference between the forEach and Iterate mediators.

[1] - https://docs.wso2.com/display/ESB490/ForEach+Mediator

Thanks,
Vinod

On Wed, Jul 12, 2017 at 1:34 PM, Sudharma Subasinghe 
wrote:

> Hi,
>
> Foreach mediator is working properly, above issue can be occurred when log
> mediator is invoking.
>
> On Tue, Jul 11, 2017 at 2:48 PM, aditya shivankar <
> shivankar.adit...@gmail.com> wrote:
>
>> Foreach is not working properly under AggregateMediator's scope in
>> response flow
>>
>> Input request :
>>
>> [
>> {
>> "name" : "Home"
>> },
>> {
>> "name" : "Car"
>> },
>> {
>> "name" : "Mobile"
>> }
>> ]
>>
>>
>> I am using iterate, to send each element of above array as request to a
>> passthrough service( In myactual project this is not pass through. for
>> better understanding of issue I kept it like this ).
>>
>> The responses of the pass through service are aggregated in one soap xml
>> by AggregateMediator.
>>
>>
>> Below is response from AggregateMediator
>>
>> 
>> http://schemas.
>> xmlsoap.org/soap/envelope/">
>> 
>> 
>> 
>> Mobile
>> 
>> 
>> Car
>> 
>> 
>> Home
>> 
>> 
>> 
>> 
>>
>>
>> Using foreach to modify each response depending on some parameters coming
>> in response.
>> But Foreach is not working properly under Aggregator scope in response
>> flow . Its response is weird.
>> -
>> For-each response :
>>
>> [2017-07-11 14:07:44,696]  INFO - LogMediator msg4 = "Inside Foreach"
>> [2017-07-11 14:07:44,697]  INFO - LogMediator To:
>> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction:
>> , MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
>> response, Envelope: 
>> http://schemas.
>> xmlsoap.org/soap/envelope/">
>> 
>> 
>> Home
>> 
>> 
>> 
>>
>> [2017-07-11 14:07:44,697]  INFO - LogMediator msg4 = "Inside Foreach"
>> [2017-07-11 14:07:44,697]  INFO - LogMediator To:
>> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction:
>> , MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
>> response, Payload: {"name":"Home"}
>>
>> [2017-07-11 14:07:44,697]  INFO - LogMediator msg4 = "Inside Foreach"
>> [2017-07-11 14:07:44,698]  INFO - LogMediator To:
>> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction:
>> , MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
>> response, Payload: {"name":"Home"}
>>
>> 
>> 
>> The second and third iterate of foreach should have been like below :
>>
>> http://schemas.
>> xmlsoap.org/soap/envelope/">
>> 
>> 
>> Mobile
>> 
>> 
>> 
>>
>> http://schemas.
>> xmlsoap.org/soap/envelope/">
>> 
>> 
>> Car
>> 
>> 
>> 
>>
>> Instead of :
>>
>>  Payload: {"name":"Home"}
>>  Payload: {"name":"Home"}
>>
>>  Please find attached flow xml's.
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Sudharma Subasinghe,
> Software Engineer,
> WSO2 Inc.
> Email: sudhar...@wso2.com 
> Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Vinod Kavinda
Senior Software Engineer
*WSO2 Inc. - lean . enterprise . middleware .*
Mobile : +94 (0) 712 415544
Blog : http://soatechflicks.blogspot.com/
[image: http://wso2.com/signature]

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Foreach is not working properly under AggregateMediator's scope in response flow

2017-07-12 Thread Sudharma Subasinghe
Hi,

Foreach mediator is working properly, above issue can be occurred when log
mediator is invoking.

On Tue, Jul 11, 2017 at 2:48 PM, aditya shivankar <
shivankar.adit...@gmail.com> wrote:

> Foreach is not working properly under AggregateMediator's scope in
> response flow
>
> Input request :
>
> [
> {
> "name" : "Home"
> },
> {
> "name" : "Car"
> },
> {
> "name" : "Mobile"
> }
> ]
>
>
> I am using iterate, to send each element of above array as request to a
> passthrough service( In myactual project this is not pass through. for
> better understanding of issue I kept it like this ).
>
> The responses of the pass through service are aggregated in one soap xml
> by AggregateMediator.
>
>
> Below is response from AggregateMediator
>
> 
> http://schemas.xmlsoap.org/soap/envelope/
> ">
> 
> 
> 
> Mobile
> 
> 
> Car
> 
> 
> Home
> 
> 
> 
> 
>
>
> Using foreach to modify each response depending on some parameters coming
> in response.
> But Foreach is not working properly under Aggregator scope in response
> flow . Its response is weird.
> -
> For-each response :
>
> [2017-07-11 14:07:44,696]  INFO - LogMediator msg4 = "Inside Foreach"
> [2017-07-11 14:07:44,697]  INFO - LogMediator To:
> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: ,
> MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
> response, Envelope: 
> http://schemas.xmlsoap.org/soap/envelope/
> ">
> 
> 
> Home
> 
> 
> 
>
> [2017-07-11 14:07:44,697]  INFO - LogMediator msg4 = "Inside Foreach"
> [2017-07-11 14:07:44,697]  INFO - LogMediator To:
> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: ,
> MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
> response, Payload: {"name":"Home"}
>
> [2017-07-11 14:07:44,697]  INFO - LogMediator msg4 = "Inside Foreach"
> [2017-07-11 14:07:44,698]  INFO - LogMediator To:
> http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: ,
> MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
> response, Payload: {"name":"Home"}
>
> 
> 
> The second and third iterate of foreach should have been like below :
>
> http://schemas.xmlsoap.org/soap/envelope/
> ">
> 
> 
> Mobile
> 
> 
> 
>
> http://schemas.xmlsoap.org/soap/envelope/
> ">
> 
> 
> Car
> 
> 
> 
>
> Instead of :
>
>  Payload: {"name":"Home"}
>  Payload: {"name":"Home"}
>
>  Please find attached flow xml's.
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sudharma Subasinghe,
Software Engineer,
WSO2 Inc.
Email: sudhar...@wso2.com 
Mobile : +94 710 565 157 <%2B94%20718%20210%20200>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Foreach is not working properly under AggregateMediator's scope in response flow

2017-07-11 Thread aditya shivankar
Foreach is not working properly under AggregateMediator's scope in response
flow

Input request :

[
{
"name" : "Home"
},
{
"name" : "Car"
},
{
"name" : "Mobile"
}
]


I am using iterate, to send each element of above array as request to a
passthrough service( In myactual project this is not pass through. for
better understanding of issue I kept it like this ).

The responses of the pass through service are aggregated in one soap xml by
AggregateMediator.


Below is response from AggregateMediator


http://schemas.xmlsoap.org/soap/envelope/";>



Mobile


Car


Home






Using foreach to modify each response depending on some parameters coming
in response.
But Foreach is not working properly under Aggregator scope in response flow
. Its response is weird.
-
For-each response :

[2017-07-11 14:07:44,696]  INFO - LogMediator msg4 = "Inside Foreach"
[2017-07-11 14:07:44,697]  INFO - LogMediator To:
http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: ,
MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
response, Envelope: 
http://schemas.xmlsoap.org/soap/envelope/";>


Home




[2017-07-11 14:07:44,697]  INFO - LogMediator msg4 = "Inside Foreach"
[2017-07-11 14:07:44,697]  INFO - LogMediator To:
http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: ,
MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
response, Payload: {"name":"Home"}

[2017-07-11 14:07:44,697]  INFO - LogMediator msg4 = "Inside Foreach"
[2017-07-11 14:07:44,698]  INFO - LogMediator To:
http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: ,
MessageID: urn:uuid:3e1fd827-12ab-413c-824d-c9daf7b6df7c, Direction:
response, Payload: {"name":"Home"}


The second and third iterate of foreach should have been like below :

http://schemas.xmlsoap.org/soap/envelope/";>


Mobile




http://schemas.xmlsoap.org/soap/envelope/";>


Car




Instead of :

 Payload: {"name":"Home"}
 Payload: {"name":"Home"}

 Please find attached flow xml's.

http://ws.apache.org/ns/synapse";>

















http://ws.apache.org/ns/synapse";>














































___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev