1

我是 Web 服务的新手,我正在尝试从 wsdl 创建一个 Weblogic Web 服务。

我可以使用该服务如果我在 wsdl 中只有 1 个操作,但如果我添加第二个操作,我会收到错误 Cannot find dispatch method for Request=[SOAPAction="",Payload={//domain 。我只是在 portType 和绑定中添加操作。. 我真的不确定我错过了什么。

我刚刚在 portType 和 binding 中添加了操作。. 除了这个,我还需要改变什么吗?

这是我的wsdl

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is 
JAX-WS RI 2.2.6hudson-86 svn-revision#12773. -->
<definitions targetNamespace="http://service.training.indus.com/"
name="CalculatorService" xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsp="http://www.w3.org/ns/ws-policy"                 
xmlns:calSvc="http://service.training.indus.com/"
xmlns:calciInOut="http://domain.training.indus.com/"   
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<types>
    <xsd:schema>
        <xsd:import namespace="http://domain.training.indus.com/"
            schemaLocation="../xsd/CalculatorService_schema1.xsd" />
    </xsd:schema>
</types>
<message name="calciInputMsg">
    <part name="parameters" element="calciInOut:calciInputRequest" />
</message>
<message name="calciOutputMsg">
    <part name="parameters" element="calciInOut:calciOutputResponse" />
</message>
<portType name="CalculatorPort">
<operation name="multiply">       
    <inputwsam:Action="http://service.training.indus.com/Calculator/multiplyRequest"
            message="calSvc:calciInputMsg" />
   <output wsam:Action="http://service.training.indus.com/Calculator/multiplyResponse"
            message="calSvc:calciOutputMsg" />
    </operation>

    <operation name="addition">
<input wsam:Action="http://service.training.indus.com/Calculator/multiplyRequest"
            message="calSvc:calciInputMsg" />
        <output
    wsam:Action="http://service.training.indus.com/Calculator/multiplyResponse"
            message="calSvc:calciOutputMsg" />
    </operation>
</portType>
<binding name="CalculatorPortBinding" type="calSvc:CalculatorPort">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
        style="document" />
    <operation name="multiply">
        <soap:operation soapAction="" />
        <input>
            <soap:body use="literal" />
        </input>
        <output>
            <soap:body use="literal" />
        </output>
    </operation>
    <operation name="addition">
        <soap:operation soapAction="" />
        <input>
            <soap:body use="literal" />
        </input>
        <output>
            <soap:body use="literal" />
        </output>
    </operation>
</binding>
<service name="CalculatorService">
<port name="CalculatorSvcPort" binding="calSvc:CalculatorPortBinding"> 
<soap:address location="http://localhost:9010/TestTopDown/CalculatorService" />
    </port>
</service>
  </definitions>
4

1 回答 1

-1

是因为这个: <soap:operation soapAction="" />

要解决您的问题,请将其放入您班级的方法中:

@WebMethod(action="add")

于 2014-11-11T17:34:54.980 回答