axis2WSDL显示方法

我们将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
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值