• 在maven项目中 配置代理对象远程调用crm


    1 maven项目中配置代理对象远程调用crm

    1.1 在项目的pom.xml中引入CXF的依赖

    <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-frontend-jaxws</artifactId>
                <version>3.0.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-transports-http</artifactId>
                <version>3.0.1</version>
            </dependency>

    1.2 使用wsimport命令解析wsdl文件生成本地代码,只需要接口文件和实体类

    命令为:wsimport -s . -p com.javaweb.crm http://ip:port/service/service?wsdl

    其中-p表示命名一个文件包名

    1.3 在spring配置文件中注册crm客户端代理对象

    需要导入约束:

    <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:aop="http://www.springframework.org/schema/aop"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:jaxws="http://cxf.apache.org/jaxws"
        xmlns:soap="http://cxf.apache.org/bindings/soap"
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
                            http://www.springframework.org/schema/beans/spring-beans.xsd
                            http://www.springframework.org/schema/context
                            http://www.springframework.org/schema/context/spring-context.xsd
                            http://www.springframework.org/schema/aop
                            http://www.springframework.org/schema/aop/spring-aop.xsd
                            http://www.springframework.org/schema/tx 
                            http://www.springframework.org/schema/tx/spring-tx.xsd
                            http://cxf.apache.org/bindings/soap 
                            http://cxf.apache.org/schemas/configuration/soap.xsd
                            http://cxf.apache.org/jaxws 
                            http://cxf.apache.org/schemas/jaxws.xsd">
    <!-- 注册crm客户端代理对象 -->
        <jaxws:client id="crmClient" serviceClass="com.javaweb.crm.ICustomerService" address="http://ip:prot/crm_javaweb/service/service" />

    1.4 通过注解方式将代理对象注入action

  • 相关阅读:
    修改Windows和linux系统时间
    个人随笔、收藏——(包括技术、设计思想等)
    给vue项目添加ESLint
    React文档(七)处理事件
    React文档(六)state和生命周期
    React文档(五)组件和props
    React文档(四)渲染元素
    React文档(三)介绍JSX
    React文档(二)Hello World
    React文档(一)安装
  • 原文地址:https://www.cnblogs.com/FanJava/p/9288403.html
Copyright © 2020-2023  润新知