Peter,

OMElement#setText replaces the content of the element with a single
character node containing the specified text. When this is serialized
into an XML document, '<' is replaced by '&lt;' as expected. If the
text contains XML and you want to send it as XML (i.e. not as
character data), then you need to parse the string (using
StAXOMBuilder), extract the relevant part (probably the document
element) and add it to the request.

Andreas

On Wed, Nov 11, 2009 at 22:06, Selvaraj, Peter (eBusiness)
<peter.selva...@thehartford.com> wrote:
>
> Andreas,
>
> Attached the webservice client java file and policy.xml
>
>
> Thanks & Regards,
>
> Peter R Selvaraj
>
> -----Original Message-----
> From: Andreas Veithen [mailto:andreas.veit...@gmail.com]
> Sent: Wednesday, November 11, 2009 3:57 PM
> To: axis-user@ws.apache.org
> Subject: Re: < character converted to &lt; in request XML
>
> Can you post a code snippet showing what you are doing?
>
> Andreas
>
> On Wed, Nov 11, 2009 at 21:46, Selvaraj, Peter (eBusiness) 
> <peter.selva...@thehartford.com> wrote:
>> I'm using axiom OMElement to build the request, below solution didn't
>> resolve this issue.
>>
>> Any idea?
>>
>>
>> Thanks & Regards,
>>
>> Peter R Selvaraj
>>
>> ________________________________
>> From: jose.ferre...@gmail.com [mailto:jose.ferre...@gmail.com] On
>> Behalf Of José Ferreiro
>> Sent: Wednesday, November 11, 2009 3:31 PM
>> To: axis-user@ws.apache.org
>> Subject: Re: < character converted to &lt; in request XML
>>
>> This is a work around I found.
>> It is a but into wss4j.
>>
>> This problem does not happend if you do not use encryption or other.
>>
>>
>> See methods below on:
>>
>> http://commons.apache.org/lang/api/org/apache/commons/lang/StringEscap
>> eUtils.html
>>
>> you should escape sent response by server
>> org.apache.commons.lang.StringEscapeUtils.escapeXml
>>
>>
>> and then on the client you should unscape received response
>> org.apache.commons.lang.StringEscapeUtils.unescapeXml
>>
>>
>> Hope this helps.
>>
>>
>> On Wed, Nov 11, 2009 at 8:38 PM, Selvaraj, Peter (eBusiness)
>> <peter.selva...@thehartford.com> wrote:
>>>
>>> Hi,
>>>
>>> Could you please let me know how did you solve this using apache
>>> common utilities? Any sample code you have?
>>>
>>>
>>> Thanks & Regards,
>>>
>>> Peter R Selvaraj
>>>
>>> ________________________________
>>> From: jose.ferre...@gmail.com [mailto:jose.ferre...@gmail.com] On
>>> Behalf Of José Ferreiro
>>> Sent: Wednesday, November 11, 2009 2:36 PM
>>> To: axis-user@ws.apache.org
>>> Subject: Re: < character converted to &lt; in request XML
>>>
>>> Is this <  the payload?
>>> I had simular issue when using WSS4J, which if I am not wrong is
>>> within Rampart.
>>>
>>> I solved the solution by escaping the < using appche commons
>>> utilities if I am not wrong.
>>> Both at client and server side.
>>>
>>> Hope this helps.
>>>
>>> On Wed, Nov 11, 2009 at 8:19 PM, Selvaraj, Peter (eBusiness)
>>> <peter.selva...@thehartford.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I'm using Axis2 1.4 and Rampart 1.4 java client which creates the
>>>> request xml and invokes the webservice.
>>>>
>>>> In the request xml, I can see the < character is converted to &lt;
>>>>
>>>> Because of this I get ErrorResponse from the webservice.
>>>>
>>>> Any idea how to avoid this character conversion.
>>>>
>>>> Thanks & Regards,
>>>>
>>>> Peter R Selvaraj
>>>>
>>>> ************************************************************
>>>> This communication, including attachments, is for the exclusive use
>>>> of addressee and may contain proprietary, confidential and/or
>>>> privileged information.  If you are not the intended recipient, any
>>>> use, copying, disclosure, dissemination or distribution is strictly
>>>> prohibited.  If you are not the intended recipient, please notify
>>>> the sender immediately by return e-mail, delete this communication and 
>>>> destroy all copies.
>>>> ************************************************************
>>>
>>>
>>>
>>> --
>>> José Ferreiro
>>> Systems Analysis and Design Specialist MSc in Communication Systems,
>>> EPFL.
>>>
>>> "Think little goals and expect little achievements. Think big goals
>>> and win big success."  David Joseph Schwartz
>>>
>>> ************************************************************
>>> This communication, including attachments, is for the exclusive use
>>> of addressee and may contain proprietary, confidential and/or
>>> privileged information.  If you are not the intended recipient, any
>>> use, copying, disclosure, dissemination or distribution is strictly
>>> prohibited.  If you are not the intended recipient, please notify the
>>> sender immediately by return e-mail, delete this communication and destroy 
>>> all copies.
>>> ************************************************************
>>
>>
>>
>> --
>> José Ferreiro
>> Systems Analysis and Design Specialist MSc in Communication Systems,
>> EPFL.
>>
>> "Think little goals and expect little achievements. Think big goals
>> and win big success."  David Joseph Schwartz
>>
>> ************************************************************
>> This communication, including attachments, is for the exclusive use of
>> addressee and may contain proprietary, confidential and/or privileged
>> information.  If you are not the intended recipient, any use, copying,
>> disclosure, dissemination or distribution is strictly prohibited.  If
>> you are not the intended recipient, please notify the sender
>> immediately by return e-mail, delete this communication and destroy all 
>> copies.
>> ************************************************************
>>
> ************************************************************
> This communication, including attachments, is for the exclusive use of 
> addressee and may contain proprietary, confidential and/or privileged 
> information.  If you are not the intended recipient, any use, copying, 
> disclosure, dissemination or distribution is strictly prohibited.  If you are 
> not the intended recipient, please notify the sender immediately by return 
> e-mail, delete this communication and destroy all copies.
> ************************************************************
>

Reply via email to