mule2.2.x架构(2)示例学习echo
mule2.2.x架构(二)示例学习echo
mule2.2.x架构(二)示例学习echo
所有的示例文档
http://www.mulesoft.org/display/MULE2INTRO/Examples
1.简单示例echo
1.1 简单的输入和打印信息
主要分析了配置文件echo-config.xml
<stdio:connector name="SystemStreamConnector"
promptMessage="Please enter something: " messageDelayTime="1000" />
<model name="echoSample">
<service name="EchoUMO">
<!-- 系统输入 -->
<inbound>
<stdio:inbound-endpoint system="IN" />
</inbound>
<echo-component />
<!-- 系统输出 -->
<outbound>
<pass-through-router>
<stdio:outbound-endpoint system="OUT" />
</pass-through-router>
</outbound>
</service>
</model>
其中的<echo-component />是
<service name="EchoUMO">
<component class="org.mule.component.simple.EchoComponent"/>
</service>
的缩写。EchoComponent实现了日志功能。
1.2 axis的webserice服务
分析配置文件echo-axis-config.xml
<model name="echoSample">
<service name="EchoUMO">
<inbound>
<axis:inbound-endpoint address="http://localhost:65081/services">
<soap:http-to-soap-request-transformer/>
</axis:inbound-endpoint>
</inbound>
<echo-component/>
</service>
</model>
访问URL
http://localhost:65081/services/EchoUMO?method=echo¶m=iamcarl
访问WSDL文件
http://localhost:65081/services/EchoUMO?wsdl
1.3 cxf的webservice服务
<service name="EchoUMO">
<inbound>
<cxf:inbound-endpoint address="http://localhost:65082/services/EchoUMO" serviceClass="com.sillycat.easymule.echo.Echo"/>
</inbound>
、 <echo-component/>
</service>
其中com.sillycat.easymule.echo.Echo是从example中拷贝出来的一个接口定义。
package com.sillycat.easymule.echo;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
@WebService
public interface Echo {
@WebResult(name = "text")
public String echo(@WebParam(name = "text") String string);
}
访问服务的参数是:
http://host/service/OPERATION/PARAM_NAME/PARAM_VALUE
http://localhost:65082/services/EchoUMO/echo/text/hello
访问WSDL文件:
http://localhost:65082/services/EchoUMO?wsdl
就是简单的把example拷贝出来了。
mule2.2.x架构(二)示例学习echo
所有的示例文档
http://www.mulesoft.org/display/MULE2INTRO/Examples
1.简单示例echo
1.1 简单的输入和打印信息
主要分析了配置文件echo-config.xml
<stdio:connector name="SystemStreamConnector"
promptMessage="Please enter something: " messageDelayTime="1000" />
<model name="echoSample">
<service name="EchoUMO">
<!-- 系统输入 -->
<inbound>
<stdio:inbound-endpoint system="IN" />
</inbound>
<echo-component />
<!-- 系统输出 -->
<outbound>
<pass-through-router>
<stdio:outbound-endpoint system="OUT" />
</pass-through-router>
</outbound>
</service>
</model>
其中的<echo-component />是
<service name="EchoUMO">
<component class="org.mule.component.simple.EchoComponent"/>
</service>
的缩写。EchoComponent实现了日志功能。
1.2 axis的webserice服务
分析配置文件echo-axis-config.xml
<model name="echoSample">
<service name="EchoUMO">
<inbound>
<axis:inbound-endpoint address="http://localhost:65081/services">
<soap:http-to-soap-request-transformer/>
</axis:inbound-endpoint>
</inbound>
<echo-component/>
</service>
</model>
访问URL
http://localhost:65081/services/EchoUMO?method=echo¶m=iamcarl
访问WSDL文件
http://localhost:65081/services/EchoUMO?wsdl
1.3 cxf的webservice服务
<service name="EchoUMO">
<inbound>
<cxf:inbound-endpoint address="http://localhost:65082/services/EchoUMO" serviceClass="com.sillycat.easymule.echo.Echo"/>
</inbound>
、 <echo-component/>
</service>
其中com.sillycat.easymule.echo.Echo是从example中拷贝出来的一个接口定义。
package com.sillycat.easymule.echo;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
@WebService
public interface Echo {
@WebResult(name = "text")
public String echo(@WebParam(name = "text") String string);
}
访问服务的参数是:
http://host/service/OPERATION/PARAM_NAME/PARAM_VALUE
http://localhost:65082/services/EchoUMO/echo/text/hello
访问WSDL文件:
http://localhost:65082/services/EchoUMO?wsdl
就是简单的把example拷贝出来了。