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

  • 相关阅读:
    网页 js 获取DPI pxTomm
    利用自定义属性实现js点击事件 委托
    鼠标移动div时禁止选中div中的文字的方法
    关于if简写语句优化的方法
    .clearfix::after(清除浮动)
    js 事件委托
    清空共享池
    oracle中scott用户权限不足
    安装完Oracle 12C数据库,scott账户过期,解锁方法
    Vulnhub靶场-Me Tomcat Host 学习笔记
  • 原文地址:https://www.cnblogs.com/jentary/p/11459803.html
Copyright © 2011-2022 走看看