have a look here:

http://cxf.547215.n5.nabble.com/CXF-jaxb-send-string-as-CData-tt5524523.html#a5530343

That should do it

Sergey

On 29/03/12 15:58, [email protected] wrote:
Hi again,

I meanwhile created my own XmlStringAdapter that would not do the scrumbling:

public class XmlStringAdapter extends XmlAdapter<String, String>  {

        @Override
        public String marshal(String string) throws Exception {
                System.out.println("marshal");
                return string;
        }

        @Override
        public String unmarshal(String string) throws Exception {
                System.out.println("unmarshal");
                return string;
        }

}

"marshal" is written to the console. So my adapter is really called. However, the string that 
is handed in to the marshal-method is unescaped (contains<  and>  and no&lt; and&gt;). So 
there is nothing I can do here to fix the issue. Seems like the escaping happens at a later point.

Any ideas greatly appreciated.

Cheers, Oliver

-------- Original-Nachricht --------
Datum: Thu, 29 Mar 2012 13:15:18 +0200
Von: [email protected]
An: [email protected]
Betreff: Problem with sending XML as a method parameter:<  and>  change to&lt; 
and&gt;

Hello,

I’m developing a cxf web service client that passes an xml string to the web service 
server stored in the string field of some request object. After the client call to the 
server is invoked the XML string seems to get interpreted by something within cxf or 
some component used by it: all xml opening and closing brackets get replaced by&lt; 
and&gt; The server of course cannot interpret the message and rejects it. I found 
several postings on the internet asking for help concerning the same issue, but nothing 
helped. I also tried to declare the xml string field with anyType as suggested, but 
this didn't do it. I'm using cxf 2.5.2.

I then downloaded the wsdl_first_soap12 sample from cxf.apache.org and changed it to make 
the client send my xml string to the server instead of sending "hello world". 
This worked out of the box without a problem: the xml did not get scrambled. Okay, now I 
only need to find the difference between the wsdl_first_soap12 sample and my client and 
I'm done. So I thought. No luck so far.

I then copied the wsdl of my service into the wsdl file of the 
wsdl_first_soap12 sample. This way the working wsdl_first_soap12 remains 
completely unchanged except for the wsdl only. Then the xml scrambeling problem 
occured again ;-(. For every difference I could find in both WSDLs I changed my 
WSDL and tried again. All the time without any luck.

Now I'd be thankful if anyone had an idea what I could do to fix this.
Thanx, Oliver


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to