idea+maven+spring+cxf创建webservice应用(二)生成客户端程序

时间:2022-03-04 20:24:05
  • idea+maven+spring+cxf创建webservice应用(二)生成客户端程序,以上一篇为基础"idea+maven+spring+cxf创建webservice应用"

  1. idea+maven+spring+cxf创建webservice客户端应用:和创建服务器端工程一样,如有疑问请查看上一篇《idea+maven+spring+cxf创建webservice应用》

  idea+maven+spring+cxf创建webservice应用(二)生成客户端程序

  创建好后的目录框架:添加了java和test相关目录。

  idea+maven+spring+cxf创建webservice应用(二)生成客户端程序

  2.生成webservice客户端代码:选中main下面的java目录,点击右键找到webService-》generate java code Wsdl...

  idea+maven+spring+cxf创建webservice应用(二)生成客户端程序

  2.1:然后点击进入设置界面:

  idea+maven+spring+cxf创建webservice应用(二)生成客户端程序

  2.2:设置好后点击OK:生成客户当代码,将不必要的class文件删除,删除后的目录结构如下,其中test目录下的code和配置文件是自己添加的。

  idea+maven+spring+cxf创建webservice应用(二)生成客户端程序

  3.编码联调客户端访问服务器代码(我们这里只看单元测试的代码):在test目录下编码,同前一篇样编写BaseJunit4Test类和TestBankTransaction类

  3.1:pom.xml配置文件有所变动,添加了后续肯能用到的依赖

  

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.xzh.gdsbc_wcxf_client</groupId>
<artifactId>gdsbc_wcxf_client</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>gdsbc_wcxf_client Maven Webapp</name>
<url>http://maven.apache.org</url>
<!-- ##########依赖属性参数配置 start############### -->
<properties>
<junit.version>4.11</junit.version>
<cxf.version>2.2.3</cxf.version>
<spring.version>3.2.3.RELEASE</spring.version>
<slf4j.version>1.7.7</slf4j.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!-- ##########依赖属性参数配置 end############### --> <dependencies>
<!-- 单元测试依赖包 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency> <!-- CXF Dependencies -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<!-- Jetty is needed if you're are not using the CXFServlet -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
</dependency>
<!-- End of CXF Dependencies --> <!-- Spring Dependencies ${spring.version} -->
<!--Spring核心相关-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
</dependency> <!--SpringMVC相关-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency> <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!--Spring数据库相关-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency> <!--MyBatis相关-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.8</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.3</version>
</dependency> <!--数据库相关-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.35</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.4.2</version>
</dependency> <!--Servlet相关-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency> <!--测试相关-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency> <!--Json处理-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.12</version>
</dependency> <dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency> <!--七牛云文件上传-->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>com.qiniu</groupId>
<artifactId>qiniu-java-sdk</artifactId>
<version>7.2.0</version>
</dependency> <!--邮件发送-->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency> <!-- 日志处理 -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies> <build>
<plugins>
<!--tomcat插件-->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
</plugin> <!--编码配置-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<encoding>utf-8</encoding>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin> <!--编码配置-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<forkMode>once</forkMode>
<argLine>-Dfile.encoding=UTF-8</argLine>
</configuration>
</plugin>
</plugins>
</build>
</project>

  3.2:BaseJunit4Test类的代码没有做修改,请查看服务器端代码即可,TestBankTransaction的代码如下:

package gdsbcw_cxf_client;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.net.URL; import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import com.xzh.gdsbc_wcxf_client.BankTransaction;
/**
* Created by xzh on 2017/8/22.
*/
public class TestBankTransaction extends BaseJunit4Test{
//创建构造函数
public TestBankTransaction(){
}
@Test //远程访问,及将webservice应用程序发布到Tomcat服务器,客户端访问服务器接口程序
public void TestBankTransactionRemote(){
System.out.println("TestBankTransactionRemote........");
try{
ApplicationContext context = new ClassPathXmlApplicationContext("spring_cxf-client.xml");
BankTransaction bankTransaction = context.getBean("BankTransactionClient",BankTransaction.class);
String a = bankTransaction.getAesSeed("a-");
String b = bankTransaction.synAesSeed("b-", "-b");
String c = bankTransaction.requestBank("c-", "<--xml格式>");
System.out.println(a);
System.out.println(b);
System.out.println(c);
}catch(Exception e){
e.printStackTrace();
}
}
public static void main(String[] args){
}
}

3.3测试:现在TestBankTransactionRemote()方法,点击右键运行Test方法

 idea+maven+spring+cxf创建webservice应用(二)生成客户端程序

  结果:

"C:\Program Files\Java\jdk1.8.0_60\bin\java" -ea -Dfile.encoding=UTF-8 -Didea.test.cyclic.buffer.size=1048576 "-javaagent:D:\IntelliJ IDEA 2017.1.3\lib\idea_rt.jar=55769:D:\IntelliJ IDEA 2017.1.3\bin" -classpath "D:\IntelliJ IDEA 2017.1.3\lib\idea_rt.jar;D:\IntelliJ IDEA 2017.1.3\plugins\junit\lib\junit-rt.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_60\jre\lib\rt.jar;F:\ideaprojectsworkplace\gdsbc_wcxf_client\target\test-classes;F:\ideaprojectsworkplace\gdsbc_wcxf_client\target\classes;C:\Users\hengliu\.m2\repository\junit\junit\4.11\junit-4.11.jar;C:\Users\hengliu\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;C:\Users\hengliu\.m2\repository\org\apache\cxf\cxf-rt-frontend-jaxws\2.2.3\cxf-rt-frontend-jaxws-2.2.3.jar;C:\Users\hengliu\.m2\repository\xml-resolver\xml-resolver\1.2\xml-resolver-1.2.jar;C:\Users\hengliu\.m2\repository\org\apache\geronimo\specs\geronimo-jaxws_2.1_spec\1.0\geronimo-jaxws_2.1_spec-1.0.jar;C:\Users\hengliu\.m2\repository\org\apache\geronimo\specs\geronimo-activation_1.1_spec\1.0.2\geronimo-activation_1.1_spec-1.0.2.jar;C:\Users\hengliu\.m2\repository\org\apache\geronimo\specs\geronimo-ws-metadata_2.0_spec\1.1.2\geronimo-ws-metadata_2.0_spec-1.1.2.jar;C:\Users\hengliu\.m2\repository\asm\asm\2.2.3\asm-2.2.3.jar;C:\Users\hengliu\.m2\repository\org\apache\cxf\cxf-api\2.2.3\cxf-api-2.2.3.jar;C:\Users\hengliu\.m2\repository\org\apache\cxf\cxf-common-utilities\2.2.3\cxf-common-utilities-2.2.3.jar;C:\Users\hengliu\.m2\repository\org\apache\geronimo\specs\geronimo-stax-api_1.0_spec\1.0.1\geronimo-stax-api_1.0_spec-1.0.1.jar;C:\Users\hengliu\.m2\repository\wsdl4j\wsdl4j\1.6.2\wsdl4j-1.6.2.jar;C:\Users\hengliu\.m2\repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar;C:\Users\hengliu\.m2\repository\org\apache\ws\commons\schema\XmlSchema\1.4.5\XmlSchema-1.4.5.jar;C:\Users\hengliu\.m2\repository\org\apache\geronimo\specs\geronimo-annotation_1.0_spec\1.1.1\geronimo-annotation_1.0_spec-1.1.1.jar;C:\Users\hengliu\.m2\repository\org\codehaus\woodstox\wstx-asl\3.2.8\wstx-asl-3.2.8.jar;C:\Users\hengliu\.m2\repository\org\apache\neethi\neethi\2.0.4\neethi-2.0.4.jar;C:\Users\hengliu\.m2\repository\org\apache\cxf\cxf-common-schemas\2.2.3\cxf-common-schemas-2.2.3.jar;C:\Users\hengliu\.m2\repository\org\apache\cxf\cxf-rt-core\2.2.3\cxf-rt-core-2.2.3.jar;C:\Users\hengliu\.m2\repository\com\sun\xml\bind\jaxb-impl\2.1.12\jaxb-impl-2.1.12.jar;C:\Users\hengliu\.m2\repository\org\apache\geronimo\specs\geronimo-javamail_1.4_spec\1.6\geronimo-javamail_1.4_spec-1.6.jar;C:\Users\hengliu\.m2\repository\com\sun\xml\fastinfoset\FastInfoset\1.2.7\FastInfoset-1.2.7.jar;C:\Users\hengliu\.m2\repository\org\apache\cxf\cxf-rt-bindings-soap\2.2.3\cxf-rt-bindings-soap-2.2.3.jar;C:\Users\hengliu\.m2\repository\org\apache\cxf\cxf-tools-common\2.2.3\cxf-tools-common-2.2.3.jar;C:\Users\hengliu\.m2\repository\org\apache\cxf\cxf-rt-databinding-jaxb\2.2.3\cxf-rt-databinding-jaxb-2.2.3.jar;C:\Users\hengliu\.m2\repository\javax\xml\bind\jaxb-api\2.1\jaxb-api-2.1.jar;C:\Users\hengliu\.m2\repository\org\apache\cxf\cxf-rt-bindings-xml\2.2.3\cxf-rt-bindings-xml-2.2.3.jar;C:\Users\hengliu\.m2\repository\org\apache\cxf\cxf-rt-frontend-simple\2.2.3\cxf-rt-frontend-simple-2.2.3.jar;C:\Users\hengliu\.m2\repository\org\apache\cxf\cxf-rt-ws-addr\2.2.3\cxf-rt-ws-addr-2.2.3.jar;C:\Users\hengliu\.m2\repository\javax\xml\soap\saaj-api\1.3\saaj-api-1.3.jar;C:\Users\hengliu\.m2\repository\com\sun\xml\messaging\saaj\saaj-impl\1.3.2\saaj-impl-1.3.2.jar;C:\Users\hengliu\.m2\repository\org\apache\cxf\cxf-rt-transports-http\2.2.3\cxf-rt-transports-http-2.2.3.jar;C:\Users\hengliu\.m2\repository\org\apache\cxf\cxf-rt-transports-http-jetty\2.2.3\cxf-rt-transports-http-jetty-2.2.3.jar;C:\Users\hengliu\.m2\repository\org\mortbay\jetty\jetty\6.1.19\jetty-6.1.19.jar;C:\Users\hengliu\.m2\repository\org\mortbay\jetty\jetty-util\6.1.19\jetty-util-6.1.19.jar;C:\Users\hengliu\.m2\repository\org\slf4j\slf4j-jdk14\1.5.8\slf4j-jdk14-1.5.8.jar;C:\Users\hengliu\.m2\repository\org\apache\geronimo\specs\geronimo-servlet_2.5_spec\1.2\geronimo-servlet_2.5_spec-1.2.jar;C:\Users\hengliu\.m2\repository\org\springframework\spring-core\3.2.3.RELEASE\spring-core-3.2.3.RELEASE.jar;C:\Users\hengliu\.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;C:\Users\hengliu\.m2\repository\org\springframework\spring-beans\3.2.3.RELEASE\spring-beans-3.2.3.RELEASE.jar;C:\Users\hengliu\.m2\repository\org\springframework\spring-context\3.2.3.RELEASE\spring-context-3.2.3.RELEASE.jar;C:\Users\hengliu\.m2\repository\org\springframework\spring-context-support\3.2.3.RELEASE\spring-context-support-3.2.3.RELEASE.jar;C:\Users\hengliu\.m2\repository\org\springframework\spring-expression\3.2.3.RELEASE\spring-expression-3.2.3.RELEASE.jar;C:\Users\hengliu\.m2\repository\org\springframework\spring-aop\3.2.3.RELEASE\spring-aop-3.2.3.RELEASE.jar;C:\Users\hengliu\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\Users\hengliu\.m2\repository\org\springframework\spring-aspects\3.2.3.RELEASE\spring-aspects-3.2.3.RELEASE.jar;C:\Users\hengliu\.m2\repository\org\aspectj\aspectjweaver\1.7.2\aspectjweaver-1.7.2.jar;C:\Users\hengliu\.m2\repository\org\springframework\spring-web\3.2.3.RELEASE\spring-web-3.2.3.RELEASE.jar;C:\Users\hengliu\.m2\repository\org\springframework\spring-webmvc\3.2.3.RELEASE\spring-webmvc-3.2.3.RELEASE.jar;C:\Users\hengliu\.m2\repository\org\slf4j\slf4j-log4j12\1.7.7\slf4j-log4j12-1.7.7.jar;C:\Users\hengliu\.m2\repository\org\slf4j\slf4j-api\1.7.7\slf4j-api-1.7.7.jar;C:\Users\hengliu\.m2\repository\org\springframework\spring-jdbc\3.2.3.RELEASE\spring-jdbc-3.2.3.RELEASE.jar;C:\Users\hengliu\.m2\repository\org\springframework\spring-tx\3.2.3.RELEASE\spring-tx-3.2.3.RELEASE.jar;C:\Users\hengliu\.m2\repository\org\springframework\spring-orm\3.2.3.RELEASE\spring-orm-3.2.3.RELEASE.jar;C:\Users\hengliu\.m2\repository\org\mybatis\mybatis\3.2.8\mybatis-3.2.8.jar;C:\Users\hengliu\.m2\repository\org\mybatis\mybatis-spring\1.2.3\mybatis-spring-1.2.3.jar;C:\Users\hengliu\.m2\repository\mysql\mysql-connector-java\5.1.35\mysql-connector-java-5.1.35.jar;C:\Users\hengliu\.m2\repository\commons-dbcp\commons-dbcp\1.4\commons-dbcp-1.4.jar;C:\Users\hengliu\.m2\repository\commons-pool\commons-pool\1.5.4\commons-pool-1.5.4.jar;C:\Users\hengliu\.m2\repository\redis\clients\jedis\2.4.2\jedis-2.4.2.jar;C:\Users\hengliu\.m2\repository\org\apache\commons\commons-pool2\2.0\commons-pool2-2.0.jar;C:\Users\hengliu\.m2\repository\javax\servlet\javax.servlet-api\3.1.0\javax.servlet-api-3.1.0.jar;C:\Users\hengliu\.m2\repository\javax\servlet\jsp-api\2.0\jsp-api-2.0.jar;C:\Users\hengliu\.m2\repository\javax\servlet\servlet-api\2.4\servlet-api-2.4.jar;C:\Users\hengliu\.m2\repository\javax\servlet\jstl\1.2\jstl-1.2.jar;C:\Users\hengliu\.m2\repository\org\springframework\spring-test\3.2.3.RELEASE\spring-test-3.2.3.RELEASE.jar;C:\Users\hengliu\.m2\repository\com\alibaba\fastjson\1.2.12\fastjson-1.2.12.jar;C:\Users\hengliu\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.13\jackson-core-asl-1.9.13.jar;C:\Users\hengliu\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.13\jackson-mapper-asl-1.9.13.jar;C:\Users\hengliu\.m2\repository\commons-fileupload\commons-fileupload\1.3.1\commons-fileupload-1.3.1.jar;C:\Users\hengliu\.m2\repository\commons-io\commons-io\2.2\commons-io-2.2.jar;C:\Users\hengliu\.m2\repository\com\qiniu\qiniu-java-sdk\7.2.0\qiniu-java-sdk-7.2.0.jar;C:\Users\hengliu\.m2\repository\com\squareup\okhttp3\okhttp\3.3.1\okhttp-3.3.1.jar;C:\Users\hengliu\.m2\repository\com\squareup\okio\okio\1.8.0\okio-1.8.0.jar;C:\Users\hengliu\.m2\repository\com\google\code\gson\gson\2.6.2\gson-2.6.2.jar;C:\Users\hengliu\.m2\repository\com\qiniu\happy-dns-java\0.1.4\happy-dns-java-0.1.4.jar;C:\Users\hengliu\.m2\repository\javax\mail\mail\1.4.7\mail-1.4.7.jar;C:\Users\hengliu\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar;C:\Users\hengliu\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 gdsbcw_cxf_client.TestBankTransaction,TestBankTransactionRemote
INFO - Refreshing org.springframework.context.support.GenericApplicationContext@7f9a81e8: startup date [Wed Aug 23 17:10:26 CST 2017]; root of context hierarchy
INFO - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@5bfbf16f: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
TestBankTransactionRemote........
INFO - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@45afc369: startup date [Wed Aug 23 17:10:27 CST 2017]; root of context hierarchy
INFO - Loading XML bean definitions from class path resource [spring_cxf-client.xml]
INFO - Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml]
INFO - Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-soap.xml]
INFO - Loading XML bean definitions from class path resource [META-INF/cxf/cxf-servlet.xml]
INFO - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@5a955565: defining beans [cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.transport.servlet.ServletTransportFactory,BankTransactionClient.proxyFactory,BankTransactionClient]; root of factory hierarchy
八月 23, 2017 5:10:30 下午 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
信息: Creating Service {http://gdsbcw_cxf/}BankTransactionService from class com.xzh.gdsbc_wcxf_client.BankTransaction
a-
b-,-b
c-,<--xml格式>
INFO - Closing org.springframework.context.support.GenericApplicationContext@7f9a81e8: startup date [Wed Aug 23 17:10:26 CST 2017]; root of context hierarchy
INFO - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@5bfbf16f: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy Process finished with exit code 0

客户端简单的搭建完毕,业务逻辑请关注第三篇