AXIS1:如何个性化“绑定名称”

时间:2011-05-31 21:28:06

标签: java axis

我使用axis1工具生成以下生成的web服务:

  <wsdl:binding name="WSExamplePortSoapBinding" type="impl:WSExamplePortType">
  <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
  <wsdl:operation name="TestMethod">
  <wsdlsoap:operation soapAction="http://localhost/Example/wsdl/Example?wsdl#TestMethod" />
  <wsdl:input name="TestMethodRequest">
  <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost/Example/wsdl/Example?wsdl" use="encoded" />
  </wsdl:input>
  <wsdl:output name="TestMethodResponse">
  <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost/Example/wsdl/Example" use="encoded" />
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="WSExample">
  <wsdl:port binding="impl:WSExamplePortSoapBinding" name="WSExamplePort">
  <wsdlsoap:address location="http://localhost:8082/Example/wsdl/Example" />
  </wsdl:port>
  </wsdl:service>

客户希望我们改变这一行:

<wsdl:binding name="WSExamplePortSoapBinding" type="impl:WSExamplePortType">

有:

<binding name="WSExampleBinding" type="impl:WSExamplePortType">

我们如何改变这个词(WSExamplePortSoapBinding to WSExampleBinding)。

我们尝试在轴源代码中搜索,但我们没有发现是否生成了这个。

谢谢,

1 个答案:

答案 0 :(得分:0)

我解决了这个问题:

  1. 在server-config.wsdd文件中:

    <parameter name="wsdlServicePort" value="ExamplePort"/>
    

    我必须替换为:

    <parameter name="wsdlServicePort" value="Example"/>
    
  2. 然后我必须像这样修改axis-1.4源代码:

    setBindingName(getServicePortName() + "SoapBinding");
    

    我必须替换为:

    setBindingName(getServicePortName() + "Binding");
    
  3. 然后我必须使用ant创建JAR并将新JAR复制到库的源代码。