zoukankan      html  css  js  c++  java
  • webService 接口调用配置

    
    

    1。配置XML文件,如果新建一个XML文件需要在applicationContext.xm里面配置一下

        <import resource="cxf-client.xml" />
        <import resource="cxf-hand.xml" />
        <import resource="applicationContext-gxpc.xml" />
    

    2。新建一个XML,xml文件模板如下:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
    	xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
    	xmlns:cxf="http://cxf.apache.org/core"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans 
    	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    	http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd 
    	http://cxf.apache.org/transports/http/configuration 
    	http://cxf.apache.org/schemas/configuration/http-conf.xsd
    	http://cxf.apache.org/core 
    	http://cxf.apache.org/schemas/core.xsd">
    	<!--验证单点登录令牌-->
    	<jaxws:client id="ISSOService" address="http://172.16.7.107:9090/com.kutesmart.esb.ldap.sso?wsdl" 
              serviceClass="com.kutesmart.bl.soap.cxf.ldap.ISSOService"> </jaxws:client> </beans>

    3。上面的xml文件中的 serviceClass ="com.kutesmart.bl.soap.cxf.ldap.ISSOService",需要在此目录下新建的service类,这个类把wsdl2Java转换出来的源文件接口文件ISSOService.java里面的内容需要的复制出来就好,其中

    @XmlSeeAlso({
        ObjectFactory.class
    })
    

      删除就好。

    配置这些地方就可以了,然后在 其他类中new一个ISSOService对象传入相应的参数就可以调用这个webservice接口了。

    这是第一次适用调用web service接口,这只是一个简单的方式,这是我自己弄出来得,肯定还有很多,看起来还是很简单的, 但是对于新手来说,很多东西是不知道,百度都不知道百度什么,希望这篇能帮助到菜鸟们。我也是菜鸟

  • 相关阅读:
    inkscape
    关于英语写作词源方面的。。
    ubuntu上配tensorflow
    腾讯面试指南
    使用traceview进行Android性能测试(转)
    Android CTS 测试总结【转】
    JAVA和C++区别
    接口继承
    vim实现全选功能
    C++异常机制的实现方式和开销分析
  • 原文地址:https://www.cnblogs.com/wushifeng/p/6122266.html
Copyright © 2011-2022 走看看