views:

13

answers:

1

I am developing second client application that is consuming existing SOAP web-services. I generate Java from existing WSDL using the latest Apache CXF 2.3 tool

wsdl2java -client -ant http://172.20.0.22/someletters/TradingServer.asmx?WSDL

and get

WSDLToJava Error: java.lang.IllegalArgumentException: An operation with name [{urn:someschema:TradingServer}GetTradeSummary] already exists in this service

that has logic, because when looking at WSDL file you can see 2 similar operation GetTradeSummary, but with different soapAction.

<wsdl:operation name="GetTradeSummary">
  <soap:operation soapAction="urn:someschema/GetTradeSummary" style="document" />
  <wsdl:input>
    <soap:body use="literal" />
  </wsdl:input>
  <wsdl:output>
    <soap:body use="literal" />
  </wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetTradeSummary">
  <soap:operation soapAction="urn:someschema/GetTradeSummary_Open" style="document" />
  <wsdl:input name="GetTradeSummary_Open">
    <soap:body use="literal" />
  </wsdl:input>
  <wsdl:output name="GetTradeSummary_Open">
    <soap:body use="literal" />
  </wsdl:output>
</wsdl:operation>

a) Is it really regarded as erroneous by some standard? Which one?

b) Is there way to bypass this and generate Java scaffolding for the rest? There's nothing such mentioned at CXF WSDL to Java tool web page, except -autoNameResolution which does not help.

A: 

This is specifically disallowed by the WSI-Basic Profile. If you look at:

http://www.ws-i.org/profiles/basicprofile-1.1.html

Section 4.5.3, it specifically states:

Operation name overloading in a wsdl:portType is disallowed by the Profile.

I don't think there is a way around it in CXF as the operations are stored in a Map keyed on QName. Since the QNames would not be unique, only one operation can be stored in the map.

Daniel Kulp