Re: [Dev] Enrich Json with new elements not working for me .Please guide.

2017-07-18 Thread Rajjaz Mohammed
Hi Aditya,

You have to add the response back to body

http://ws.apache.org/ns/synapse; name="eg1" context="/eg1">
   
  
 
 

 
 

   Home


 
 

 
 


 
 
 
  
  
  
   


I have tried this API

*Request*

 {
"id" : "1",
"make" : "NAHB"
}

*Response*

{
   "id": 1,
   "make": "NAHB",
   "name": "Home"
}




On Tue, Jul 18, 2017 at 1:41 PM, Vijitha Ekanayake 
wrote:

> Hi Aditya,
>
> I could try with the following configurations which worked for me.
>
> 
> http://ws.apache.org/ns/synapse;
>  name="EnrichAPI"
>  context="/test">
>
>   
>  
>  expression="fn:concat('name',$ctx:name,
> '/name')"
>type="OM"/>
>   type="OM"/>
>  
> 
> 
>  
>  
> 
> 
>  
>  
>   
>   
>
> 
>
>
> Thanks.
>
> On Tue, Jul 18, 2017 at 12:41 PM, aditya shivankar <
> shivankar.adit...@gmail.com> wrote:
>
>> Hi,
>>
>> Forgot to mention .
>> I cannot use payload factory here because this is just an example I
>> created. and my actual data to be enriched is a huge json response from a
>> backend service.
>>
>> With Regards,
>> Aditya
>>
>>
>>
>>
>> -- Forwarded message --
>> From: aditya shivankar 
>> Date: Tue, Jul 18, 2017 at 12:35 PM
>> Subject: Enrich Json with new elements not working for me .Please guide.
>> To: dev@wso2.org
>>
>>
>> Hi,
>>
>> Enrich Json with new elements not working for me .Please guide.
>>
>> Input request :
>>
>> {
>> "id" : "1",
>> "make" : "NAHB"
>> }
>> I the wso2 flow named eg1.xml . I am trying to enrich the incoming json
>> request with new element "name"
>>
>> processing xml: (eg1.xml)
>>
>> 
>> http://ws.apache.org/ns/synapse;>
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Home
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>
>>
>> current output :
>> {
>> "id" : "1",
>> "make" : "NAHB"
>> }
>>
>> Desired output :
>>
>> {
>> "id" : "1",
>> "make" : "NAHB"
>> "name" : "Home"
>> }
>>
>> logger output :
>>
>> Logger1 output(log level full) :
>> LogMediator To: /eg1/hi, MessageID: 
>> urn:uuid:2f627daf-ac9c-4492-84ea-2736670724e8,
>> Direction: request, Payload:
>> {
>> "id": "1",
>> "make": "NAHB"
>> }
>>
>> Logger2 output :
>> LogMediator msg1 =
>> 
>> 1
>> NAHB
>> 
>>
>> Logger3 output :
>> LogMediator msg2 =
>> 
>> 1
>> NAHB
>> Home
>> 
>>
>> Logger4 output(log level full) :
>> LogMediator To: /eg1/hi, MessageID: 
>> urn:uuid:2f627daf-ac9c-4492-84ea-2736670724e8,
>> Direction: request, Payload:
>> {
>> "id": "1",
>> "make": "NAHB"
>> }
>>
>> Postman output :
>> {
>> "id": "1",
>> "make": "NAHB"
>> }
>>
>> Regards,
>> Aditya
>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Vijitha Ekanayake
> Software Engineer*, *WSO2, Inc.; http://wso2.com/
> Mobile : +94 777 24 73 39 | +94 718 74 44 08
> lean.enterprise.middleware
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Thank you
Best Regards

*Rajjaz HM*
Software Engineer
Platform Extension Team
WSO2 Inc. 
lean | enterprise | middleware
Mobile | +94752833834|+94777226874
Email   | raj...@wso2.com
LinkedIn  | Blogger
 | WSO2 Profile

[image: https://wso2.com/signature] 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Enrich Json with new elements not working for me .Please guide.

2017-07-18 Thread Vijitha Ekanayake
Hi Aditya,

I could try with the following configurations which worked for me.


http://ws.apache.org/ns/synapse;
 name="EnrichAPI"
 context="/test">
   
  
 
 
 
 


 
 


 
 
  
  
   



Thanks.

On Tue, Jul 18, 2017 at 12:41 PM, aditya shivankar <
shivankar.adit...@gmail.com> wrote:

> Hi,
>
> Forgot to mention .
> I cannot use payload factory here because this is just an example I
> created. and my actual data to be enriched is a huge json response from a
> backend service.
>
> With Regards,
> Aditya
>
>
>
>
> -- Forwarded message --
> From: aditya shivankar 
> Date: Tue, Jul 18, 2017 at 12:35 PM
> Subject: Enrich Json with new elements not working for me .Please guide.
> To: dev@wso2.org
>
>
> Hi,
>
> Enrich Json with new elements not working for me .Please guide.
>
> Input request :
>
> {
> "id" : "1",
> "make" : "NAHB"
> }
> I the wso2 flow named eg1.xml . I am trying to enrich the incoming json
> request with new element "name"
>
> processing xml: (eg1.xml)
>
> 
> http://ws.apache.org/ns/synapse;>
> 
> 
> 
> 
> 
> 
> 
> 
> Home
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> current output :
> {
> "id" : "1",
> "make" : "NAHB"
> }
>
> Desired output :
>
> {
> "id" : "1",
> "make" : "NAHB"
> "name" : "Home"
> }
>
> logger output :
>
> Logger1 output(log level full) :
> LogMediator To: /eg1/hi, MessageID: 
> urn:uuid:2f627daf-ac9c-4492-84ea-2736670724e8,
> Direction: request, Payload:
> {
> "id": "1",
> "make": "NAHB"
> }
>
> Logger2 output :
> LogMediator msg1 =
> 
> 1
> NAHB
> 
>
> Logger3 output :
> LogMediator msg2 =
> 
> 1
> NAHB
> Home
> 
>
> Logger4 output(log level full) :
> LogMediator To: /eg1/hi, MessageID: 
> urn:uuid:2f627daf-ac9c-4492-84ea-2736670724e8,
> Direction: request, Payload:
> {
> "id": "1",
> "make": "NAHB"
> }
>
> Postman output :
> {
> "id": "1",
> "make": "NAHB"
> }
>
> Regards,
> Aditya
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Vijitha Ekanayake
Software Engineer*, *WSO2, Inc.; http://wso2.com/
Mobile : +94 777 24 73 39 | +94 718 74 44 08
lean.enterprise.middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Enrich Json with new elements not working for me .Please guide.

2017-07-18 Thread aditya shivankar
Hi,

Forgot to mention .
I cannot use payload factory here because this is just an example I
created. and my actual data to be enriched is a huge json response from a
backend service.

With Regards,
Aditya




-- Forwarded message --
From: aditya shivankar 
Date: Tue, Jul 18, 2017 at 12:35 PM
Subject: Enrich Json with new elements not working for me .Please guide.
To: dev@wso2.org


Hi,

Enrich Json with new elements not working for me .Please guide.

Input request :

{
"id" : "1",
"make" : "NAHB"
}
I the wso2 flow named eg1.xml . I am trying to enrich the incoming json
request with new element "name"

processing xml: (eg1.xml)


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








Home















current output :
{
"id" : "1",
"make" : "NAHB"
}

Desired output :

{
"id" : "1",
"make" : "NAHB"
"name" : "Home"
}

logger output :

Logger1 output(log level full) :
LogMediator To: /eg1/hi, MessageID:
urn:uuid:2f627daf-ac9c-4492-84ea-2736670724e8,
Direction: request, Payload:
{
"id": "1",
"make": "NAHB"
}

Logger2 output :
LogMediator msg1 =

1
NAHB


Logger3 output :
LogMediator msg2 =

1
NAHB
Home


Logger4 output(log level full) :
LogMediator To: /eg1/hi, MessageID:
urn:uuid:2f627daf-ac9c-4492-84ea-2736670724e8,
Direction: request, Payload:
{
"id": "1",
"make": "NAHB"
}

Postman output :
{
"id": "1",
"make": "NAHB"
}

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


[Dev] Enrich Json with new elements not working for me .Please guide.

2017-07-18 Thread aditya shivankar
Hi,

Enrich Json with new elements not working for me .Please guide.

Input request :

{
"id" : "1",
"make" : "NAHB"
}
I the wso2 flow named eg1.xml . I am trying to enrich the incoming json
request with new element "name"

processing xml: (eg1.xml)


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








Home















current output :
{
"id" : "1",
"make" : "NAHB"
}

Desired output :

{
"id" : "1",
"make" : "NAHB"
"name" : "Home"
}

logger output :

Logger1 output(log level full) :
LogMediator To: /eg1/hi, MessageID:
urn:uuid:2f627daf-ac9c-4492-84ea-2736670724e8, Direction: request, Payload:
{
"id": "1",
"make": "NAHB"
}

Logger2 output :
LogMediator msg1 =

1
NAHB


Logger3 output :
LogMediator msg2 =

1
NAHB
Home


Logger4 output(log level full) :
LogMediator To: /eg1/hi, MessageID:
urn:uuid:2f627daf-ac9c-4492-84ea-2736670724e8, Direction: request, Payload:
{
"id": "1",
"make": "NAHB"
}

Postman output :
{
"id": "1",
"make": "NAHB"
}

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