cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Getting raw XML parameter in JAX-WS webservice method
Date Thu, 18 Nov 2010 20:48:22 GMT
On Thursday 18 November 2010 1:30:03 pm Владимир Коньков wrote:
> Hi there!
> How to achieve something like that:
> @WebService(endpointInterface = "ru.citc.techtest.cxfconcepts.HelloWorld")
> public class HelloWorldImpl implements HelloWorld {
> 
>     public String sayHi(DOMSource xml) {
>         return "Hello " + xml;
>     }
> }
> 
> My project is wsdl first and I've strict schemas for my messages. But I'nt
> need any Java proxy, because all my processing is XML based (I need a raw
> XML for processing SAX or DOM). In same time I want to leverage existing
> method routing of JAX-WS or Simple frontends. Please, suggest how. Thanx
> in any advice

In general, this SOUNDS like you want a JAX-WS Provider based endpoint and not 
a generated one.   You would have something like:

@WebServiceProvider(wsdlLocation = ".....")
@ServiceMode(value = Service.Mode.PAYLOAD)            
public class MyService implements Provider<Source> {
          public Source invoke(Source request) {
		...process xml....
                return someSource;
          }
}


By default, you'll get a StaxSource in there (but can return any Source), but 
you can also make it Provider(DOMSource) if you was a DOM. (but then you'll 
need to return a DOMSource.   Unfortunately, this won't do any method routing.

An option you can TRY (I really don't know if this will work) is:

@WebService(wsdlLocation = "....")
@DataBinding(org.apache.cxf.databinding.source.SourceDataBinding.class)
public class HelloWorldImpl implements HelloWorld {
     public Source sayHi(Source xml) {
        return xml;
     }
}


You may need a @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) 
annotation on there as well.


-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Mime
View raw message