我正在尝试从wsdl自动生成代码,我收到以下错误:
参数:body已存在,方法healthCheck1
我尝试添加自定义绑定文件但由于某种原因它无法正常工作。
WSDL的相关部分:
<wsdl:message name="transactionInfo">
<wsdl:part name="body" element="tsxsd:transactionInfo"/>
</wsdl:message>
<wsdl:message name="userIdentity">
<wsdl:part name="body" element="tsxsd:userIdentity"/>
</wsdl:message>
<wsdl:message name="applicationInfo">
<wsdl:part name="body" element="tsxsd:applicationInfo"/>
</wsdl:message>
<wsdl:binding name="FinancialIndexConstituents_2_SoapBinding" type="FinancialIndexConstituents_2_port">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="HealthCheck_1">
<soap:operation soapAction="http://schemas.ws.com/soapaction?type=HealthCheck_1_Request&ns=http://www.ws.webservices.com/FinancialIndexConstituents_2_HealthCheck_1"/>
<wsdl:input>
<soap:body parts="body" use="literal"/>
<soap:header message="transactionInfo" part="body" use="literal" wsdl:required="false"/>
<soap:header message="userIdentity" part="body" use="literal" wsdl:required="false"/>
<soap:header message="applicationInfo" part="body" use="literal" wsdl:required="false"/>
</wsdl:input>
<wsdl:output>
<soap:body parts="body" use="literal"/>
</wsdl:output>
<wsdl:fault name="DefaultTornadoFault_1">
<soap:fault name="DefaultTornadoFault_1" use="literal"/>
</wsdl:fault>
<wsdl:fault name="NDAFault_1">
<soap:fault name="NDAFault_1" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="Standard_1">
<soap:operation soapAction="http://schemas.ws.com/soapaction?type=FinancialIndexConstituents_2_Standard_1_Request&ns=http://www.ws.webservices.com/FinancialIndexConstituents_2_Standard_1"/>
<wsdl:input>
<soap:body parts="body" use="literal"/>
<soap:header message="transactionInfo" part="body" use="literal" wsdl:required="false"/>
<soap:header message="userIdentity" part="body" use="literal" wsdl:required="false"/>
<soap:header message="applicationInfo" part="body" use="literal" wsdl:required="false"/>
</wsdl:input>
<wsdl:output>
<soap:body parts="body" use="literal"/>
</wsdl:output>
<wsdl:fault name="DefaultTornadoFault_1">
<soap:fault name="DefaultTornadoFault_1" use="literal"/>
</wsdl:fault>
<wsdl:fault name="NDAFault_1">
<soap:fault name="NDAFault_1" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
我的绑定文件:
<?xml version="1.0" encoding="UTF-8"?>
<jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns="http://java.sun.com/xml/ns/jaxws"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
wsdlLocation="FinancialIndexConstituents_2.wsdl">
<jaxws:bindings node="wsdl:definitions/wsdl:portType[@name='FinancialIndexConstituents_2_port']/wsdl:operation[@name='HealthCheck_1']">
<jaxws:parameter
part="wsdl:definitions/wsdl:message[@name='transactionInfo']/wsdl:part[@name='body']" name="healthCheckTransInfoBody" />
<jaxws:parameter
part="wsdl:definitions/wsdl:message[@name='userIdentity']/wsdl:part[@name='body']" name="healthCheckUserIdBody" />
<jaxws:parameter
part="wsdl:definitions/wsdl:message[@name='applicationInfo']/wsdl:part[@name='body']" name="healthCheckAppInfobody" />
</jaxws:bindings>
</jaxws:bindings>
我相信我可能会遇到某种XPATH问题,因为使用此绑定文件我现在收到以下错误:
参数:healthCheckAppInfobody已经存在于方法healthCheck1但是类型为java.lang.Object而不是TransactionInfo。使用JAXWS / JAXB绑定自定义来重命名参数。
我希望它会将healthCheckTransInfoBody应用于该结构。