You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Ruane, Conleth" <co...@hp.com> on 2005/03/23 14:27:10 UTC
Carriage Returns/Line feeds not being encoded
Hi All,
I'm using Axis version 1.1 to send messages to a service also implemented using Axis.
I am having the problem that although special characters are being encoded correctly carriage return/line feed characters are not and this is causing a problem in the service I'm talking to.
I've analysed what I'm sending using TCP-Tunnel and this is what I see
The object to be serialised contains a text field with the text (2 lines):
This is a test umlaut รถ
Second line
The appropriate part of the message going out is:
<multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:Comment" xmlns:ns5="urn:ews-structs" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<cmnt_extrn_fl xsi:type="xsd:string">N</cmnt_extrn_fl>
<cmnt_text_memo xsi:type="xsd:string">This is a test umlaut ö
Second line</cmnt_text_memo>
</multiRef>
What I would expect is:
<multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:Comment" xmlns:ns5="urn:ews-structs" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<cmnt_extrn_fl xsi:type="xsd:string">N</cmnt_extrn_fl>
<cmnt_text_memo xsi:type="xsd:string">This is a test umlaut ö Second line</cmnt_text_memo>
</multiRef>
This is the java code I'm using to specify the serializer:
java.lang.Class cls;
javax.xml.namespace.QName qName;
java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
//
qName = new javax.xml.namespace.QName("urn:ews-structs", "Comment");
cls = com.hp.ews.bd.beans.Comment.class;
call.registerTypeMapping(cls, qName, beansf, beandf);
Is there any way I can force the encoding of carriage returns?
Thanks for any help.
Con