======= Xfire 添加 soapAction 问题,在线等。。。

【服务端处理】
我发布的 wsdl 中 soapAction  中为空的, 导致我调用失败, 所以我想手动制定 soapAction 的路径, 但是怎么添加在wsdl 中都没有添加进去,附上部分wsdl 代码

<wsdl:binding name="CalculatorServiceHttpBinding" type="tns:CalculatorServicePortType">
    <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="multiply">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="multiplyRequest">
        <wsdlsoap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="multiplyResponse">
        <wsdlsoap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="divide">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="divideRequest">
        <wsdlsoap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="divideResponse">
        <wsdlsoap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="add">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="addRequest">
        <wsdlsoap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="addResponse">
        <wsdlsoap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>


接口java 代码:

public interface CalculatorService {

@WebMethod(operationName = "add" ,action = "urn:add")
public int add(int a, int b);

@WebMethod(operationName = "multiply" ,action = "urn:multiply")
public int multiply(int a, int b);

@WebMethod(operationName = "divide" , action = "urn:divide")
public int divide(int a, int b);
}


services.xml 代码:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xfire.codehaus.org/config/1.0">
<service >
<name>CalculatorService</name>
<serviceClass>com.test.service.CalculatorService</serviceClass>
<implementationClass>com.test.service.impl.CalculatorServiceImpl</implementationClass>

<properties name="method">
<bean class="org.codehaus.xfire.spring.config.MethodBean">
<property name="name" value="add" />
<property name="soapAction" value="urn:add" />
</bean>
<bean class="org.codehaus.xfire.spring.config.MethodBean">
<property name="name" value="multiply" />
<property name="soapAction" value="urn:multiply" />
</bean>
<bean class="org.codehaus.xfire.spring.config.MethodBean">
<property name="name" value="divide" />
<property name="soapAction" value="urn:divide" />
</bean>
</properties>
</service>
</beans>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值