mule使用SOAP工件发布和消费web Service的简单例子

开发环境:

Mule Studio - Tooling for Mule ESB

Version: 3.5.0

 

官网上是AppMule Studio 3.5了,版本不太一样,工件已经改成了web service consumer.

 

服务端hello-server.xml:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd">

<flow name="helloService" doc:name="helloService">
    <http:inbound-endpoint address="http://localhost:63081/hello" exchange-pattern="request-response" doc:name="HTTP">
        <cxf:simple-service serviceClass="com.congxing.hello.server.IHelloWorld"/>
    </http:inbound-endpoint>
        <!-- 
        <custom-transformer class="com.congxing.hello.server.HelloServerTransformer" doc:name="Java"/>
        -->
    <component class="com.congxing.hello.server.HelloWorldImpl" doc:name="Java"/> 
  </flow>
</mule>

服务端hello-client.xml:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd">
    <flow name="hello-clientFlow1" doc:name="hello-clientFlow1">
       
       <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="63082" doc:name="HTTP"/>
        
        <custom-transformer class="com.congxing.hello.client.HelloClientTransformer" doc:name="&#32452;&#35013;&#25968;&#25454;"/>
        <response>
            <logger level="INFO" doc:name="Logger" message="The second log::#[payload]"/>
        </response>
        <response>
            <component class="com.congxing.hello.client.HelloClientRespDealer" doc:name="&#35299;&#26512;&#21709;&#24212;&#25968;&#25454;"/>
        </response>
        <response>
            <logger message="The first log:#[payload]" level="INFO" doc:name="Logger"/>
        </response>
     
        <cxf:jaxws-client operation="sayHello" clientClass="com.congxing.hello.client.IHelloWorld" port="IHelloWorldPort" wsdlLocation="classpath:com/congxing/hello/client/hello.xml" doc:name="SOAP"/>
		

        <outbound-endpoint exchange-pattern="request-response" address="http://localhost:63081/hello" doc:name="Generic"/>
  	<!-- 
        <component class="com.congxing.hello.client.HelloClientRespDealer" doc:name="Java"/>
        -->
    </flow>
</mule>

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值