Hello everybody.

I hope some have found this problem before and can help me.

I'm having an issue when sending an XML message as text within the
payload, the XML message is not being escaped properly and if I escape
it mayself the message, AXIS escape it again, so it's not useful.

The SOAP message is  this:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:web="http://webservices.xdex.atx.com";>
   <soapenv:Header/>
   <soapenv:Body>
      <web:takeCall
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
         <inputXml xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";> 
        XML Message
         </inputXml>
      </web:takeCall>
   </soapenv:Body>
</soapenv:Envelope>

Where the XML message should be this (an escaped XML message):

&lt;?xml version=&quot;1.0&quot;
encoding=&quot;UTF-8&quot;?&gt;&lt;TakeCallRequest
xmlns=&quot;http://address,cin&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation=&quot;http://address.com/something
TakeCallRequest.xsd&quot;&gt;
&lt;AlarmNumber&gt;123&lt;/AlarmNumber&gt;    &lt;PartyInformation&gt;
&lt;PartyID&gt;test&lt;/PartyID&gt;        &lt;UserID/&gt;
&lt;IPAddress&gt;123.123.123.123&lt;/IPAddress&gt;
&lt;/PartyInformation&gt;&lt;/TakeCallRequest&gt;

I'm using this code to set the payload:

        //Message payload
        OMElement LoPayload = factory.createOMElement("method",
"http://address.com/";);
        LoPayload.setText(PsMsg);//PsMsg = The xml message showed before

If I set just the XML without scaping it I get this:

&lt;?xml version="1.0" encoding="UTF-8"?>&lt;TakeCallRequest
xmlns="http://address.com/something";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://address.com/something
TakeCallRequest.xsd">&lt;AlarmNumber>123&lt;/AlarmNumber>&lt;PartyInform
ation>&lt;PartyID>&lt;/PartyID>&lt;UserID>test&lt;/UserID>&lt;IPAddress>
&lt;/IPAddress>&lt;/PartyInformation>&lt;/TakeCallRequest>

Neither the quotes nor the ">" is being scaped properly

If I create an escaped message, axis escape again the "&" with "&amp;

I'm using the lastest AXIS 2 binary distribution.

I think that the problem is related to the way I'm using the OMElement,
I'll keep trying but if someone can help me to figure this out, It would
be great

Thanks in advance.

Reply via email to