Search code examples
javaaxis

AXIS1: How to personalize the "binding name"


We had the following generated webservices with axis1 tools:

  <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>

and the client want to us change the line:

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

for:

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

Q: How we can change that word? (WSExamplePortSoapBinding to WSExampleBinding).

We had searched on the axis source code, but we can't find were is generated that name.

Thanks for the help,


Solution

  • I solved this issue like this:

    1. In the server-config.wsdd file:

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

      I have to replace to:

      <parameter name="wsdlServicePort" value="Example"/>
      
    2. Then I have to modify the axis-1.4 source code like this:

      setBindingName(getServicePortName() + "SoapBinding");
      

      I have to replace to:

      setBindingName(getServicePortName() + "Binding");
      

    Then I have to make the JAR with ant and copy the new JAR to the source of the library.