Hi Jervis, I'm not sure what you mean by "what does your server code look like"? Its just the Echo class that I wrote by hand and the JaxWsServerFactoryBean usage I attached. Both the server and client should be in wrapped mode by default (because getServiceFactory().isWrapped() returns true).
Thanks, - Dan On 8/13/07, Liu, Jervis <[EMAIL PROTECTED]> wrote: > Dan, what does your server side code look like? This seems to be a problem > with bared service on the server side. When the style is bared, the > DocLiteralInInterceptor will try to match the element read from stax with the > MessagePartInfo from schema. In your case, the incoming element's localname > is "text", not sure about the MessagePartInfo in schema, this depends on ur > server is a code-first or wsdl-first. Say, if your server is code-first, and > you set it to wrapped, then there will be a mis-match. > > Cheers, > Jervis > > > -----Original Message----- > > From: Dan Diephouse [mailto:[EMAIL PROTECTED] > > Sent: 2007?8?14? 11:31 > > To: [email protected] > > Subject: xml binding issue? > > > > > > 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 > > > > ---------------------------- > IONA Technologies PLC (registered in Ireland) > Registered Number: 171387 > Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland > -- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog
