Hi Dave, please note your XML snippet that is defined as XSD:string will always be encoded no matter with JAXB binding or Aegis binding. A string within an XML document has to be encoded. One workaround is to redesign your schema, give your xml snippet a concrete schema type instead of xsd:string, or use xsd:any. But to be honest, I havent tried xsd:any by myself, not sure if it works or not. If you are 100% sure you do want to use xsd:string to represent your xml document, you should do the decoding on the client side, there are many utils can do this trivial task for you.
Cheers, Jervis > -----Original Message----- > From: Dave Kallstrom [mailto:[EMAIL PROTECTED] > Sent: 2007?8?14? 3:20 > To: [email protected] > Subject: Re: returning xml from REST based web service > > > However with wrappedmode="false" my incoming parameter is null. > Back to square one. > > On 8/13/07, Dave Kallstrom <[EMAIL PROTECTED]> wrote: > > > > Me and my feeble mind just got it working... Dumped the wrapped > > mode="false" > > Now my xml is returns without any markup. > > <jaxws:endpoint id="Hello" implementor="com.widen.HelloWorldImpl" > > bindingUri=" http://apache.org/cxf/binding/http" address="/hello" > > > <jaxws:serviceFactory> > > <bean class=" > > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean "> > > <property name="dataBinding" ref="aegisDataBinding"/> > > <property name="serviceConfigurations"> > > <list merge="false"> > > <ref bean="jaxConfig"/> > > <ref bean="aegisConfig"/> > > <ref bean="defaultConfig"/> > > </list> > > </property> > > </bean> > > </jaxws:serviceFactory> > > </jaxws:endpoint> > > <bean id="aegisDataBinding" class=" > > org.apache.cxf.aegis.databinding.AegisDatabinding "/> > > > > On 8/13/07, Dave Kallstrom <[EMAIL PROTECTED]> wrote: > > > > > > Okay, > > > Now I am getting a NPE before my method gets called. > > > INFO: Interceptor has thrown exception, unwinding now > > > java.lang.NullPointerException > > > at > org.apache.cxf.binding.http.IriDecoderHelper.buildDocument ( > > > IriDecoderHelper.java:222) > > > I noticed someone else has had similar problems. Is there > a resolution? > > > > http://mail-archives.apache.org/mod_mbox/incubator-cxf-user/20 0707.mbox/[EMAIL PROTECTED] > > > > > > Here are the particulars. > > > @Get > > > @HttpResource(location="/greetings/{hello}") > > > @WebMethod(operationName="GetHello") > > > public abstract > org.w3c.dom.DocumentgetHello(@WebParam(name="GetHello")GetHell > o getHello); > > > and my cxf.xml file looks like this > > > <beans xmlns="http://www.springframework.org/schema/beans " > > > xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" > > > xmlns:jaxws="http://cxf.apache.org/jaxws" > > > xmlns:xsd=" http://www.w3.org/2001/XMLSchema" > > > xsi:schemaLocation=" > > > http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans-2.0.xsd > > > http://cxf.apache.org/jaxws > http://cxf.apache.org/schemas/jaxws.xsd "> > > > > > > <import resource="classpath:META-INF/cxf/cxf.xml"/> > > > <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/> > > > <import resource="classpath:META-INF/cxf/cxf- > > > extension-http-binding.xml"/> > > > > > > <bean id="jaxConfig" class=" > > > org.apache.cxf.jaxws.support.JaxWsServiceConfiguration"/> > > > <bean id="aegisConfig" class=" > > > org.apache.cxf.aegis.databinding.AegisServiceConfiguration"/> > > > <bean id="aegisBean" class=" > > > org.apache.cxf.aegis.databinding.AegisDatabinding"/> > > > <bean id="defaultConfig" class=" > > > org.apache.cxf.service.factory.DefaultServiceConfiguration"/> > > > > > > <jaxws:endpoint id="Hello" > implementor="com.widen.HelloWorldImpl" > > > bindingUri=" http://apache.org/cxf/binding/http" > address="/hello" > > > > <jaxws:serviceFactory> > > > <bean class=" > > > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"> > > > <property name="wrapped" value="false" /> > > > <property name="dataBinding" ref="aegisDataBinding"/> > > > <property name="serviceConfigurations"> > > > <list merge="false"> > > > <ref bean="aegisConfig"/> > > > <ref bean="defaultConfig"/> > > > <ref bean="jaxConfig"/> > > > </list> > > > </property> > > > </bean> > > > </jaxws:serviceFactory> > > > </jaxws:endpoint> > > > <bean id="aegisDataBinding" class=" > > > org.apache.cxf.aegis.databinding.AegisDatabinding"/> > > > </beans> > > > > > > On 8/10/07, Dan Diephouse <[EMAIL PROTECTED] > wrote: > > > > > > > > JAXB will encode any strings that you return. If you > want to return an > > > > xml > > > > document directly from a RESTful service you'd have to > use a different > > > > databinding. If you use the Aegis databinding you can return > > > > javax.xml.transform.Source objects or or org.w3c.dom.Documents. > > > > > http://cwiki.apache.org/CXF20DOC/aegis-databinding.html. Strings will > > > > still > > > > be encoded. > > > > > > > > Hope that helps, > > > > - Dan > > > > > > > > On 8/10/07, Dave Kallstrom < [EMAIL PROTECTED] > wrote: > > > > > > > > > > I am tring to return a snippet of xml as a string > from a cxf/rest > > > > based > > > > > web > > > > > service method. How do I prevent cxf from marking it up. > > > > > Here is what is supposed to be returned > > > > > <?xml version="1.0" encoding="UTF-8" ?> > > > > > <add><doc> > > > > > <field name="id">1</field> > > > > > <field name="filename">filename.psd </field> > > > > > <field name="releaseDate">2007-08-10T10:00:20:070Z</field> > > > > > <field name="dateAdded">2007-08-10T10:00:20:070Z</field> > > > > > <field name="dateUpdated">2007-08-10T10:00:20:070Z</field> > > > > > </doc></add> > > > > > Here is the response from cxf > > > > > > > > > > <ns2:getDocumentsResponse > > > > > xmlns:ns2=" http://myservice.webservices"><?xml > version=" 1.0" > > > > > encoding="UTF-8" ?>
 > > > > > <add><doc>
 > > > > > <field name="id">1</field>
 > > > > > <field name="filename"> beaver.psd</field>
 > > > > > <field > > > > name="releaseDate">2007-08-10T10:00:20:070Z</field>
 > > > > > <field > name="dateAdded">2007-08-10T10:00:20:070Z</field>
 > > > > > > > > > > <field > > > > name="dateUpdated">2007-08-10T10:00:20:070Z</field>
 > > > > > </doc></add>
 > > > > > </ns2:getDocumentsResponse> > > > > > > > > > > > > > > > -- > > > > > > > > > > Dave Kallstrom > > > > > > > > > > > > > > > > > > > > > -- > > > > Dan Diephouse > > > > Envoi Solutions > > > > http://envoisolutions.com | http://netzooid.com/blog > > > > > > > > > > > > > > > > -- > > > Dave Kallstrom > > > > > > > > > > -- > > Dave Kallstrom > > > > > -- > Dave Kallstrom > ---------------------------- IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
