Mule ESB 3.8版本,发布webservice 服务

在官网看的例子,自己实现了一下,大概流程写了出来,仅供参考。

开发工具:AnypointStudio


1、创建服务接口

package org.example;
 
importjavax.jws.WebService;
 
@WebService
publicinterfaceHelloWorld {
    StringsayHi(String text);
}


2、创建其实现类

package org.example;
import javax.jws.WebService;
@WebService(endpointInterface = "org.example.HelloWorld",
            serviceName = "HelloWorld")
public class HelloWorldImpl implements HelloWorld {
	public String sayHi(String text) {
     return "Hello " + text;
   }
}

3、配置flow

<?xmlversion="1.0"encoding="UTF-8"?>
 
      <mulexmlns="http://www.mulesoft.org/schema/mule/core"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:http="http://www.mulesoft.org/schema/mule/http"
   xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
   xsi:schemaLocation="
   http://www.mulesoft.org/schema/mule/corehttp://www.mulesoft.org/schema/mule/core/current/mule.xsd
   http://www.mulesoft.org/schema/mule/httphttp://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
   http://www.mulesoft.org/schema/mule/cxfhttp://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd">
   <http:listener-configname="listener-config"host="localhost"port="63081"/>
   <flowname="helloService">
   <http:listenerconfig-ref="listener-config"path="hello"/>
   <cxf:jaxws-serviceserviceClass="org.example.HelloWorld"/>
   <componentclass="org.example.HelloWorldImpl"/>
   </flow>
   </mule>


4、测试

在浏览器上输入

http://localhost:63081/hello?wsdl



5、如有差错,欢迎批评指正 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值