- 浏览: 2487352 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
mule2.2.x架构(八)部署到WEB项目
所有的示例文档
http://www.mulesoft.org/display/MULE2INTRO/Examples
本来想参考webapp的,结果没有成功,于是在原来的例子基础上一个一个自己慢慢集成到WEB中试试。
在web.xml中配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Mule</display-name>
<description>MuleWebAppSamples</description>
<!-- 装载的配置文件 -->
<context-param>
<param-name>org.mule.config</param-name>
<param-value>
echo/echo-axis-config.xml,
echo/echo-cxf-config.xml
</param-value>
</context-param>
<!-- 容器的监听器 -->
<listener>
<listener-class>
org.mule.config.builders.MuleXmlBuilderContextListener
</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
里面的两个配置文件就是使用的原来项目中的,如果两个都要一起启动,那么后面有提到service和model名字需要做修改,不然要冲突。也可以一个一个启动。
另外我在pom.xml中引入了一下的包:
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transports</artifactId>
<version>2.2.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.mule</groupId>
<artifactId>mule</artifactId>
<version>2.2.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.mule</groupId>
<artifactId>mule-core</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.mule.tests</groupId>
<artifactId>mule-tests-functional</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.python</groupId>
<artifactId>jython</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>com.sun.script</groupId>
<artifactId>jython-engine</artifactId>
<version>1.1jdk14</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-builders</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-servlet</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-management</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-stdio</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-vm</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-client</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-axis</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-cxf</artifactId>
<version>2.2.1</version>
</dependency>
echo/echo-axis-config.xml
调用方法
http://localhost:65081/services/EchoUMO?method=echo¶m=iamcarl
返回
<?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<echoResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<echoReturn xsi:type="xsd:string">iamcarl</echoReturn>
</echoResponse>
</soapenv:Body>
</soapenv:Envelope>
WSDL文件路径http://localhost:65081/services/EchoUMO?wsdl,嘿嘿,用刚刚正的xfire的client来调用一下试试。
核心调用程序如下:
Client client = new Client(new URL(
"http://localhost:65081/services/EchoUMO?wsdl"));
Object[] results = client.invoke("echo", new Object[] { "hello mule!" });
System.out.println("results:" + results[0]);
}
打印出了hello mule
echo/echo-cxf-config.xml
拷贝了echo-cxf-config.xml后,需要修改axis和cxf里面的 model名称和service名称分别如下:
AXIS: <model name="echoAxis">
<service name="EchoUMOAxis">
CXF: <model name="echoCxf">
<service name="EchoUMOCxf">
修改了以上名字后,Axis的调用的service名字就改为了echoAxis了,需要访问
http://localhost:65081/services/EchoUMOAxis?method=echo¶m=iamcarl
和
http://localhost:65081/services/EchoUMOAxis?wsdl
调用CXF方法不受这个名字的影响,而是在address中决定的,为了看起来统一方便,我将address的名字做了修改,
加上了Cxf的后缀
<cxf:inbound-endpoint address="http://localhost:65082/services/EchoUMOCxf"
serviceClass="com.sillycat.easymule.echo.Echo"/>
那么访问CXF的链接就变为
http://host/service/OPERATION/PARAM_NAME/PARAM_VALUE
http://localhost:65082/services/EchoUMOCxf/echo/text/hello
返回
<soap:Envelope>
<soap:Body>
<ns2:echoResponse>
<text>hello</text>
</ns2:echoResponse>
</soap:Body>
</soap:Envelope>
WSDL文件路径:http://localhost:65082/services/EchoUMOCxf?wsdl,用xfire的client访问一下,发现取不到返回值:(,不过我对cxf也不熟悉。所以这里也不去查找了。
所有的示例文档
http://www.mulesoft.org/display/MULE2INTRO/Examples
本来想参考webapp的,结果没有成功,于是在原来的例子基础上一个一个自己慢慢集成到WEB中试试。
在web.xml中配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Mule</display-name>
<description>MuleWebAppSamples</description>
<!-- 装载的配置文件 -->
<context-param>
<param-name>org.mule.config</param-name>
<param-value>
echo/echo-axis-config.xml,
echo/echo-cxf-config.xml
</param-value>
</context-param>
<!-- 容器的监听器 -->
<listener>
<listener-class>
org.mule.config.builders.MuleXmlBuilderContextListener
</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
里面的两个配置文件就是使用的原来项目中的,如果两个都要一起启动,那么后面有提到service和model名字需要做修改,不然要冲突。也可以一个一个启动。
另外我在pom.xml中引入了一下的包:
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transports</artifactId>
<version>2.2.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.mule</groupId>
<artifactId>mule</artifactId>
<version>2.2.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.mule</groupId>
<artifactId>mule-core</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.mule.tests</groupId>
<artifactId>mule-tests-functional</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.python</groupId>
<artifactId>jython</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>com.sun.script</groupId>
<artifactId>jython-engine</artifactId>
<version>1.1jdk14</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-builders</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-servlet</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-management</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-stdio</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-vm</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-client</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-axis</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-cxf</artifactId>
<version>2.2.1</version>
</dependency>
echo/echo-axis-config.xml
调用方法
http://localhost:65081/services/EchoUMO?method=echo¶m=iamcarl
返回
<?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<echoResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<echoReturn xsi:type="xsd:string">iamcarl</echoReturn>
</echoResponse>
</soapenv:Body>
</soapenv:Envelope>
WSDL文件路径http://localhost:65081/services/EchoUMO?wsdl,嘿嘿,用刚刚正的xfire的client来调用一下试试。
核心调用程序如下:
Client client = new Client(new URL(
"http://localhost:65081/services/EchoUMO?wsdl"));
Object[] results = client.invoke("echo", new Object[] { "hello mule!" });
System.out.println("results:" + results[0]);
}
打印出了hello mule
echo/echo-cxf-config.xml
拷贝了echo-cxf-config.xml后,需要修改axis和cxf里面的 model名称和service名称分别如下:
AXIS: <model name="echoAxis">
<service name="EchoUMOAxis">
CXF: <model name="echoCxf">
<service name="EchoUMOCxf">
修改了以上名字后,Axis的调用的service名字就改为了echoAxis了,需要访问
http://localhost:65081/services/EchoUMOAxis?method=echo¶m=iamcarl
和
http://localhost:65081/services/EchoUMOAxis?wsdl
调用CXF方法不受这个名字的影响,而是在address中决定的,为了看起来统一方便,我将address的名字做了修改,
加上了Cxf的后缀
<cxf:inbound-endpoint address="http://localhost:65082/services/EchoUMOCxf"
serviceClass="com.sillycat.easymule.echo.Echo"/>
那么访问CXF的链接就变为
http://host/service/OPERATION/PARAM_NAME/PARAM_VALUE
http://localhost:65082/services/EchoUMOCxf/echo/text/hello
返回
<soap:Envelope>
<soap:Body>
<ns2:echoResponse>
<text>hello</text>
</ns2:echoResponse>
</soap:Body>
</soap:Envelope>
WSDL文件路径:http://localhost:65082/services/EchoUMOCxf?wsdl,用xfire的client访问一下,发现取不到返回值:(,不过我对cxf也不熟悉。所以这里也不去查找了。
发表评论
-
SOAP AXIS2 with HTTPS
2011-11-24 15:28 4186SOAP AXIS2 with HTTPS 1. sampl ... -
xfire后续问题补充
2010-01-06 14:34 2589xfire后续问题补充 问题一:xfire的方法中,需要知道 ... -
AXIS实现WebService
2010-01-06 11:51 3927AXIS实现WebService webservice里面对 ... -
xfire的webservice安全机制之签名
2010-01-05 23:31 1347xfire的webservice安全机制之签名 服务端配置修 ... -
xfire的webservice安全机制之签名
2010-01-05 23:29 1581xfire的webservice安全机制之签名 服务端配置修 ... -
xfire的webservice安全机制之用户校验
2010-01-05 23:29 2074xfire的webservice安全机制之用户校验 xfir ... -
xfire的webservice安全机制之加密(三)
2010-01-05 23:29 1226如何用KEYTOOL工具生成私匙和公匙 1、通过别名和密码创 ... -
xfire的webservice安全机制之加密(二)
2010-01-05 23:28 2788xfire的webservice安全机制 下面是客户端调用的 ... -
xfire的webservice安全机制之加密(一)
2010-01-05 23:28 2845xfire的webservice安全机制 在原来使用xfir ... -
spring下的webservice之xfire
2010-01-05 23:25 2001http://xfire.codehaus.org/ xfi ... -
Xfire在Weblogic10.3上发布的问题
2010-01-05 10:37 6274Xfire在Weblogic10.3上发布的问题 最近项目的 ... -
xfire的Client的WSDL调用
2010-01-05 10:36 3106xfire的Client的WSDL调用 也只是想测试一下,如 ... -
mule2.2.x架构(七)示例学习LoanBroker
2010-01-05 10:36 1667mule2.2.x架构(七)示例学习LoanBroker 所 ... -
xfire的client的JAVA调用方式
2010-01-05 10:35 3494xfire的client的JAVA调用方式 平时我们调用xf ... -
mule2.2.x架构(六)示例学习scripting
2010-01-05 10:35 1438mule2.2.x架构(六)示例学习scripting 所有 ... -
mule2.2.x架构(五)示例学习errorHandle
2010-01-05 10:34 1628mule2.2.x架构(五)示例学习errorHandle ... -
mule2.2.x架构(四)示例学习StockQuote
2010-01-05 10:34 1842mule2.2.x架构(四)示例学习StockQuote 所 ... -
mule2.2.x架构(三)示例学习hello
2010-01-05 10:34 1832mule2.2.x架构(三)示例学习hello 所有的示例文 ... -
mule2.2.x架构(二)示例学习echo
2010-01-05 10:33 1735mule2.2.x架构(二)示例学习echo 所有的示例文档 ... -
mule2.2.x架构(一)环境搭建
2010-01-05 10:31 2249mule2.2.x架构(一)环境搭建 MULE首页 http ...
相关推荐
自己翻译的Mule 2.x Getting Started Guide的文档,里边很多翻译的不是很好,各位需要的可以下载看一下,内容大多是对Mule进行简单的介绍!
ESB解决方案-mule分享.docxESB解决方案-mule分享.docxESB解决方案-mule分享.docxESB解决方案-mule分享.docxESB解决方案-mule分享.docxESB解决方案-mule分享.docxESB解决方案-mule分享.docxESB解决方案-mule分享.docx
GomPlayer类似于KMplayer,同样也是一款来自韩国播放器,界面精美、功能全面。多媒体播放器GOMPlayer... 以‘查找解码’功能来支持所有视频的播放,在BT或e-mule等P2P网站中下载的影片会经常不能播放,GOM Player以独
Mule讲解.docxMule讲解.docx
包含http、cxf、vm、sap、activeMq、ftp、file、poll、Smtp、attachment、melExpression、Java、template节点的使用示例等。
2) 支持BT或e-mule等P2P站点中接收到损坏的文件, 因中断页传送完成的文件, 索引损坏的AVI文件的播放. 3) 想截取的视频画面可以储存为图像 (JPG, BMP)文件, 还可以通过连续截图取功能来实现把影片的场景以帧为单位, ...
弹性APM Mule3代理介绍此插件允许使用Elastic APM监视Mule 3.x组件的应用程序性能。 它提供了一种非侵入性的方式来度量和基准化Mule中的各个流程和步骤,并添加了对Mule组件的应用程序性能监控,以与日志,指标和...
NULL 博文链接:https://lonely.iteye.com/blog/601103
MULE与ServiceMix的区别的各种摘要
Manning.Mule.in.Action.2nd.Edition.Feb.2014.pdf 第二版 及 源码
Mule2编译指南 博文链接:https://netfly.iteye.com/blog/222123
EIP经典案例Load Broker————Mule ESB实践
The book closes with a set of chapterson the nuts and bolts of working with Mule. Readers can take Mule farther bylearning techniques for testing, performance tuning, BPM orchestration, andeven a ...
Mule ESB应用部署 Mule ESB应用的目录结构,配置文件说明
mule 是java 实现ESB 的开源工程, 让你实现牛X的企业总线, 第2版的事mule in action....
在tomcat中部署mule项目步骤,原文是在mule的官网上,在这里,我做了一个简单的翻译,水平有限,有什么不足的地方,请多多包涵~
。