axis2WSDL显示方法

    技术2022-05-11  49

    我们将aixs2的service部署在tomcat上时,如果想让其通过http url方式在web browser上显示wsdl 则有两种方式 1 axis自动生成wsdl 2 自己实现已经生成wsdl,将其放在指定位置 method1: modify the MYSERIVCE_HOME/META-INF/servicex.xml by adding the following child node to every <operation> node    <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" /> sample:       <operation name="sayHappy"></operatoin> ------>            <operation name="sayHappy">         <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />       </operation> method2:  1 generate the wsdl file that we want to be shown, such as "xx.wsdl"   and put the wsld file to the paht MYSERIVCE_HOME/META-INF/xx.wsdl 2 modify service.xml by adding serviceGroup parent node to the service node   sample: <service name="MyHappyService" >     <description>         Please Type your service description here     </description>     <parameter name="ServiceClass" locked="false">samples.Happy</parameter>     <operation name="sayHappy"></operation> </service> ----------> <serviceGroup>     <service name="MyHappyService" >         <description>             Please Type your service description here         </description>         <parameter name="ServiceClass" locked="false">samples.Happy</parameter>         <operation name="sayHappy"></operation>     </service> </serviceGroup> 3 make sure that the name of the service in services.xml (/serviceGroup/service/@name) is the same as in the custom wsdl's service name (/wsdl:definitions/wsdl:service/@name). directory structure: │ └─happy_service.aar     ├─client     │      Samples_HappyCallbackHandler.class     │      Samples_HappyStub$1.class     │      Samples_HappyStub$ExtensionMapper.class     │      Samples_HappyStub$SayHappy$1.class     │      Samples_HappyStub$SayHappy$Factory.class     │      Samples_HappyStub$SayHappy.class     │      Samples_HappyStub$SayHappyResponse$1.class     │      Samples_HappyStub$SayHappyResponse$Factory.class     │      Samples_HappyStub$SayHappyResponse.class     │      Samples_HappyStub.class     │     ├─lib     ├─META-INF     │      HappyServices.wsdl     │      MANIFEST.MF     │      services.xml     │     └─samples             Happy.class             Hello.class

    最新回复(0)