WEB开发网
开发学院软件开发Java 全方位解析 Web Services 开发步骤 阅读

全方位解析 Web Services 开发步骤

 2010-08-09 00:00:00 来源:WEB开发网   
核心提示: <?xmlversion="1.0"encoding="UTF-8"?><!--STARTSNIPPET:beans--><beansxmlns="http://www.springframework.org/sch

 <?xml version="1.0" encoding="UTF-8"?> 
 <!-- START SNIPPET: beans --> 
 <beans xmlns="http://www.springframework.org/schema/beans" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns:jaxws="http://cxf.apache.org/jaxws" 
 xsi:schemaLocation=" 
 http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans.xsd 
 http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 
 <import resource="classpath:META-INF/cxf/cxf.xml" /> 
 <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> 
 <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> 
 <jaxws:endpoint id="springService" 
  implementor="org.ibm.spring.service.impl.SpringServiceImpl" 
  address="/SpringService" /> 
 </beans> 

这个 beans.xml 文件是 spring 必须的,注意其中的 address="/SpringService",我们就是通过这个地址访问 service 的,通过 implementor 指定具体的实现 Bean, 是不是很简单。

 <?xml version="1.0" encoding="ISO-8859-1"?> 
 <!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> 
 <context-param> 
  <param-name>contextConfigLocation</param-name> 
  <param-value>WEB-INF/beans.xml</param-value> 
 </context-param> 
 <listener> 
  <listener-class> 
  org.springframework.web.context.ContextLoaderListener 
  </listener-class> 
 </listener> 
 <servlet> 
  <servlet-name>CXFServlet</servlet-name> 
  <display-name>CXF Servlet</display-name> 
  <servlet-class> 
  org.apache.cxf.transport.servlet.CXFServlet 
  </servlet-class> 
  <load-on-startup>1</load-on-startup> 
 </servlet> 
 <servlet-mapping> 
  <servlet-name>CXFServlet</servlet-name> 
  <url-pattern>/*</url-pattern> 
 </servlet-mapping> 
 </web-app> 

上一页  1 2 3 4 5 6 7 8 9 10  下一页

Tags:全方位 解析 Web

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接