0
我有一个wsdl(RPC编码),它包含2对具有相同操作名称但具有不同参数和不同输入/输出消息的操作。WSDL中具有相同名称但具有不同参数的两个操作
这里是wsdl的重要部分(我可以生成java代码,而wsdl是有效的)。
<!-- message for the first operation -->
<wsdl:message name="SomethingGoodRequest">
<wsdl:part name="paramOne" type="xsd:int">
</wsdl:part>
<wsdl:part name="paramTwo" type="soapenc:string">
</wsdl:part>
<wsdl:part name="paramThree" type="soapenc:string">
</wsdl:part>
<wsdl:part name="paramFour" type="soapenc:string">
</wsdl:part>
<wsdl:part name="paramFive" type="soapenc:string">
</wsdl:part>
</wsdl:message>
<!-- message for the second operation -->
<wsdl:message name="SomethingGoodRequest1">
<wsdl:part name="paramOne" type="xsd:int">
</wsdl:part>
<wsdl:part name="paramTwo" type="soapenc:string">
</wsdl:part>
<wsdl:part name="paramThree" type="tns1:VerySpecialTypeForGoodThings">
</wsdl:part>
<wsdl:part name="paramFour" type="soapenc:string">
</wsdl:part>
<wsdl:part name="paramFive" type="soapenc:string">
</wsdl:part>
</wsdl:message>
<!-- the operations -->
<wsdl:operation name="SomethingGood" parameterOrder="paramOne paramTwo paramThree paramFour paramFive">
<wsdl:input message="impl:SomethingGoodRequest" name="SomethingGoodRequest" />
<wsdl:output message="impl:SomethingGoodResponse" name="SomethingGoodResponse" />
</wsdl:operation>
<wsdl:operation name="SomethingGood" parameterOrder="paramOne paramTwo paramThree">
<wsdl:input message="impl:SomethingGoodRequest1" name="SomethingGoodRequest1" />
<wsdl:output message="impl:SomethingGoodResponse1" name="SomethingGoodResponse1" />
</wsdl:operation>
<wsdl:operation name="SomethingGood">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="SomethingGoodRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://nevermind" use="encoded"/>
</wsdl:input>
<wsdl:output name="SomethingGoodResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://nevermind" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="SomethingGood">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="SomethingGoodRequest1">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://nevermind" use="encoded"/>
</wsdl:input>
<wsdl:output name="SomethingGoodResponse1">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://nevermind" use="encoded"/>
</wsdl:output>
</wsdl:operation>
的问题是,每当我试图调用第二个方法(从谁共享两个相同名字的)我得到这个异常(500内部服务器错误):
faultDetail:
{}:return code: 500
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>Server</faultcode>
<faultstring>Missing operation for soapAction [] and body element [{http://nevermind/}SomethingGood] with SOAP Version [SOAP 1.1]</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
有趣的事是,我可以毫无问题地调用其他所有操作(从java客户端和SoapUI中),并且我可以从共享相同名称的用户中调用第一个操作。
因此,我可以用5个参数成功SomethingGood,但是当我尝试使用3个参数调用这个参数时,我得到上面描述的异常。
是否有任何解决方法,或仅通过修复wsdl? (我得到了wsdl,所以我不能自己编辑它)
在此先感谢!
无论谁给你这个wsdl,他在产生这种wsdl时都必须警告。他根本无视它。在这种情况下,您可以提供不同的SOAP Action,但是您必须再次编辑您的wsdl。 – kingAm