cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Diephouse" <...@envoisolutions.com>
Subject xml binding issue?
Date Tue, 14 Aug 2007 03:30:44 GMT
I was trying out this code today:
        JaxWsServerFactoryBean bean = new JaxWsServerFactoryBean();
        bean.setServiceBean(new Echo());
        bean.setAddress("http://localhost:8080/test");
        bean.setBindingId(XMLConstants.NS_XML_FORMAT);
        bean.create();

        JaxWsClientFactoryBean pf = new JaxWsClientFactoryBean();
        pf.setServiceClass(Echo.class);
        pf.setAddress("http://localhost:8080/test");
        pf.setBindingId(XMLConstants.NS_XML_FORMAT);
        pf.getFeatures().add(new LoggingFeature());

        Client client = pf.create();
        Object[] res = client.invoke("echo", "hello");
        System.out.println(res[0]);

And I end up with this message being sent to the endpoint:

<text>hello</text>

And I get the following exception on the server side:

org.apache.cxf.interceptor.Fault: Message part text was not recognized.
    at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(
DocLiteralInInterceptor.java:180)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
PhaseInterceptorChain.java:207)

I've been trying to figure out whats going on, but DocLiteralInInterceptor
looks like jibberish to me at the moment. Anyone more familiar with the
XMLBinding able to comment why the above doesn't work? If I do
bean.getServiceFactory().setWrapped(false) things work fine...

Thanks,
- Dan

BTW here's my Echo class:

@WebService
public class Echo {

    @WebResult(name="text")
    @WebMethod
    public String echo(@WebParam(name="text") String s) {
        return s;
    }
}

-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message