idea+maven+spring+cxf创建webservice应用(二)生成客户端程序
idea+maven+spring+cxf创建webservice应用(二)生成客户端程序,以上一篇为基础"idea+maven+spring+cxf创建webservice应用"
- idea+maven+spring+cxf创建webservice客户端应用:和创建服务器端工程一样,如有疑问请查看上一篇《idea+maven+spring+cxf创建webservice应用》
创建好后的目录框架:添加了java和test相关目录。
2.生成webservice客户端代码:选中main下面的java目录,点击右键找到webService-》generate java code Wsdl...
2.1:然后点击进入设置界面:
2.2:设置好后点击OK:生成客户当代码,将不必要的class文件删除,删除后的目录结构如下,其中test目录下的code和配置文件是自己添加的。
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方法
结果:
"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
客户端简单的搭建完毕,业务逻辑请关注第三篇
idea+maven+spring+cxf创建webservice应用(二)生成客户端程序的更多相关文章
- Eclipse+Maven+Spring+CXF 构建webservice 服务
一. 软件准备 Eclipse 4.2.1 Maven 2.2.1 Spring 3.2.6 CXF 3.0.2 二. 步骤 首先,在Eclipse中用maven构建一个quickstart版本的ma ...
- 用cxf创建webservice服务端
用cxf创建webservice 1:在eclipse里面创建动态web工程,注意,Dynamic web module version取2.5,3.0未测试过待验证: 2:下载cxf相关的jar包, ...
- WebService--CXF与Spring的整合(jaxws:endpoint形式配置)以及客户端调用(spring配置文件形式,不需要生成客户端代码)
一.CXF与Spring整合(jaxws:endpoint形式配置) 工具要点:idea.maven 1.新建一个maven项目 <?xml version="1.0" en ...
- CXF创建webservice客户端和服务端
转 一.CXF的介绍 Apache CXF是一个开源的WebService框架,CXF大大简化了Webservice的创建,同时它继承了XFire的传统,一样可以和spring天然的进行无缝的集成.C ...
- spring+cxf 开发webService(主要是记录遇到spring bean注入不进来的解决方法)
这里不介绍原理,只是记录自己spring+cxf的开发过程和遇到的问题 场景:第三方公司需要调用我们的业务系统,以xml报文的形式传递数据,之后我们解析报文存储到我们数据库生成业务单据: WebSer ...
- (原创)Maven+Spring+CXF+Tomcat7 简单例子实现webservice
这个例子需要建三个Maven项目,其中一个为父项目,另外两个为子项目 首先,建立父项目testParent,选择quickstart: 输入项目名称和模块名称,然后创建: 然后建立子项目testInt ...
- cxf+spring+数字签名开发webservice(二)
场景 上一章中的webservice接口,因为现场正式环境的项目与外部单位网络不通,是通过前置机与外部进行数据交换,所以我们将webservice部署在前置机,在使用HttpURLCo ...
- 使用cxf创建webservice 出现timeOut的问题,设置spring超时时间
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...
- jfinal集成spring cxf做webservice服务
链接地址:http://zhengshuo.iteye.com/blog/2154047 废话不说,直接上代码 新增cxf的plugin CXFPlugin package com.jfinal.pl ...
随机推荐
- JAVA 之 多态 抽象 接口
一:多态 1:多态 一个对象有多种形式的能力 2:步骤 1编写父类派生子类 2子类重写父类方法 3用父类的数据类型引用子类对象 3:静态多态的实现方式就是方法重载 4:动态多态的实现方式就是重写 ...
- Python3中使用urllib的方法详解(header,代理,超时,认证,异常处理)
出自 http://www.jb51.net/article/93125.htm
- Hive中自定义Map/Reduce示例 In Java
Hive支持自定义map与reduce script.接下来我用一个简单的wordcount例子加以说明. 如果自己使用Java开发,需要处理System.in,System,out以及key/val ...
- 关于webapi加入Route引用出现问题的解决方案
首先在程序包管理器控制台运行安装MVC5.0,因为[Route("/api/..")]只会存在于MVC5.0中间,运行 Install-Package Microsoft.Asp ...
- MVC初级知识之——Routing路由
实例产品基于asp.net mvc 5.0框架,源码下载地址:http://www.jinhusns.com/Products/Download 我们注意到地址栏的URL是Home/Index 路由可 ...
- 双11抢券,写一个自动打开页面的html,仅仅是设定时间打开抢券的页面
<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> ...
- js遇到的问题
一些开发前台时遇到的小问题: ----------------------------------------- 一眼看出页面使用html还是html5: html有三种声明方式:<!DOCTY ...
- Hive 编程指南—笔记
1. 基础 1.1 Hive 解决问题的背景? 用户如何从一个现有的数据基础架构转移到 Hadoop 上,而这个基础架构是基于传统的关系数据库和 SQL 的? Hive 提供了一个被称为 HQL 的 ...
- thinkPHP3.2.2 数据库对表的操作
增加:M('表名')->add($data); 删除:M('表名')->delete($id); 更新:M('表名')->save($data); 查询:M('表名')->se ...
- Ubuntu14.04安装Torch7笔记
Ubuntu14.04安装Torch7笔记 利用快捷键Ctrl+Alt+T打开Ubuntu终端 第一步: 获取安装LuauJIT(C语言编写的Lua的解释器)和Torch所必需的依赖包. 代码如下: ...