Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't get JAX-WS binding customization to work
    primarykey
    data
    text
    <p>I'm trying to resolve a name clash in a wsdl2java mapping with CXF 2.2.6 The relevant wsdl snippets are:</p> <pre class="lang-xml prettyprint-override"><code>&lt;types&gt;... &lt;xs:schema... &lt;xs:element name="GetBPK"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element name="PersonInfo" type="szr:PersonInfoType" /&gt; &lt;xs:element name="BereichsKennung" type="xs:string" /&gt; &lt;xs:element name="VKZ" type="xs:string" /&gt; &lt;xs:element name="Target" type="szr:FremdBPKRequestType" minOccurs="0" maxOccurs="unbounded" /&gt; &lt;xs:element name="ListMultiplePersons" type="xs:boolean" minOccurs="0" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="GetBPKResponse"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element name="GetBPKReturn" type="xs:string" minOccurs="0" /&gt; &lt;xs:element name="FremdBPK" type="szr:FremdBPKType" minOccurs="0" maxOccurs="unbounded" /&gt; &lt;xs:element name="PersonInfo" type="szr:PersonInfoType" minOccurs="0" maxOccurs="5" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;/xs:schema&gt; &lt;/types&gt; &lt;message name="GetBPKRequest"&gt; &lt;part name="parameters" element="szr:GetBPK" /&gt; &lt;/message&gt; &lt;message name="GetBPKResponse"&gt; &lt;part name="parameters" element="szr:GetBPKResponse" /&gt; &lt;/message&gt; &lt;binding... &lt;operation name="GetBPK"&gt; &lt;wsdlsoap:operation soapAction="" /&gt; &lt;input name="GetBPKRequest"&gt; &lt;wsdlsoap:header message="szr:Header" part="SecurityHeader" use="literal" /&gt; &lt;wsdlsoap:body use="literal" /&gt; &lt;/input&gt; &lt;output name="GetBPKResponse"&gt; &lt;wsdlsoap:body use="literal" /&gt; &lt;/output&gt; &lt;fault name="SZRException"&gt; &lt;wsdlsoap:fault use="literal" name="SZRException" /&gt; &lt;/fault&gt; &lt;/operation&gt; </code></pre> <p>As you can see, the GetBPK operation takes a GetBPK as input and returns a GetBPKResponse as an output. Each element of both the GetBPK, as well as the GetBPKResponse type would be mapped to a method parameter in Java. Unfortunately both GetBPK, as well as the GetBPKResponse have an element with the name "PersonInfo", which results in a name clash.</p> <p>I'm trying to resolve that using a binding customization:</p> <pre class="lang-xml prettyprint-override"><code>&lt;jaxws:bindings wsdlLocation="SZ2-aktuell.wsdl" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:szr="urn:SZRServices"&gt; &lt;jaxws:bindings node="wsdl:definitions/wsdl:portType[@name='SZR']/wsdl:operation[@name='GetBPK']"&gt; &lt;!-- See page 116 of the JAX-WS specification version 2.2 from 10, Dec 2009 --&gt; &lt;jaxws:parameter part="wsdl:definitions/wsdl:message[@name='GetBPKResponse']/wsdl:part[@name='parameters']" childElementName="szr:PersonInfoType" name="PersonInfoParam" /&gt; &lt;/jaxws:bindings&gt; &lt;/jaxws:bindings&gt; </code></pre> <p>and call wsdl2java with the -b parameter. Unforunately, I still get the message:</p> <pre> WSDLToJava Error: Parameter: personInfo already exists for method getBPK but of type at.enno.egovds.szr.PersonInfoType instead of java.util.List. Use a JAXWS/JAXB binding customization to rename the parameter. </pre> <p>I have tried several variants of the binding customization, and searched Google for hours, but unfortunately I cannot find a solution to my problem.</p> <p>I suspenct that the childElementName attribute is wrong, but I can't find an example of what would have to be set to make it work.</p> <p>BTW, a</p> <pre class="lang-xml prettyprint-override"><code>&lt;jaxws:method name="nweMethoName"/&gt; </code></pre> <p>instead of the <code>&lt;jaxws:parameter.../&gt;</code>, works as expected.</p> <p>Thanks in advance!</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.
 

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