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接口,这只是一个简单的方式,这是我自己弄出来得,肯定还有很多,看起来还是很简单的, 但是对于新手来说,很多东西是不知道,百度都不知道百度什么,希望这篇能帮助到菜鸟们。我也是菜鸟

  • 相关阅读:
    创建文本编辑输入框1:
    表likp新增第一次过账输入日期字段,vl02n/vl01n/vl03n/vl06o的增强
    如何获得控件的属性
    使用OVS
    【Vue】安装(NPM 方法)
    【Webpack】学习随笔
    【node】安装
    【CSS-flex】圣杯布局(Holy Grail Layout)、输入框的布局、悬挂式布局、固定的底栏
    【CSS】关于flex
    解决MySQL新建用户后无法登录问题
  • 原文地址:https://www.cnblogs.com/wushifeng/p/6122266.html
Copyright © 2011-2022 走看看