I just remembered there is one possible solution. You define desc as an xsd:any 
type.
So you can place valid xml in the element. 

In cxf this will giver you a dom node for the element when you generate code.

Best regards

Christian
 




Christian Schneider
Informationsverarbeitung 
Business Solutions
Handel und Dispatching

Tel : +49-(0)721-63-15482

EnBW Systeme Infrastruktur Support GmbH
Sitz der Gesellschaft: Karlsruhe
Handelsregister: Amtsgericht Mannheim ­ HRB 108550
Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
Geschäftsführer: Jochen Adenau, Hans-Günther Meier


-----Ursprüngliche Nachricht-----
Von: hsemar [mailto:[email protected]] 
Gesendet: Mittwoch, 24. November 2010 16:39
An: [email protected]
Betreff: How to enforce the clients to use CDATA for specific elements


How do I handle the special characters in web service request
 
I have a web service method and here is the sample request
 
<request>
     <id>1<id>
      <desc>this is desc of
<itemid>1</itemid><itemname>ipod</itemname></desc>
       <category>2</category>
</request> 
 
desc element type is string in my schema file.
 
When I create client stub and test this, the < and > characters inside
<desc> element are converted into ;lt and ;gt respectively and everything
works fine.
 
But when I test this same service using SoapUI, the charatcters are not
being converted and I get unmarsshalling error which is fair.
 
So, now how do I make sure the data inside the <desc> element is not
processed ? Do I need to write a handler and acheive this in the server
side?
 
Is there anyway that we can say this element should be wrapped with CDATA ?
I know it is not possible in the XSD schema. I'm mostly looking for a server
side (web service level not at the client level) solution
 
Also, I would like to remove some set of special characters from the soap
request before the request is used inside the web service method..any idea?
 
I would like to get your valuable suggestions on this.
-- 
View this message in context: 
http://cxf.547215.n5.nabble.com/How-to-enforce-the-clients-to-use-CDATA-for-specific-elements-tp3278597p3278597.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to