spring-ws的使用
来源:互联网 发布:数据三国 编辑:程序博客网 时间:2024/06/05 02:50
原文来源 http://download.csdn.net/download/xiezhipu/8043933
业务接口
public interface HumanResourceService {
void bookHoliday(Date startDate, Date endDate, String name);
}
业务接口实现
@Service
public class StubHumanResourceService implements HumanResourceService {
public void bookHoliday(Date startDate, Date endDate, String name) {
System.out.println("Booking holiday for [" + startDate + "-" + endDate + "] for [" + name + "] ");
}
}
webservice 配置文件
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:sws="http://www.springframework.org/schema/web-services"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan base-package="com.mycompany.hr"/>
<sws:annotation-driven/>
<sws:dynamic-wsdl id="holiday"
portTypeName="HumanResource"
locationUri="/holidayService/"
targetNamespace="http://mycompany.com/hr/definitions">
<sws:xsd location="/WEB-INF/hr.xsd"/>
</sws:dynamic-wsdl>
</beans>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>spring-ws</servlet-name>
<servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
<init-param>
<param-name>transformWsdlLocations</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>spring-ws</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
报文声明
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:hr="http://mycompany.com/hr/schemas"
elementFormDefault="qualified"
targetNamespace="http://mycompany.com/hr/schemas">
<xs:element name="HolidayRequest">
<xs:complexType>
<xs:all>
<xs:element name="Holiday" type="hr:HolidayType"/>
<xs:element name="Employee" type="hr:EmployeeType"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:complexType name="HolidayType">
<xs:sequence>
<xs:element name="StartDate" type="xs:date"/>
<xs:element name="EndDate" type="xs:date"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="EmployeeType">
<xs:sequence>
<xs:element name="Number" type="xs:integer"/>
<xs:element name="FirstName" type="xs:string"/>
<xs:element name="LastName" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema
- spring-ws的使用
- 使用spring-ws开发webservice
- 使用spring-ws开发webservice
- 使用Spring WS 2.0开发基于SOAP的web service
- 在websphere上使用spring-ws
- spring-ws中使用xmlbeans记录
- spring-ws 使用mtom传输附件
- spring-ws
- JAX-WS 的简单使用
- javax.ws.rs 创建 restful 服务 与 使用 spring框架创建的 restful的区别
- cxf + spring 的WS-Security示例
- cxf + spring 的WS-Security示例
- Spring-ws提供SOAP服务的注意事项
- 利用myeclipse8.5 将使用spring配置的原工程用JAX-WS发布为webservice
- 使用jax-ws和spring创建和web容器共端口的webservice服务
- Eclipse使用Axis2,spring开发jax-ws(webservice)的配置讲解
- 编写一个使用WS-Security的WebMethod
- WS-Notification的使用---来自阿红
- TCPIP: IPv4分类
- Binary Tree Zigzag Level Order Traversal
- TCPIP: IP报头
- 解决Linux系统忘记root密码的方法+linux搭载ftp服务器方法
- 心情
- spring-ws的使用
- ffmpeg 总结
- leetcode Number of 1 Bits
- Java基础---Object类、内部类
- URAL - 1823 Ideal Gas(审题)
- 排列组合。
- 2015/4/21 深入理解Android卷I:第3章:深入理解init
- java的(PO,VO,TO,BO,DAO,POJO)解释
- 30 31 php phpexcel学习