[
https://issues.apache.org/jira/browse/CXF-3495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13029693#comment-13029693
]
Daniel Kulp commented on CXF-3495:
----------------------------------
With the @WebService annotation on there, I assume you are expecting it to be
JAX-WS. Thus, you should likely be using the JaxWsClientFactoryBean instead of
the ClientProxyFactoryBean. The namespace qualification on the "arg0" element
is kind of a give away on that. The simple frontend, by default, uses
qualified elements (compatible with what XFire did). The JAX-WS frontend uses
unqualified elements. Thus, it LOOKS like the server is expecting JAX-WS
form, but the use of the ClientProxyFactoryBean instead of the JaxWs version
is causing the unexpected element to be sent.
> ClientProxyFactoryBean sends wrong payload when the interface just has some
> simple method : (Unmarshalling Error)
> -----------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3495
> URL: https://issues.apache.org/jira/browse/CXF-3495
> Project: CXF
> Issue Type: Bug
> Components: Tooling
> Affects Versions: 2.4
> Environment: win7 eclipse cxf2.4
> Reporter: JackEthon
> Labels: client, cxf, payload, soap
>
> when my interface just as follows:
> @WebService
> public interface IWsTest {
> public int method(String str);
> }
> and I use ClientProxyFacoryBean to assess the service ( calling
> IWsTest.method("str") ) , the server says:
> Interceptor for {http://toxind.com/}IWsTestService#{http://toxind.com/}method
> has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element
> (uri:"http://toxind.com/", local:"arg0"). Expected elements are <{}arg0> ..
> and I add some method to the interface :
> @WebService
> public interface IWsTest {
> public int method(String str);
> public void add(Bean bean); // the Bean class add annotation
> @XmlRootElement
> }
> then I use the same codes to access the same service , the server is just
> fine.
> I got the payload , and the different is :
> <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:method
> xmlns:ns1="http://toxind.com/"><arg0
> xmlns="http://toxind.com/">xx</arg0></ns1:method></soap:Body></soap:Envelope>
> and
> <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:method
> xmlns:ns1="http://toxind.com/"><arg0>xx</arg0></ns1:method></soap:Body></soap:Envelope>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira