Re: [Dev] Error while adding value to XML element added using enrich mediator

2014-12-03 Thread Malintha Adikari
Hi Jerad,

Thank you for the answer.



On Wed, Dec 3, 2014 at 9:32 AM, Jerad Rutnam  wrote:

> Hi Malintha,
>
> I'm not sure if this will help, did you try adding a type to target tag.
>
> 
>  property="message1">
> http://ws.apache.org/ns/synapse";>
>

we can explicitly add namespace as above. If we don't assign any , the
default namespace will be added.  AFAIK, no need to add the default ns
explicitly.


>
> Regards,
>
> On Mon, Dec 1, 2014 at 7:52 PM, Malintha Adikari 
> wrote:
>
>> Hi Senduran,
>>
>> I tried it but the issue is still there ( Using esb 4.8.1). Will check
>> more with your sample. Thank you very much
>>
>> On Mon, Dec 1, 2014 at 2:03 PM, Senduran Balasubramaniyam <
>> sendu...@wso2.com> wrote:
>>
>>> Hi Malintha,
>>>
>>> can you try the following and let me know (btw  I tried with ESB 4.8.1)
>>>
>>> 
>>> temval
>>> 
>>>
>>> >> type="STRING">
>>>
>>> 
>>> >> property="deliverystatus">
>>> 
>>> 
>>>
>>>
>>> 
>>> 
>>> >> xpath="//deliverystatus/text()">
>>> 
>>>
>>> Thanks
>>> Senduran
>>>
>>> On Mon, Dec 1, 2014 at 6:49 PM, Malintha Adikari 
>>> wrote:
>>>
 Hi Senduran,

 Thank you for the prompt response.


 On Mon, Dec 1, 2014 at 1:06 PM, Senduran Balasubramaniyam <
 sendu...@wso2.com> wrote:

> Hi Malintha,
>
> You can get rid of the default namespace by adding an empty namespace
> i.e
> 
> 
> 
>

 I have already tried adding xmlns="" to remove added namespace. But it
 did not fix the issue for me.

>
> also I am not quite sure about the 2nd enrich mediator's target. Since
> if you are adding something like "//deliverystatus" then the xpath will 
> try
> to find a "deliverystatus" node in the body.
>

 First I add this element to request body. Then I try to add value into
 that element. I used  log mediator and printed the payload after adding the
  element and the payload contains that element. But I
 cannot access that element using //deliveryStatus xpath.

 I tried to access same DOM level elements and I could access them.
 Problem is cannot access the newly added element though it exists.


> If your request doesn't have a deliverystatus node this error may
> occur
>
> Thanks
> Senduran
>
>
> On Mon, Dec 1, 2014 at 5:59 PM, Malintha Adikari 
> wrote:
>
>> Hi,
>>
>> I want to add following XML element as a child to the payload body
>>
>> abc123
>>
>> This "abc123" value is taken from a property.
>>
>> I used enrich mediator to add the element as follows
>>
>> 
>> 
>>  
>>
>>  
>> > property="deliverystatus">
>> 
>>  
>>
>> and it sets the element as expected to the body (with default
>> namespace)
>>
>> (http://ws.apache.org/ns/synapse
>> ">)
>>
>> Then I tired to set value in to this element (taking from another
>> property)
>>
>>  
>> > property="message1">
>> http://ws.apache.org/ns/synapse";>
>>   
>>
>> and it gives me following error
>>
>>  *ERROR - EnrichMediator Invalid Target object to be enrich.*
>>
>> But I could add values to elements which were already there in the
>> payload body (value can't be added only to the newly added one). What 
>> could
>> be the reason for this issue? Is there any other way to do this task ?
>>
>> Regards,
>> Malintha Adikari
>> --
>> *Malintha Adikari*
>>  Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> Mobile: +94 71 2312958
>> Blog:http://malinthas.blogspot.com
>> Page:   http://about.me/malintha
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Senduran *
> Software Engineer,
> WSO2, Inc.;  http://wso2.com/ 
> Mobile: +94 77 952 6548
>



 --
 *Malintha Adikari*
  Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 Mobile: +94 71 2312958
 Blog:http://malinthas.blogspot.com
 Page:   http://about.me/malintha

>>>
>>>
>>>
>>> --
>>> *Senduran *
>>> Software Engineer,
>>> WSO2, Inc.;  http://wso2.com/ 
>>> Mobile: +94 77 952 6548
>>>
>>
>>
>>
>> --
>> *Malintha Adikari*
>>  Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> Mobile: +94 71 2312958
>> Blog:http://malinthas.blogspot.com
>> Page:   http://about.me/malintha
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>

Re: [Dev] Error while adding value to XML element added using enrich mediator

2014-12-03 Thread Jerad Rutnam
Hi Malintha,

I'm not sure if this will help, did you try adding a type to target tag.



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


Regards,

On Mon, Dec 1, 2014 at 7:52 PM, Malintha Adikari  wrote:

> Hi Senduran,
>
> I tried it but the issue is still there ( Using esb 4.8.1). Will check
> more with your sample. Thank you very much
>
> On Mon, Dec 1, 2014 at 2:03 PM, Senduran Balasubramaniyam <
> sendu...@wso2.com> wrote:
>
>> Hi Malintha,
>>
>> can you try the following and let me know (btw  I tried with ESB 4.8.1)
>>
>> 
>> temval
>> 
>>
>> > type="STRING">
>>
>> 
>> > property="deliverystatus">
>> 
>> 
>>
>>
>> 
>> 
>> > xpath="//deliverystatus/text()">
>> 
>>
>> Thanks
>> Senduran
>>
>> On Mon, Dec 1, 2014 at 6:49 PM, Malintha Adikari 
>> wrote:
>>
>>> Hi Senduran,
>>>
>>> Thank you for the prompt response.
>>>
>>>
>>> On Mon, Dec 1, 2014 at 1:06 PM, Senduran Balasubramaniyam <
>>> sendu...@wso2.com> wrote:
>>>
 Hi Malintha,

 You can get rid of the default namespace by adding an empty namespace
 i.e
 
 
 

>>>
>>> I have already tried adding xmlns="" to remove added namespace. But it
>>> did not fix the issue for me.
>>>

 also I am not quite sure about the 2nd enrich mediator's target. Since
 if you are adding something like "//deliverystatus" then the xpath will try
 to find a "deliverystatus" node in the body.

>>>
>>> First I add this element to request body. Then I try to add value into
>>> that element. I used  log mediator and printed the payload after adding the
>>>  element and the payload contains that element. But I
>>> cannot access that element using //deliveryStatus xpath.
>>>
>>> I tried to access same DOM level elements and I could access them.
>>> Problem is cannot access the newly added element though it exists.
>>>
>>>
 If your request doesn't have a deliverystatus node this error may occur

 Thanks
 Senduran


 On Mon, Dec 1, 2014 at 5:59 PM, Malintha Adikari 
 wrote:

> Hi,
>
> I want to add following XML element as a child to the payload body
>
> abc123
>
> This "abc123" value is taken from a property.
>
> I used enrich mediator to add the element as follows
>
> 
> 
>  
>
>  
>  property="deliverystatus">
> 
>  
>
> and it sets the element as expected to the body (with default
> namespace)
>
> (http://ws.apache.org/ns/synapse
> ">)
>
> Then I tired to set value in to this element (taking from another
> property)
>
>  
>  property="message1">
> http://ws.apache.org/ns/synapse";>
>   
>
> and it gives me following error
>
>  *ERROR - EnrichMediator Invalid Target object to be enrich.*
>
> But I could add values to elements which were already there in the
> payload body (value can't be added only to the newly added one). What 
> could
> be the reason for this issue? Is there any other way to do this task ?
>
> Regards,
> Malintha Adikari
> --
> *Malintha Adikari*
>  Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> Mobile: +94 71 2312958
> Blog:http://malinthas.blogspot.com
> Page:   http://about.me/malintha
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --
 *Senduran *
 Software Engineer,
 WSO2, Inc.;  http://wso2.com/ 
 Mobile: +94 77 952 6548

>>>
>>>
>>>
>>> --
>>> *Malintha Adikari*
>>>  Software Engineer
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> Mobile: +94 71 2312958
>>> Blog:http://malinthas.blogspot.com
>>> Page:   http://about.me/malintha
>>>
>>
>>
>>
>> --
>> *Senduran *
>> Software Engineer,
>> WSO2, Inc.;  http://wso2.com/ 
>> Mobile: +94 77 952 6548
>>
>
>
>
> --
> *Malintha Adikari*
>  Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> Mobile: +94 71 2312958
> Blog:http://malinthas.blogspot.com
> Page:   http://about.me/malintha
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Jerad Rutnam | **Software Engineer - UI*
WSO2, Inc. www.wso2.com

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


Re: [Dev] Error while adding value to XML element added using enrich mediator

2014-12-01 Thread Malintha Adikari
Hi Senduran,

I tried it but the issue is still there ( Using esb 4.8.1). Will check more
with your sample. Thank you very much

On Mon, Dec 1, 2014 at 2:03 PM, Senduran Balasubramaniyam  wrote:

> Hi Malintha,
>
> can you try the following and let me know (btw  I tried with ESB 4.8.1)
>
> 
> temval
> 
>
>  type="STRING">
>
> 
>  property="deliverystatus">
> 
> 
>
>
> 
> 
>  xpath="//deliverystatus/text()">
> 
>
> Thanks
> Senduran
>
> On Mon, Dec 1, 2014 at 6:49 PM, Malintha Adikari 
> wrote:
>
>> Hi Senduran,
>>
>> Thank you for the prompt response.
>>
>>
>> On Mon, Dec 1, 2014 at 1:06 PM, Senduran Balasubramaniyam <
>> sendu...@wso2.com> wrote:
>>
>>> Hi Malintha,
>>>
>>> You can get rid of the default namespace by adding an empty namespace
>>> i.e
>>> 
>>> 
>>> 
>>>
>>
>> I have already tried adding xmlns="" to remove added namespace. But it
>> did not fix the issue for me.
>>
>>>
>>> also I am not quite sure about the 2nd enrich mediator's target. Since
>>> if you are adding something like "//deliverystatus" then the xpath will try
>>> to find a "deliverystatus" node in the body.
>>>
>>
>> First I add this element to request body. Then I try to add value into
>> that element. I used  log mediator and printed the payload after adding the
>>  element and the payload contains that element. But I
>> cannot access that element using //deliveryStatus xpath.
>>
>> I tried to access same DOM level elements and I could access them.
>> Problem is cannot access the newly added element though it exists.
>>
>>
>>> If your request doesn't have a deliverystatus node this error may occur
>>>
>>> Thanks
>>> Senduran
>>>
>>>
>>> On Mon, Dec 1, 2014 at 5:59 PM, Malintha Adikari 
>>> wrote:
>>>
 Hi,

 I want to add following XML element as a child to the payload body

 abc123

 This "abc123" value is taken from a property.

 I used enrich mediator to add the element as follows

 
 
  

  
 >>> property="deliverystatus">
 
  

 and it sets the element as expected to the body (with default namespace)

 (http://ws.apache.org/ns/synapse
 ">)

 Then I tired to set value in to this element (taking from another
 property)

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

 and it gives me following error

  *ERROR - EnrichMediator Invalid Target object to be enrich.*

 But I could add values to elements which were already there in the
 payload body (value can't be added only to the newly added one). What could
 be the reason for this issue? Is there any other way to do this task ?

 Regards,
 Malintha Adikari
 --
 *Malintha Adikari*
  Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 Mobile: +94 71 2312958
 Blog:http://malinthas.blogspot.com
 Page:   http://about.me/malintha

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


>>>
>>>
>>> --
>>> *Senduran *
>>> Software Engineer,
>>> WSO2, Inc.;  http://wso2.com/ 
>>> Mobile: +94 77 952 6548
>>>
>>
>>
>>
>> --
>> *Malintha Adikari*
>>  Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> Mobile: +94 71 2312958
>> Blog:http://malinthas.blogspot.com
>> Page:   http://about.me/malintha
>>
>
>
>
> --
> *Senduran *
> Software Engineer,
> WSO2, Inc.;  http://wso2.com/ 
> Mobile: +94 77 952 6548
>



-- 
*Malintha Adikari*
 Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

Mobile: +94 71 2312958
Blog:http://malinthas.blogspot.com
Page:   http://about.me/malintha
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Error while adding value to XML element added using enrich mediator

2014-12-01 Thread Senduran Balasubramaniyam
Hi Malintha,

can you try the following and let me know (btw  I tried with ESB 4.8.1)


temval















Thanks
Senduran

On Mon, Dec 1, 2014 at 6:49 PM, Malintha Adikari  wrote:

> Hi Senduran,
>
> Thank you for the prompt response.
>
>
> On Mon, Dec 1, 2014 at 1:06 PM, Senduran Balasubramaniyam <
> sendu...@wso2.com> wrote:
>
>> Hi Malintha,
>>
>> You can get rid of the default namespace by adding an empty namespace
>> i.e
>> 
>> 
>> 
>>
>
> I have already tried adding xmlns="" to remove added namespace. But it did
> not fix the issue for me.
>
>>
>> also I am not quite sure about the 2nd enrich mediator's target. Since if
>> you are adding something like "//deliverystatus" then the xpath will try to
>> find a "deliverystatus" node in the body.
>>
>
> First I add this element to request body. Then I try to add value into
> that element. I used  log mediator and printed the payload after adding the
>  element and the payload contains that element. But I
> cannot access that element using //deliveryStatus xpath.
>
> I tried to access same DOM level elements and I could access them. Problem
> is cannot access the newly added element though it exists.
>
>
>> If your request doesn't have a deliverystatus node this error may occur
>>
>> Thanks
>> Senduran
>>
>>
>> On Mon, Dec 1, 2014 at 5:59 PM, Malintha Adikari 
>> wrote:
>>
>>> Hi,
>>>
>>> I want to add following XML element as a child to the payload body
>>>
>>> abc123
>>>
>>> This "abc123" value is taken from a property.
>>>
>>> I used enrich mediator to add the element as follows
>>>
>>> 
>>> 
>>>  
>>>
>>>  
>>> >> property="deliverystatus">
>>> 
>>>  
>>>
>>> and it sets the element as expected to the body (with default namespace)
>>>
>>> (http://ws.apache.org/ns/synapse
>>> ">)
>>>
>>> Then I tired to set value in to this element (taking from another
>>> property)
>>>
>>>  
>>> >> property="message1">
>>> http://ws.apache.org/ns/synapse";>
>>>   
>>>
>>> and it gives me following error
>>>
>>>  *ERROR - EnrichMediator Invalid Target object to be enrich.*
>>>
>>> But I could add values to elements which were already there in the
>>> payload body (value can't be added only to the newly added one). What could
>>> be the reason for this issue? Is there any other way to do this task ?
>>>
>>> Regards,
>>> Malintha Adikari
>>> --
>>> *Malintha Adikari*
>>>  Software Engineer
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> Mobile: +94 71 2312958
>>> Blog:http://malinthas.blogspot.com
>>> Page:   http://about.me/malintha
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Senduran *
>> Software Engineer,
>> WSO2, Inc.;  http://wso2.com/ 
>> Mobile: +94 77 952 6548
>>
>
>
>
> --
> *Malintha Adikari*
>  Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> Mobile: +94 71 2312958
> Blog:http://malinthas.blogspot.com
> Page:   http://about.me/malintha
>



-- 
*Senduran *
Software Engineer,
WSO2, Inc.;  http://wso2.com/ 
Mobile: +94 77 952 6548
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Error while adding value to XML element added using enrich mediator

2014-12-01 Thread Malintha Adikari
Hi Senduran,

Thank you for the prompt response.


On Mon, Dec 1, 2014 at 1:06 PM, Senduran Balasubramaniyam  wrote:

> Hi Malintha,
>
> You can get rid of the default namespace by adding an empty namespace
> i.e
> 
> 
> 
>

I have already tried adding xmlns="" to remove added namespace. But it did
not fix the issue for me.

>
> also I am not quite sure about the 2nd enrich mediator's target. Since if
> you are adding something like "//deliverystatus" then the xpath will try to
> find a "deliverystatus" node in the body.
>

First I add this element to request body. Then I try to add value into that
element. I used  log mediator and printed the payload after adding the
 element and the payload contains that element. But I
cannot access that element using //deliveryStatus xpath.

I tried to access same DOM level elements and I could access them. Problem
is cannot access the newly added element though it exists.


> If your request doesn't have a deliverystatus node this error may occur
>
> Thanks
> Senduran
>
>
> On Mon, Dec 1, 2014 at 5:59 PM, Malintha Adikari 
> wrote:
>
>> Hi,
>>
>> I want to add following XML element as a child to the payload body
>>
>> abc123
>>
>> This "abc123" value is taken from a property.
>>
>> I used enrich mediator to add the element as follows
>>
>> 
>> 
>>  
>>
>>  
>> > property="deliverystatus">
>> 
>>  
>>
>> and it sets the element as expected to the body (with default namespace)
>>
>> (http://ws.apache.org/ns/synapse
>> ">)
>>
>> Then I tired to set value in to this element (taking from another
>> property)
>>
>>  
>> > property="message1">
>> http://ws.apache.org/ns/synapse";>
>>   
>>
>> and it gives me following error
>>
>>  *ERROR - EnrichMediator Invalid Target object to be enrich.*
>>
>> But I could add values to elements which were already there in the
>> payload body (value can't be added only to the newly added one). What could
>> be the reason for this issue? Is there any other way to do this task ?
>>
>> Regards,
>> Malintha Adikari
>> --
>> *Malintha Adikari*
>>  Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> Mobile: +94 71 2312958
>> Blog:http://malinthas.blogspot.com
>> Page:   http://about.me/malintha
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Senduran *
> Software Engineer,
> WSO2, Inc.;  http://wso2.com/ 
> Mobile: +94 77 952 6548
>



-- 
*Malintha Adikari*
 Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

Mobile: +94 71 2312958
Blog:http://malinthas.blogspot.com
Page:   http://about.me/malintha
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Error while adding value to XML element added using enrich mediator

2014-12-01 Thread Senduran Balasubramaniyam
Hi Malintha,

You can get rid of the default namespace by adding an empty namespace
i.e




also I am not quite sure about the 2nd enrich mediator's target. Since if
you are adding something like "//deliverystatus" then the xpath will try to
find a "deliverystatus" node in the body. If your request doesn't have a
deliverystatus node this error may occur

Thanks
Senduran


On Mon, Dec 1, 2014 at 5:59 PM, Malintha Adikari  wrote:

> Hi,
>
> I want to add following XML element as a child to the payload body
>
> abc123
>
> This "abc123" value is taken from a property.
>
> I used enrich mediator to add the element as follows
>
> 
> 
>  
>
>  
>  property="deliverystatus">
> 
>  
>
> and it sets the element as expected to the body (with default namespace)
>
> (http://ws.apache.org/ns/synapse
> ">)
>
> Then I tired to set value in to this element (taking from another property)
>
>  
>  property="message1">
> http://ws.apache.org/ns/synapse";>
>   
>
> and it gives me following error
>
>  *ERROR - EnrichMediator Invalid Target object to be enrich.*
>
> But I could add values to elements which were already there in the payload
> body (value can't be added only to the newly added one). What could be the
> reason for this issue? Is there any other way to do this task ?
>
> Regards,
> Malintha Adikari
> --
> *Malintha Adikari*
>  Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> Mobile: +94 71 2312958
> Blog:http://malinthas.blogspot.com
> Page:   http://about.me/malintha
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Senduran *
Software Engineer,
WSO2, Inc.;  http://wso2.com/ 
Mobile: +94 77 952 6548
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev