我是网络服务的新手,我正在尝试从wsdl创建一个Weblogic网络服务。
我能够使用该服务如果我在wsdl中只有1个操作,但如果我添加第二个操作,我收到错误找不到Request = [SOAPAction ="" ,Payload = {//域。我只是在portType和绑定中添加操作。 。我真的不确定我错过了什么。
我刚刚在portType和绑定中添加了操作。 。除此之外我还需要改变其他任何东西吗?
答案 0 :(得分:1)
这是我的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>
答案 1 :(得分:-1)
是因为这个:
<soap:operation soapAction="" />
要解决您的问题,请将其放入您班级的方法中:
@WebMethod(action="add")