Java web service 复习

简介:

@WebService(name="AwmsServiceImpl")

public interface AwmsService {

 

 

@WebService(endpointInterface="com.huike.wms.ws.ws4awms.AwmsService")

public class AwmsServiceImpl implements AwmsService {

 

Xml代码   收藏代码
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <!-- <beans xmlns="http://www.springframework.org/schema/beans"  
  3.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"  
  4.     xmlns:jaxws="http://cxf.apache.org/jaxws"  
  5.     xsi:schemaLocation="  
  6.         http://www.springframework.org/schema/beans   
  7.         http://www.springframework.org/schema/beans/spring-beans-2.5.xsd  
  8.         http://cxf.apache.org/jaxws   
  9.         http://cxf.apache.org/schemas/jaxws.xsd"> -->  
  10. <beans xmlns="http://www.springframework.org/schema/beans"    
  11.        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    
  12.        xmlns:aop="http://www.springframework.org/schema/aop"    
  13.        xmlns:context="http://www.springframework.org/schema/context"    
  14.        xmlns:jaxws="http://cxf.apache.org/jaxws"    
  15.        xsi:schemaLocation="http://www.springframework.org/schema/beans   
  16.         http://www.springframework.org/schema/beans/spring-beans-2.5.xsd    
  17.                http://www.springframework.org/schema/aop   
  18.         http://www.springframework.org/schema/aop/spring-aop-2.5.xsd    
  19.                http://www.springframework.org/schema/context   
  20.         http://www.springframework.org/schema/context/spring-context-2.5.xsd    
  21.               http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">  
  22.   
  23.     <import resource="classpath:META-INF/cxf/cxf.xml" />  
  24.     <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />  
  25.     <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />  
  26.   
  27.        
  28.     <bean id="awmsServiceImpl" class="com.huike.wms.ws.ws4awms.AwmsServiceImpl"  
  29.         abstract="false" lazy-init="default" scope="prototype" autowire="default"  
  30.         dependency-check="default">  
  31.         <property name="awmsServices">  
  32.             <ref bean="awmsServices" />  
  33.         </property>  
  34.         <property name="productService">  
  35.             <ref bean="productService" />  
  36.         </property>  
  37.         <property name="resetUserPwService">  
  38.             <ref bean="resetUserPwService" />  
  39.         </property>  
  40.     </bean>  
  41.       
  42.     <jaxws:endpoint id="awmsService" implementor="#awmsServiceImpl"  
  43.         address="/AwmsService" />  
  44.           
  45.           
  46.     <bean id="sortServiceImpl" class="com.huike.wms.ws.ws4sort.SortServiceImpl"  
  47.         abstract="false" lazy-init="default" scope="prototype" autowire="default"  
  48.         dependency-check="default">  
  49.         <property name="sortsService">  
  50.             <ref bean="sortsService" />  
  51.         </property>  
  52.     </bean>  
  53.     <jaxws:endpoint id="sortService" implementor="#sortServiceImpl"  
  54.         address="/SortService" />  
  55.       
  56. </beans>  

 

 

web.xml

Xml代码   收藏代码
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <web-app version="2.5"   
  3. xmlns="http://java.sun.com/xml/ns/javaee"   
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   
  5. xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   
  6. http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">  
  7.   
  8.     <display-name>Struts 2.1.6</display-name>  
  9.     <!-- zh-cn encoding -->  
  10.     <filter>  
  11.         <filter-name>encodeFilter</filter-name>  
  12.         <filter-class>com.huike.hidp.util.EncodeFilter</filter-class>  
  13.         <init-param>  
  14.             <param-name>encode</param-name>  
  15.             <param-value>utf-8</param-value>  
  16.         </init-param>  
  17.     </filter>  
  18.     <!-- 字符编码映射 -->  
  19.     <filter-mapping>  
  20.         <filter-name>encodeFilter</filter-name>  
  21.         <url-pattern>/* </url-pattern>  
  22.     </filter-mapping>  
  23.     <!-- session超时定义,单位为分钟 --> <!-- 配置session时间  设置监听用来记录登陆人员的数量  Start -->  
  24.     <session-config>  
  25.         <session-timeout>780</session-timeout>  
  26.     </session-config>  
  27.     <listener>  
  28.         <listener-class>com.huike.hidp.util.listener.OnlineCounterListener</listener-class>  
  29.     </listener>  
  30.     <!-- End -->  
  31.     <!-- 配置sturts2的 -->  
  32.     <!-- 由于fckeditor上传文件重写了Struts2的FilterDispatcher -->  
  33.     <filter>  
  34.         <filter-name>struts2</filter-name>  
  35.         <filter-class>com.huike.hidp.util.filter.MyStrutsFilterDispatcher</filter-class>  
  36.         <init-param>  
  37.             <param-name>config</param-name>  
  38.             <param-value>struts-default.xml,struts-plugin.xml,  
  39.             ../xml/hidp/struts-admin.xml,../xml/hidp/struts-message.xml,  
  40.             ../xml/hidp/struts-privilege.xml,../xml/hidp/struts-organization.xml,  
  41.             ../xml/hidp/struts-address.xml,../xml/wms/inwarehouse/struts-inwarehouse.xml,  
  42.             ../xml/wms/sortinfo/struts-sortinfo.xml,../xml/wms/outwarehouse/struts-outwarehouse.xml,../xml/wms/atwarehouse/struts-atwarehouse.xml,  
  43.             ../xml/wms/compositequery/struts-compositequery.xml,../xml/wms/baseinfo/struts-baseinfo.xml,../xml/wms/system/struts-system.xml,  
  44.             ../xml/wms/interfacemanage/struts-interfacemanage.xml,../xml/wms/stockmanage/struts-stockmanage.xml</param-value> <!--,../xml/wms/ws/struts-ws.xml-->  
  45.         </init-param>  
  46.     </filter>  
  47.     <!-- <filter-mapping>  
  48.         <filter-name>struts2</filter-name>  
  49.         <url-pattern>/*</url-pattern>  
  50.     </filter-mapping> -->  
  51.     <!-- 配置系统启动页 -->  
  52.     <welcome-file-list>  
  53.         <welcome-file>/index.jsp</welcome-file>  
  54.     </welcome-file-list>  
  55.     <!--Start配置过滤文件用以限制手动输入jsp路径  -->  
  56.     <filter>  
  57.         <filter-name>dispatcherFilter</filter-name>  
  58. <!--     <filter-class>com.huike.hidp.util.listener.DispatcherFilter</filter-class>-->  
  59.         <filter-class> com.huike.wms.util.DispatcherFilter</filter-class>  
  60.     </filter>  
  61.     <filter-mapping>  
  62.         <filter-name>dispatcherFilter</filter-name>  
  63.         <url-pattern>/*</url-pattern>  
  64.     </filter-mapping>  
  65.     <!--End  -->  
  66.     <!-- 配置监听 由spring来管理 -->  
  67.     <context-param>  
  68.         <param-name>contextConfigLocation</param-name>  
  69.         <param-value>/WEB-INF/xml/hidp/applicationContext*.xml,/WEB-INF/xml/wms/*/applicationContext*.xml,/WEB-INF/xml/wms/ws/interface*.xml</param-value><!--,/WEB-INF/xml/wms/*/interface*.xml-->  
  70.     </context-param>  
  71.     <filter-mapping>  
  72.         <filter-name>struts2</filter-name>  
  73.         <url-pattern>/homePageToLeft/*</url-pattern><url-pattern>/homePageToMainTop/*</url-pattern><url-pattern>/homePageToMainTop!setDesktopSetup</url-pattern><url-pattern>/homePageToRight/*</url-pattern><url-pattern>/homePageToRight!toMenuList</url-pattern><url-pattern>/exitAction</url-pattern><url-pattern>*.jsp</url-pattern> <url-pattern>/action/*</url-pattern><url-pattern>/struts/*</url-pattern><url-pattern>/innersmleft</url-pattern><url-pattern>/innersmmain</url-pattern><url-pattern>/phsysman/*</url-pattern><url-pattern>/log/*</url-pattern><url-pattern>/mail/*</url-pattern><url-pattern>/system/*</url-pattern><url-pattern>/tobacco_wms/*</url-pattern><url-pattern>/privilege/*</url-pattern><url-pattern>/address/*</url-pattern><url-pattern>/message/*</url-pattern><url-pattern>/organization/*</url-pattern><url-pattern>/wfmgr/*</url-pattern>  
  74.     </filter-mapping>  
  75.     <listener>  
  76.         <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>  
  77.     </listener>  
  78.     <!-- fckeditor上传文件 -->  
  79.     <servlet>  
  80.         <servlet-name>Connector</servlet-name>  
  81.         <servlet-class>com.huike.hidp.util.servlet.ConnectorServlet</servlet-class>  
  82.         <load-on-startup>1</load-on-startup>  
  83.     </servlet>  
  84.     <servlet-mapping>  
  85.         <servlet-name>Connector</servlet-name>  
  86.         <url-pattern>/fckeditor/editor/filemanager/connectors/*</url-pattern>  
  87.     </servlet-mapping>  
  88.     <!--End  -->  
  89.     <filter>  
  90.         <filter-name>SetCharacterEncoding</filter-name>  
  91.         <filter-class>com.huike.wms.util.SetCharacterEncodingFilter</filter-class>  
  92.         <init-param>  
  93.             <param-name>encoding</param-name>  
  94.             <param-value>UTF-8</param-value>  
  95.         </init-param>  
  96.         <init-param>  
  97.             <param-name>enable</param-name>  
  98.             <param-value>true</param-value>  
  99.         </init-param>  
  100.     </filter>  
  101.     <servlet>  
  102.         <servlet-name>CXFServlet</servlet-name>  
  103.         <servlet-class>  
  104.             org.apache.cxf.transport.servlet.CXFServlet  
  105.         </servlet-class>  
  106.         <load-on-startup>1</load-on-startup>  
  107.     </servlet>  
  108.     <servlet-mapping>  
  109.         <servlet-name>CXFServlet</servlet-name>  
  110.         <url-pattern>/services/*</url-pattern>  
  111.     </servlet-mapping>  
  112.     <servlet>  
  113.         <servlet-name>EngineServlet</servlet-name>  
  114.         <servlet-class>org.eclipse.birt.report.servlet.BirtEngineServlet</servlet-class>  
  115.     </servlet>  
  116.     <servlet-mapping>  
  117.         <servlet-name>EngineServlet</servlet-name>  
  118.         <url-pattern>/preview</url-pattern>  
  119.     </servlet-mapping>  
  120.     <servlet-mapping>  
  121.         <servlet-name>EngineServlet</servlet-name>  
  122.         <url-pattern>/download</url-pattern>  
  123.     </servlet-mapping>  
  124.     <servlet-mapping>  
  125.         <servlet-name>EngineServlet</servlet-name>  
  126.         <url-pattern>/parameter</url-pattern>  
  127.     </servlet-mapping>      
  128.     <servlet-mapping>  
  129.         <servlet-name>EngineServlet</servlet-name>  
  130.         <url-pattern>/document</url-pattern>  
  131.     </servlet-mapping>      
  132.     <servlet-mapping>  
  133.         <servlet-name>EngineServlet</servlet-name>  
  134.         <url-pattern>/output</url-pattern>  
  135.     </servlet-mapping>      
  136.     <servlet-mapping>  
  137.         <servlet-name>EngineServlet</servlet-name>  
  138.         <url-pattern>/extract</url-pattern>  
  139.     </servlet-mapping>  
  140.     <servlet>  
  141.         <servlet-name>entryBillReport</servlet-name>  
  142.         <servlet-class>com.huike.wms.report.entryservlet.EntrySeatReport</servlet-class>  
  143.     </servlet>  
  144.     <servlet-mapping>  
  145.         <servlet-name>entryBillReport</servlet-name>  
  146.         <url-pattern>/report/entryBillReport</url-pattern>  
  147.     </servlet-mapping>  
  148.     <servlet>  
  149.         <servlet-name>deliveryBillReport</servlet-name>  
  150.         <servlet-class>com.huike.wms.report.deliveryservlet.DeliverySeatReport</servlet-class>  
  151.     </servlet>  
  152.     <servlet-mapping>  
  153.         <servlet-name>deliveryBillReport</servlet-name>  
  154.         <url-pattern>/report/deliveryBillReport</url-pattern>  
  155.     </servlet-mapping>  
  156.     <servlet>  
  157.         <servlet-name>abnorReport</servlet-name>  
  158.         <servlet-class>com.huike.wms.report.abnorservlet.AbnorReport</servlet-class>  
  159.     </servlet>  
  160.     <servlet-mapping>  
  161.         <servlet-name>abnorReport</servlet-name>  
  162.         <url-pattern>/report/abnorReport</url-pattern>  
  163.     </servlet-mapping>  
  164.     <servlet>  
  165.         <servlet-name>abnorByTaskCodeReport</servlet-name>  
  166.         <servlet-class>com.huike.wms.report.abnorservlet.AbnorByTaskCodeReport</servlet-class>  
  167.     </servlet>  
  168.     <servlet-mapping>  
  169.         <servlet-name>abnorByTaskCodeReport</servlet-name>  
  170.         <url-pattern>/report/abnorByTaskCodeReport</url-pattern>  
  171.     </servlet-mapping>  
  172.     <servlet>  
  173.         <servlet-name>moveBillReport</servlet-name>  
  174.         <servlet-class>com.huike.wms.report.movebillservlet.MoveBillReport</servlet-class>  
  175.     </servlet>  
  176.     <servlet-mapping>  
  177.         <servlet-name>moveBillReport</servlet-name>  
  178.         <url-pattern>/report/moveBillReport</url-pattern>  
  179.     </servlet-mapping>  
  180.     <servlet>  
  181.         <servlet-name>productReport</servlet-name>  
  182.         <servlet-class>com.huike.wms.report.productservlet.ProductReport</servlet-class>  
  183.     </servlet>  
  184.     <servlet-mapping>  
  185.         <servlet-name>productReport</servlet-name>  
  186.         <url-pattern>/report/productReport</url-pattern>  
  187.     </servlet-mapping>  
  188.     <servlet>  
  189.         <servlet-name>productDailyReport</servlet-name>  
  190.         <servlet-class>com.huike.wms.report.productservlet.ProductDailyReport</servlet-class>  
  191.     </servlet>  
  192.     <servlet-mapping>  
  193.         <servlet-name>productDailyReport</servlet-name>  
  194.         <url-pattern>/report/productDailyReport</url-pattern>  
  195.     </servlet-mapping>  
  196.     <servlet>  
  197.         <servlet-name>clearStockReport</servlet-name>  
  198.         <servlet-class>com.huike.wms.report.sortservlet.ClearStockReport</servlet-class>  
  199.     </servlet>  
  200.     <servlet-mapping>  
  201.         <servlet-name>clearStockReport</servlet-name>  
  202.         <url-pattern>/report/clearStockReport</url-pattern>  
  203.     </servlet-mapping>  
  204.     <servlet>  
  205.         <servlet-name>sortVwDeliveryReport</servlet-name>  
  206.         <servlet-class>com.huike.wms.report.sortservlet.SortVwDeliveryReport</servlet-class>  
  207.     </servlet>  
  208.     <servlet-mapping>  
  209.         <servlet-name>sortVwDeliveryReport</servlet-name>  
  210.         <url-pattern>/report/sortVwDeliveryReport</url-pattern>  
  211.     </servlet-mapping>  
  212.     <servlet>  
  213.         <servlet-name>productQtyReport</servlet-name>  
  214.         <servlet-class>com.huike.wms.report.productservlet.ProductQtyReport</servlet-class>  
  215.     </servlet>  
  216.     <servlet-mapping>  
  217.         <servlet-name>productQtyReport</servlet-name>  
  218.         <url-pattern>/report/productQtyReport</url-pattern>  
  219.     </servlet-mapping>  
  220.     <servlet>  
  221.         <servlet-name>preStockReport</servlet-name>  
  222.         <servlet-class>com.huike.wms.report.prestockservlet.PreStockReport</servlet-class>  
  223.     </servlet>  
  224.     <servlet-mapping>  
  225.         <servlet-name>preStockReport</servlet-name>  
  226.         <url-pattern>/report/preStockReport</url-pattern>  
  227.     </servlet-mapping>  
  228. </web-app>  

 

相关文章
|
19天前
|
Java Maven Spring
Java Web 应用中,资源文件的位置和加载方式
在Java Web应用中,资源文件如配置文件、静态文件等通常放置在特定目录下,如WEB-INF或classes。通过类加载器或Servlet上下文路径可实现资源的加载与访问。正确管理资源位置与加载方式对应用的稳定性和可维护性至关重要。
|
22天前
|
存储 安全 搜索推荐
理解Session和Cookie:Java Web开发中的用户状态管理
理解Session和Cookie:Java Web开发中的用户状态管理
46 4
|
28天前
【Azure App Service】PowerShell脚本批量添加IP地址到Web App允许访问IP列表中
Web App取消公网访问后,只允许特定IP能访问Web App。需要写一下段PowerShell脚本,批量添加IP到Web App的允许访问IP列表里!
|
2月前
|
Java 程序员 测试技术
Java|让 JUnit4 测试类自动注入 logger 和被测 Service
本文介绍如何通过自定义 IDEA 的 JUnit4 Test Class 模板,实现生成测试类时自动注入 logger 和被测 Service。
24 5
|
21天前
|
Java 持续交付 项目管理
使用Maven进行项目管理:提高Java Web开发的效率
Maven 是一款强大的项目管理和构建自动化工具,广泛应用于Java社区。它通过依赖管理、构建生命周期管理、插件机制和多模块项目支持等功能,简化了项目的构建过程,提高了开发效率。本文将介绍Maven的核心功能及其在Java Web开发中的应用。
48 0
WK
|
27天前
|
安全 Java 编译器
C++和Java哪个更适合开发web网站
在Web开发领域,C++和Java各具优势。C++以其高性能、低级控制和跨平台性著称,适用于需要高吞吐量和低延迟的场景,如实时交易系统和在线游戏服务器。Java则凭借其跨平台性、丰富的生态系统和强大的安全性,广泛应用于企业级Web开发,如企业管理系统和电子商务平台。选择时需根据项目需求和技术储备综合考虑。
WK
47 0
|
2月前
|
前端开发 Java API
JAVA Web 服务及底层框架原理
【10月更文挑战第1天】Java Web 服务是基于 Java 编程语言用于开发分布式网络应用程序的一种技术。它通常运行在 Web 服务器上,并通过 HTTP 协议与客户端进行通信。
26 1
|
2月前
|
Java 数据库
基于java的汽车服务管理系统(Car Service Management System)
基于java的汽车服务管理系统(Car Service Management System)
22 0
|
3月前
|
数据采集 Java 数据挖掘
Java IO异常处理:在Web爬虫开发中的实践
Java IO异常处理:在Web爬虫开发中的实践
|
4月前
|
存储 缓存 前端开发
Servlet与JSP在Java Web应用中的性能调优策略
Servlet与JSP在Java Web应用中的性能调优策略
35 1