Note that there are some explanatory texts on larger screens.

plurals
  1. POCXF: method disturbs other methods, org.apache.cxf.interceptor.Fault: Message part [...] was not recognized
    primarykey
    data
    text
    <p>UPDATE: I have boiled the problem down to two methods starting with a parameter of the same name. I have submitted a bug to CXF with demo code here: <a href="https://issues.apache.org/jira/browse/CXF-4201" rel="nofollow">https://issues.apache.org/jira/browse/CXF-4201</a></p> <p>I am trying to develop a simple web service with spring and Apache CXF 2.5.2. My first attempt was to start from Java and generate a WSDL from that. However, I was unable to get array parameters of complex types to work (see also my other SO question).</p> <p>Now I tried to take the WSDL generated from that, and use it as a starting point. I generate a service with the maven cxf wsdl2java plugin, and also a client for testing (the one that calls every method once with parameter values like null or 0) - so far they only have the default implementations.</p> <p>I have essentially the spring config from an example on the cxf homepage</p> <pre><code>&lt;import resource="classpath:META-INF/cxf/cxf.xml" /&gt; &lt;import resource="classpath:META-INF/cxf/cxf-servlet.xml" /&gt; &lt;jaxws:endpoint id="myService" implementor="bla.blubb.myServiceImpl" implementorClass="bla.blubb.myServiceImpl" address="/myservice" /&gt; </code></pre> <p>Now a lot more stuff seems to work, but I have found that one of the methods disturbs the others. If I comment that out in the interface class, all the other method calls work fine (I kept the same WSDL, but jetty only complains that it can't find an implementation for the other methods, so they won't be available). If I remove the comments, suddenly some other methods start failing with an error message like </p> <pre><code>WARNING: Interceptor for {myservice/}service#{myservice}weirdmethod has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Message part {http://myservice/}someparam was not recognized. (Does it exist in service WSDL?) </code></pre> <p>And that is even though the "evil method" is not even being called from the client. </p> <p>I looked into it and it seems the evil method is the only one that has a return type that contains an array of objects of another type (rather than an array of Strings or other "normal" stuff). Since I had those problems with arrays before, I suspected that might be causing a problem. But then I tried commenting out all other methods in the interface except for the evil method. Now the evil method works.</p> <p>I don't understand WSDLs very well, but it actually looks OK to me. The definition of the return type of the evil method contains a line </p> <pre><code>&lt;xs:element maxOccurs="unbounded" minOccurs="0" name="things" type="tns:thing"/&gt; </code></pre> <p>and thing is also defined as a type elsewhere.</p> <p>Unfortunately I can not post the full WSDL as it is a client project.</p> <p>Thanks for any pointers, I am really running out of ideas.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload