Hi!
The behavior of Axis seems entirely correct to me, because there is no
need to escape ">" and quotes only need to be escaped when appearing
inside an attribute value. Why would you like to have Axis escape ">"
and quotes?
Andreas
On 03 Jan 2008, at 19:02, Melchi, Pablo (GE Money, consultant) wrote:
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):
<?xml version="1.0" encoding="UTF-8"?
><TakeCallRequest xmlns="http://address,cin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://address.com/something
TakeCallRequest.xsd"> <AlarmNumber>123</
AlarmNumber> <PartyInformation>
<PartyID>test</PartyID> <UserID/>
<IPAddress>123.123.123.123</IPAddress> </
PartyInformation></TakeCallRequest>
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:
<?xml version="1.0" encoding="UTF-8"?><TakeCallRequest xmlns="http://address.com/something
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://address.com/something
TakeCallRequest.xsd"><AlarmNumber>123</
AlarmNumber><PartyInformation><PartyID></
PartyID><UserID>test</UserID><IPAddress></IPAddress></
PartyInformation></TakeCallRequest>
Neither the quotes nor the ">" is being scaped properly
If I create an escaped message, axis escape again the "&" with "&
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.