<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:pattern="http://www.mulesoft.org/schema/mule/pattern"
xmlns:ws="http://www.mulesoft.org/schema/mule/ws"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ws http://www.mulesoft.org/schema/mule/ws/3.1/mule-ws.xsd
http://www.mulesoft.org/schema/mule/pattern http://www.mulesoft.org/schema/mule/pattern/current/mule-pattern.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
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">
<!-- 远程调用发布的webservice方法一
调用结果:不报错,浏览器输出“Directory Listing Denied This Virtual Directory does not allow contents to be listed.”-->
<!-- <flow name="HttpProxyService" doc:name="HttpProxyService">
<http:inbound-endpoint exchange-pattern="request-response" encoding="UTF-8" address="http://localhost:8880" doc:name="HTTP"/>
<http:outbound-endpoint exchange-pattern="request-response" encoding="UTF-8" address="http://webservice.webxml.com.cn?op=getWeather" doc:name="HTTP" method="GET"/>
</flow>
-->
<!-- 远程调用发布的webservice方法二
调用结果:success!
其中"?op=getWeather"指明调用方法名。
参考资料:http://www.mulesoft.org/documentation/display/34X/Web+Service+Proxy+Pattern-->
<pattern:web-service-proxy name="muleProxy" inboundAddress="http://localhost:8881"
outboundAddress="http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx?op=getWeather">
</pattern:web-service-proxy>
<!-- 远程调用发布的webservice方法三
调用结果:success!-->
<!-- <ws:proxy name="mule-Ws-Proxy" inboundAddress="http://localhost:8882"
outboundAddress="http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx?op=getWeather" />
-->
</mule>
<!--使用说明:这是一个服务代理的例子,被代理的服务是“http://localhost:8888”,是一个已经发布的web Service(他可以是发布在本地服务器上的服务
,也可以是发布在远程服务器上的服务,总之,只要是义发布的web Service就可以),本文中是发布在Standalone server中(路径:D:\mule-standalone-3.4.0\apps\mule-example-hello-3.4.0),
服务“http://localhost:8880”是发布在esb平台上的代理服务。
参考资料:http://www.360doc.com/content/11/0322/15/2795334_103545455.shtml
目的:通过esb平台上的代理服务来访问第三方web Service-->
<!-- 说明2:原有例子采用方法一,outbound-endpoint address为发布在Standalone serve中的服务访问地址(http://localhost:8888)。使用时需要先启动mule Standalone serve。
现修改为多种配置方法代理远程服务。方法2、3需要增加对应namespace(现已全部加入),否则出现not bound错误。
参考资料:http://www.oschina.net/question/1467716_146853?sort=time -->