【Web Service】Apache Tuscany发布SOAP
2013-01-18 11:17
225 查看
Apache Tuscany
地址:http://tuscany.apache.org
准备工作:
>下载SCA-Java-2.0包
地址:http://tuscany.apache.org/sca-java-2x-releases.html
选择相应系统下Binary类型的包,解压缩
>添加jar包
添加tuscany/lib目录下,以下3个jar包:
tuscany-base-runtime-aggregation-2.0.jar
tuscany-binding-ws-runtime-axis2-aggregation-2.0.jar
tuscany-sca-api-2.0.jar
1、编辑web.xml文件
添加URL过滤
2、新建Service接口文件
标记interface @Remotable
定义服务开放的方法
3、新建Service接口实现类
4、新建.composite配置文件
定义组件(<component>)helloworld,实现类(<implementation.java>)为“com.example.service.impl.HelloWorldServiceImpl”
定义服务(<service>),名为“IHelloWorldService”,绑定web service(<blinding.ws>)
测试:
http://localhost:8080/HelloWorldServer/helloworld/IHelloWorldService?wsdl
地址:http://tuscany.apache.org
准备工作:
>下载SCA-Java-2.0包
地址:http://tuscany.apache.org/sca-java-2x-releases.html
选择相应系统下Binary类型的包,解压缩
>添加jar包
添加tuscany/lib目录下,以下3个jar包:
tuscany-base-runtime-aggregation-2.0.jar
tuscany-binding-ws-runtime-axis2-aggregation-2.0.jar
tuscany-sca-api-2.0.jar
1、编辑web.xml文件
添加URL过滤
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>SOAPServer</display-name> <filter> <filter-name>tuscany</filter-name> <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class> </filter> <filter-mapping> <filter-name>tuscany</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>
2、新建Service接口文件
标记interface @Remotable
定义服务开放的方法
package com.example.service; import org.oasisopen.sca.annotation.Remotable; @Remotable public interface IHelloWorldService { public String say(String from); }
3、新建Service接口实现类
package com.example.service.impl; import com.example.service.IHelloWorldService; public class HelloWorldServiceImpl implements IHelloWorldService { @Override public String say(String from) { return "Hello, " + from; } }
4、新建.composite配置文件
定义组件(<component>)helloworld,实现类(<implementation.java>)为“com.example.service.impl.HelloWorldServiceImpl”
定义服务(<service>),名为“IHelloWorldService”,绑定web service(<blinding.ws>)
<?xml version="1.0" encoding="UTF-8"?> <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" targetNamespace="http://service.example.com" name="helloworld"> <component name="helloworld"> <implementation.java class="com.example.service.impl.HelloWorldServiceImpl"/> <service name="IHelloWorldService"> <binding.ws/> </service> </component> </composite>
测试:
http://localhost:8080/HelloWorldServer/helloworld/IHelloWorldService?wsdl
相关文章推荐
- 【Web Service】Apache Tuscany发布SOAP
- Web Service两种发布协议--SOAP和REST的区别
- 通过Web Service调用Google SOAP Search API
- C#使用SOAP调用Web Service
- Web Service(SOAP)和HTTP接口的区别
- Java RPC通信机制之SOAP:应用Apache Axis进行Web Service开发
- 利用PHP SOAP实现WEB SERVICE
- GAE + RESTEasy搭建Web Service---服务端编码与发布
- Java RPC 通信机制之 SOAP:应用 Apache Axis进行 Web Service开发
- 编写以及发布soap服务
- SSH整合cxf 发布web Service
- Apache CXF实战之九 发布使用SSL的Web Service .
- WebService两种发布协议--SOAP和REST的区别
- 【REST && SOAP】REST和SOAP Web Service的区别比较
- zend_soap 实现 web service 用户验证
- (转)Web Service之SOAP ,WSDL 和UDDI
- 使用TcpTrace小工具截获Web Service的SOAP报文
- 啥是web service 和soap?
- Web Service系列之实例之使用urllib发送SOAP POST请求
- SOA技术相关介绍(RPC, Web Service, REST,SOAP,JMI)