简体   繁体   中英

Change part name with Jaxb binding

I have a WSDL like that :

...
<wsdl:message name="myHeader">
    <wsdl:part name="parameter" element="header:myHeader"/>
</wsdl:message>
...
<wsdl:operation name="myOperation">
   <soap:operation soapAction="myOperation" style="document" />
   <wsdl:input name="myOperationRequest">
    <soap:header message="mySession:myHeader" part="header" use="literal"/>
       <soap:body parts="parameters" use="literal" />
   </wsdl:input>
   <wsdl:output name="myOperationResponse">
       <soap:body parts="parameters" use="literal" />
   </wsdl:output>
   <wsdl:fault name="myOperationException">
       <soap:fault name="createTroubleTicketByValueException" use="literal" />
   </wsdl:fault>
</wsdl:operation>
....

I convert my WSDL into Java with wsdl2java, not problem during the conversion with the exsh set to true. But when I start my application (Spring 4, CXF 2.7), I'm getting the following warning :

2015-09-28 14:19:04,640 WARN [main] oacsfReflectionServiceFactoryBean(1525) - Method interface ....XXXSessionWSPort.myOperation is configured as BARE but there are more than one parameters with wrong @Webparam annotated or without @WebParam annotated.

If I look closer to the WsPort generated :

@WebResult(name = "myOperationResponse", targetNamespace = "http://myNamespace", partName = "parameters")
@WebMethod(action = "myOperation")
public myOperationResponse myOperation(
    @WebParam(partName = "parameters", name = "myOperationRequest", targetNamespace = "http://myNameSpace")
    myOperationRequest parameters,
    @WebParam(partName = "parameters", name = "myheader", targetNamespace = "http://headerNameSpace", header = true)
    myHeader parameters1) throws myOperationException;

Moreover, as a client when I make a call to myOperation CXF/JAXB/Jax-ws/...(?) add a "1" at the end of the myHeader tag, consequently the server cannot handle the header...

After debugging in the class ReflectionServiceFactoryBean, I see the problem coming from the same partName in the two @WebParam.

To correct this, I have to change the header's part name into the WSDL, but I can't : it's not mine.

So I would made this change in the jaxb binding xml file, if possible, how can I do that?

If you have a better solution don't hesitate!

A bit late, but maybe this can help you: "A customization file"

http://java-soa.blogspot.pe/2008/07/parameter-customization-in-jax-ws.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM