- 浏览: 772523 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (208)
- Java (77)
- JavaScript (16)
- UML (1)
- Spring (24)
- Hibernate (11)
- J2EE部署 (18)
- 操作系统 (13)
- struts (11)
- jsp (3)
- J2EE (34)
- 数据库 (22)
- tomcat (4)
- apache (2)
- MyEclipse (13)
- Linux (14)
- Ext (6)
- Weblogic (2)
- 数据库 Oracle 空表导出 (1)
- Oracle (3)
- 编码 乱码 (1)
- 多线程 (5)
- jQuery (2)
- Apache Mina (1)
- ibatis (6)
- abator (1)
- svn (1)
- jvm (1)
- ERwin (2)
- mysql (2)
- ant (1)
- memcache (1)
- dubbo (1)
- PowerDesigner (1)
最新评论
-
di1984HIT:
Shallow heap & Retained heap -
tinguo002:
非常感谢 , 太棒了。
Spring注解方式,异常 'sessionFactory' or 'hibernateTemplate' is required的解决方法 -
白天看黑夜:
Apache Mina Server 2.0 中文参考手册(带 ...
Apache Mina – 简单的客户端/服务端应用示例 -
wumingxingzhe:
好文
Shallow heap & Retained heap -
di1984HIT:
学习了!!
工作流(Workflow)和BPM的不同
转自:http://www.celinio.net/techblog/?p=571
The WSDL2java command generates JAX-WS compliant Java code for the services that are defined in the WSDL document.
This is known as the Top-Down approach (contract first, based on an existing WSDL file).
1) open a DOS window and go to the CXF directory, under the bin sub-directory :
D:\softs\CXF\apache-cxf-2.3.1\bin
2) run the following command :
This command will create the folder D:\softs\CXF\apache-cxf-2.3.1\bin\com\company\auth\service
The -client option will generate a client
The -p option is used to specify the name of the package used for the generated classes
The generated classes are :
ComputeBMI.java
ComputeBMIResponse.java
IBMICalculator.java
IBMICalculator_IBMICalculatorImplPort_Client.java (the client)
IBMICalculatorImplService.java
ObjectFactory.java
package-info.java
These classes are fully annotated. For instance if we open IBMICalculator.java, we can see 8 annotations !
3) copy the classes in the src folder of your project and modify the client according to your needs
Another way to generate the java code (stubs) is by using soapUI, a tool to test Web Services. It integrates different tools that use different Web Services frameworks.
In the case of Apache CXF framework, you must first set its path in the preferences :
Then in the Tools Menu, choose “Apache CXF Stubs”. This is where you specify the arguments for the WSDL2JAVA command. Check the box “All code” to generate all starting point code, choose an output directory :
The command is then executed and the options are displayed :
Link : https://cwiki.apache.org/CXF20DOC/wsdl-to-java.html
The WSDL2java command generates JAX-WS compliant Java code for the services that are defined in the WSDL document.
This is known as the Top-Down approach (contract first, based on an existing WSDL file).
1) open a DOS window and go to the CXF directory, under the bin sub-directory :
D:\softs\CXF\apache-cxf-2.3.1\bin
2) run the following command :
D:\softs\CXF\apache-cxf-2.3.1\bin>wsdl2java.bat -client -p com.company.auth.service http://localhost:8085/BMI/services/cxfBmi?wsdl
This command will create the folder D:\softs\CXF\apache-cxf-2.3.1\bin\com\company\auth\service
The -client option will generate a client
The -p option is used to specify the name of the package used for the generated classes
The generated classes are :
ComputeBMI.java
ComputeBMIResponse.java
IBMICalculator.java
IBMICalculator_IBMICalculatorImplPort_Client.java (the client)
IBMICalculatorImplService.java
ObjectFactory.java
package-info.java
These classes are fully annotated. For instance if we open IBMICalculator.java, we can see 8 annotations !
package com.company.auth.service; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult; import javax.jws.WebService; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.ws.RequestWrapper; import javax.xml.ws.ResponseWrapper; /** * This class was generated by Apache CXF 2.3.1 * Generated source version: 2.3.1 * */ @WebService(targetNamespace = "http://services.bmi.company.com/", name = "IBMICalculator") @XmlSeeAlso({ObjectFactory.class}) public interface IBMICalculator { @WebResult(name = "return", targetNamespace = "") @RequestWrapper(localName = "computeBMI", targetNamespace = "http://services.bmi.company.com/", className = "com.company.auth.service.ComputeBMI") @WebMethod @ResponseWrapper(localName = "computeBMIResponse", targetNamespace = "http://services.bmi.company.com/", className = "com.company.auth.service.ComputeBMIResponse") public double computeBMI( @WebParam(name = "weight", targetNamespace = "") double weight, @WebParam(name = "height", targetNamespace = "") double height ); }
3) copy the classes in the src folder of your project and modify the client according to your needs
Another way to generate the java code (stubs) is by using soapUI, a tool to test Web Services. It integrates different tools that use different Web Services frameworks.
In the case of Apache CXF framework, you must first set its path in the preferences :
Then in the Tools Menu, choose “Apache CXF Stubs”. This is where you specify the arguments for the WSDL2JAVA command. Check the box “All code” to generate all starting point code, choose an output directory :
The command is then executed and the options are displayed :
Link : https://cwiki.apache.org/CXF20DOC/wsdl-to-java.html
评论
2 楼
Kevin_jiang2011
2012-06-25
有些wsdl文件需要用代理才能访问,虽然在proxy setting里面设置了代理服务器和端口,并且能够生成testcase。 但是成cxf 客户端的代码的时候,会报连接超时异常。
请问这个问题怎么解决呢?
请问这个问题怎么解决呢?
1 楼
Kevin_jiang2011
2012-06-25
有些wsdl文件需要用代理才能访问,虽然在proxy setting里面设置了代理服务器和端口,并且能够生成testcase。 但是成cxf 客户端的代码的时候,会报连接超时异常。
发表评论
-
什么是两阶段提交协议
2012-05-08 16:58 1065两阶段提交协议 实现分布式事务的关键就是两阶段提交协议。在此 ... -
使用Eclipse远程调试Tomcat
2012-03-23 22:56 1510有些时候,调试不得不用外网,比如说做支付宝的支付接口,服务器后 ... -
Java compiler level does not match the version of the installed Java project fac
2012-03-02 11:32 1318问题现象:项目图标报错“Java compiler level ... -
WebService的事务处理
2012-03-01 15:03 1560如果你只是要解决两个系统之间的事务同步问题,可以采用判断服务是 ... -
线程池(java.util.concurrent.ThreadPoolExecutor)的使用
2012-02-29 15:50 2508一、简介 线程池类为 j ... -
Quartz表达式解析
2012-02-08 14:40 807字段 允许值 允许的特 ... -
newCachedThreadPool线程池
2011-11-20 11:35 43035public static ExecutorService n ... -
Apache Mina – 简单的客户端/服务端应用示例
2011-11-19 23:49 5528转自http://javasight.net/2011/05/ ... -
Class.forName()、Class.forName().newInstance() 、New 三者区别!
2011-11-15 09:18 1263终于明白为什么加载数据库驱动只用Class.forName() ... -
Apache MINA 快速入门指南
2011-11-13 12:04 1660最近用到Socket套接字编程,在服务器监听方面还没有具体思路 ... -
apache mina (异步连接框架)实例
2011-11-13 11:53 2068一、介绍 mina(Multipurpose Infrastr ... -
多线程的队列----BlockingQueue
2011-11-11 17:06 985import java.util.concurrent.Arr ... -
Java多线程之Callable接口的实现
2011-11-11 11:39 937import java.util.concurrent.Cal ... -
FutureTask的使用方法和使用实例
2011-11-11 11:23 1244FutureTask是一种可以取消的异步的计算任务。它的计算是 ... -
使用Eclipse(MyEclipse)+ abator自动生成iBatis代码
2011-11-03 00:39 1158一.安装插件Abator Abator for Eclipse ... -
Spring框架下获取Bean的几种方式
2011-11-03 00:06 4088通过xml配置文件 bean配置在xml里面,spri ... -
使用JAX-WS standard Endpoint APIs开发WebService完整的例子
2011-09-29 15:16 2133编程发布WebService方式的完整例子 WS服务端: (1 ... -
Activiti 5.6:子流程(subProcess)
2011-09-22 15:26 12717Activiti 5.6提供了子流程的实现,包括两种基于子流程 ... -
工作流(Workflow)和BPM的不同
2011-09-21 15:31 13591、工作流(Workflow) 在模 ... -
Activiti 5.6:配置与Spring整合
2011-09-21 13:00 11432Activiti 5.6与Spring整合也比较简单,其基本 ...
相关推荐
Frank Kane's Taming Big Data with Apache Spark and Python is your companion to learning Apache Spark in a hands-on manner. Frank will start you off by teaching you how to set up Spark on a single ...
《SLAM入门教程:A Tutorial Approach to Simultaneous Localization and Mapping》是一本为初学者设计的教程,旨在帮助读者从零基础开始理解SLAM的基本原理和方法。书名“SLAM for Dummies”暗示了它以通俗易懂的...
Analog Circuit Design Volume 1 - A tutorial guide to applications and solutions password: goCHINAgo!
Java 8 简明教程 Java 8 Tutorial中文版 “Java并没有没落,人们很快就会发现这一点” 欢迎阅读我编写的Java 8介绍。本教程将带领你一步一步地认识这门语言的新特 性。通过简单明了的代码示例,你将会学习到如何使用...
Designed as a guidebook for those who want to become a Java developer, Java 7: A Comprehensive Tutorial discusses the essential Java programming topics that you need to master in order teach other ...
If you are a Java developer or a manager who has experience with Apache Maven and want to extend your knowledge, then this is the ideal book for you. Apache Maven Cookbook is for those who want to ...
Furthermore, we include a summary of currently used algorithms for training SV machines, covering both the quadratic (or convex) programming part and advanced methods for dealing with large datasets....
Apache batik 是一个开源的java svg 工具包,但是关于它的教程比较少。这是一本比较系统的介绍batik 的电子书,非常难得,不过是英文的,不过不难理解
目前为止能找到的最新版本。资料很难得。 Java 3D Tutorial v1.6.2 (Java 3D API v1.2) Getting Started with the Java 3D API A Tutorial for Beginners
Beginning Cryptography with Java While cryptography can still be a controversial topic in the programming community, Java has weathered that storm and provides a rich set of APIs that allow you, the ...
Enterprise Java Microservices is an example-rich tutorial that shows how to design and manage large-scale Java applications as a collection of microservices. Purchase of the print book includes a ...
> You should also read my Java 11 Tutorial (including new language and API features from Java 9, 10 and 11). Welcome to my introduction to Java 8. This tutorial guides you step by step through all new...
Apache Kylin Tutorial, 官方网站整理而来。 Apache Kylin Tutorial Apache Kylin Tutorial Apache Kylin Tutorial Apache Kylin Tutorial Apache Kylin Tutorial
A hands-on guide to the Java programming language, The Java™ Tutorial, Fourth Edition is perfect for any developer looking for a proven path to proficiency with Java SE. This popular tutorial "from ...
The book starts with an explanation of what reactive programming is, why it is so appealing, and how we can integrate it in to Java. It continues by introducing the new Java 8 syntax features, such as...
本文介绍了 Web 服务的基本概念和技术,包括 Web 服务的历史背景、多层架构的优势、SOAP 协议的工作原理、WSDL 的结构和用途、示例 Web 服务的开发流程,以及如何使用 Apache CXF 和不同类型的服务器部署 Web 服务。...
本教程将深入探讨"docs文件"和"tutorial文件",这两个在Java学习和开发过程中非常重要的资源。 首先,"docs文件"通常指的是Java API文档。API(Application Programming Interface)是Java的核心组成部分,提供了...
We walk through a hands-on tutorial to get you started with your first Hibernate project. We look at Java application design for domain models and at the options for creating object/relational ...
Chapter 17: Introduction to Contexts and Dependency Injection for the Java EE Platform 305 Overview of CDI 306 About Beans 307 About Managed Beans 307 Beans as Injectable Objects 308 Using ...