zoukankan      html  css  js  c++  java
  • webservice--知识点

    webservice

    <!-- begin XFire 配置 -->
        <servlet>
            <servlet-name>xfire</servlet-name>
            <servlet-class>
                org.springframework.web.servlet.DispatcherServlet
            </servlet-class>
            <init-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>/WEB-INF/classes/conf/xfire/xfire-servlet.xml</param-value>
            </init-param>
        </servlet>
        <servlet-mapping>
            <servlet-name>xfire</servlet-name>
            <url-pattern>*.ws</url-pattern>
        </servlet-mapping>
        <!-- end XFire 配置 -->

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans><!-- 引入XFire预配置信息 -->
        <import resource="classpath:org/codehaus/xfire/spring/xfire.xml" />
        <bean id="baseWebService"
            class="org.codehaus.xfire.spring.remoting.XFireExporter"
            lazy-init="false" abstract="true">
            <!-- 引用xfire.xml中定义的工厂 -->
            <property name="serviceFactory"   ref="xfire.serviceFactory" />
            <!-- 引用xfire.xml中的xfire实例 -->
            <property name="xfire" ref="xfire" />
        </bean>
        <!-- 定义访问发送数据的服务 -->
        <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
            <property name="urlMap">
                <map>
               
                   
                    <entry key="/jptMobileAttachment.ws">
                        <ref bean="JptMobileAttachmentService" />
                    </entry>
                  
                </map>
            </property>
        </bean>
       
        <bean id="JptMobileAttachmentService" parent="baseWebService">
            <!-- 业务服务bean -->
            <property name="serviceBean" ref="jptMobileAttachmentWSService" />
            <!-- 业务服务bean的窄接口类 -->
            <property name="serviceClass" value="com.attachment.webservice.IAttachmentWebService" />
        </bean>

    </beans>

    客户端调用

    Service ser = new ObjectServiceFactory().create(IJsoMobileEmailWSService.class);
                    XFireProxyFactory xFactory = new XFireProxyFactory(XFireFactory.newInstance().getXFire());
                    // ms与服务器端交互复杂对象类型
                    IJsoMobileEmailWSService ms = (IJsoMobileEmailWSService) xFactory.create(ser, url);
                    String message = ms.sendEmailAndFTPfile(obj.toString());

    整合spring

    org.codehaus.xfire.spring.XFireSpringServlet

    https://www.cnblogs.com/zhangrumingbj/p/3884753.html

  • 相关阅读:
    4-(基础入门篇)学会刷Wi-Fi模块固件(刷AT指令固件)
    关于后期文章
    11-51单片机ESP8266学习-AT指令(ESP8266作为TCP客户端,连接TCP服务器,用串口调试助手和手机TCP调试助手测试)
    关于单双向晶闸管的控制电路
    3-(基础入门篇)稍微了解一下(需要知道的关于Lua的一些基本的知识)
    2-(基础入门篇)Air202下载开发入门(给Air202下载第一个程序)
    1-51单片机开发板介绍(所讲内容,功能介绍)
    2-关于单片机通信数据传输(中断接收,大小端,IEEE754浮点型格式,共用体,空闲中断,环形队列)
    1-STM32物联网开发WIFI+GPRS(Wi-Fi入门篇)_简介
    unbuntu下安装qq
  • 原文地址:https://www.cnblogs.com/jentary/p/11459803.html
Copyright © 2011-2022 走看看