- 浏览: 588101 次
- 来自: 北京
文章分类
最新评论
-
lidi2011:
很通俗易懂的文章,很形象。
同步synchronized方法和代码块 -
inuyasha027:
领教了,谢谢。
Hadoop安装, Hive 安装。 -
xbmujfly:
好文 ,本人发现晚了
学习笔记 - java.util.concurrent 多线程框架 -
hanazawakana:
学习学习!
ANT-build.xml文件详解 -
david.org:
似乎还忽略一点,那就是cassandra不同数据中心的同步,H ...
Cassandra Vs HBase
|
||
Outline |
||
1. PrefaceThis document was written using Sun Java 5, Eclipse 3.2 and MyEclipse 5.0.0. All screenshots are based upon the default user interface settings for Eclipse, MyEclipse, and Windows XP. If you experience difficulty with the instruction of this document, please see the User Feedback section for how to provide feedback to the MyEclipse documentation team. |
||
2. RequirementsFollowing are the basic MyEclipse Web Services prerequisites:
|
||
3. IntroductionThis tutorial introduces the process for using MyEclipse web services feature-set to quickly develop and testing a HelloWorld web service using a "code-first" web service development strategy. The code-first strategy concentrates development priorities and effort towards developing application business logic prior to addressing the web service interfacing requirements of the service. Typcially code-first projects will design and implement the Java beans (POJOs) responsible for the core business use-cases. Once satisfied with the POJO implementation, the web service interface will be designed and implemented to expose the public POJO services. This approach is considered ad-hoc by many and is best utilized for prototyping or small standalone system of services. What is covered in this tutorial?
|
||
3.1 XFire Java SOAP Framework OverviewMyEclipse web service features are built on top of the XFire Java SOAP framework and tools. XFire was adopted because of its growing list of basic and advanced features, high performance runtime, rapidly growing community of adopters, and its generous open source license. Some of its key features include:
To view a full list of XFire features visit the XFire site. |
||
4. Creating a Web Service Project
MyEclipse 5.0 introduces a new type of project know as a Web Services Project. This type of project extends the MyEclipse Web Project to support additional web services configuration, development and deployment concerns. This section demonstrates how to use the MyEclipse Web Services Project wizard to create and configure new web service projects. The Web Service Wizard performs the following actions:
|
||
Begin by launching the Web Service Project wizard. This wizard consists of three pages. Page-1 collects Web Project configuration details. Page-2 collects the XFire configuration details. And page-3 configures the XFire libraries on the new project's build path.
Figure-1: New Project Wizard Launcher
Figure-2: Page-2, Collecting web configuration details
Figure-3: XFire servlet and services.xml configuration
Figure-4: Selecting XFire libraries to add to new web service project buildpath
Figure-5: Web services artifacts of a new web service project |
||
5.0 Creating a Web Service - Code-first StrategyThis section demonstrates use of the MyEclipse Web Service Wizard to create an example HelloWorldService using the code-first strategy. Note that we will take advantage of the XFire's built in Aegis Java-XML binding framework. This Java-XML binding strategy is convenient for handling simple type conversion. In cases where a web service operation must accept or return complex structured information additional work maybe required. Please review the Aegis binding documentation for use of Aegis class mapping files.
Method-1: Launch wizard from MyEclipse perspective toolbar
Choose the New Web Service button on the workbench to open the Web Service Wizard. Method-2: Launch wizard from workbench menubar
Figure-6: Launching Web Service Wizard
Figure-7: Page-1 of new web service wizard
Figure-8: Page-2 of new web service wizard. The wizard generates the IHelloWorldService Java interface and the HelloWorldServiceImpl Java class, and creates a <service> entry in the project's services.xml configuration file, (see Figure-9 below). Note that the example(String message) method was generated in the interface and class to serve as a simple testing operation for when the web service is deployed. This method is not essential to the operation of the web service and should be removed. Figure-9: Newly created HelloWorld interface and implementation class |
||
6.0 Deploying a Web Service ProjectBefore you can interact with you web service it must be deployed to an application server. The MyEclipse web service project is an extended version of the MyEclipse web project. This fact enables a web service to be deployed to any J2EE application server supported by MyEclipse. This section demonstrates the tools and steps to deploy the HelloWorld project to a Tomcat 5 web container. |
||
6.1 Configuring the Application Server ConnectorThe setup and configuration of the Tomcat 5 application server connector is defined in the Working with Application Server Connectors Tutorial. If you already have a configured application server connector please proceed to the next section. |
||
6.2 Deploying the HelloWorld Web Service Project
Figure-10 below provides a visual outline of the 3 steps required to deploy the HelloWorld application using the MyEclipse J2EE Application Deployer.
The new HelloWorld WAR deployment will appear under the Tomcat 5 node in the Server Manager view (see Figure 11). Figure-11: Servers Manager View depicting deployed HelloWorld web service project |
||
7. Starting the Tomcat ServerWith the HelloWorld project deployed to Tomcat, we need to launch Tomcat if it is not already running. If the server is running the HelloWorld webapp will be automatically loaded and made accessible. To launch Tomcat choose either the debug launch-mode button or the run launch-mode button (see highlighted buttons in Figure-12). We recommend that you use the debug mode as it enables you to dynamically set breakpoints and hot-swap debug the Java implementation of your web service. Figure-12: Server Manager before Tomcat 5 launch A Tomcat starts up can monitor its start up progress in the Eclipse console view. Figure-13: Eclipse console view depicting real-time Tomcat 5 status info Once Tomcat is launched and fully initialized the Server Manager will update to reflect the server's execution status and mode. Figure-14: Server Manager showing active status of Tomcat 5 |
||
8. Testing a Web Service with the Web Service ExplorerMyEclipse provides a Web Services Explorer for testing a web service. The Web Services Explorer enables you to interface with any web service given a WSDL document that describes the service.
Figure-15: Web Services Explorer launch button on workbench toolbar
Figure-16: Web Services Explorer testing HelloWorldService To test other online web services with the Web Services Explorer visit the XMethods repository. The UDDI endpoint is found at http://uddi.xmethods.net/inquire . |
||
9. Creating a Java Test ClientXFire provides a dynamic proxy framework that will read a WSDL document and create the underlying messaging services to enable a Java class to execute actions on a web service. This section provides quick outline of what is required to develop a Java web service client to the HelloWorld web service. |
||
9.1 Additional XFire Library ConfigurationFor our example client we will create the class in the HelloWorld project. If you have not done so already you need to add the XFire HTTP Client Libraries to the build-path of the project that will contain your Java test client.
Figure-17: Choosing the XFire HTTP Client Libraries Select Finish |
||
9.2 Create the HelloWorldClient ClassLaunch the Java class wizard and create the class HelloWorldClient. Figure-18: HelloWorldClient defined in New Java Class Wizard. The code segment below defines the process for creating an XFire web service proxy that supports the POJO IHelloWorldService interface. Once the proxy has been constructed and cast to the IHelloWorldService it can be used like a standard Java class.
Launch and execute this class using the right-click Run As>Java Application or Debug As>JavaApplication context-menu actions. |
||
10. FAQQ1: Does XFire support WS-1 basic profile? A1: Yes, this is the default XFire configuration. Q2: What is the default XFire WISDL-SOAP binding style and encoding use mode? A2: The default XFire binding style and encoding mode is document literal wrapped. See Resources for more information. Q3: I'm using the default Aegis Java-XML binding and experience a runtime exception when I pass a complex Java object and return a list of complex Java objects to a Java bean exposed as a web service. How do I do this? A3: Aegis provides a default mapping support for Java-XML binding. But it in cases where a parameter or return value is a complex type (e.g., an aggregate object) or ambiguous (e.g., a Java Collection) you must provide Aegis additional mapping information. Please see the XFire Aegis Binding documentation for more information. |
||
11. References
|
||
12. User FeedbackIf you have comments or suggestions regarding this document please submit them to the If you have comments or suggestions regarding this document please submit them to the MyEclipse Documentation Forum. |
相关推荐
"XFire-Web Service.pdf"和"XFire tutorial"系列文档可能包含XFire的安装、配置、开发WebService的详细步骤。 4. **Web Service开发**:"Web_Service开发指南_2.3.1.pdf"可能是针对特定版本的开发指南,详细阐述了...
xfire是一个早期流行的开源Web服务框架,主要用于构建SOAP(简单对象访问协议)和RESTful(Representational State Transfer)服务。这个框架使得Java开发者能够轻松地创建、部署和消费Web服务。xfire依赖于一系列的...
《Xfire全方位解析:1.2.6版本的全面探讨》 Xfire,这款曾经在游戏社区中广受欢迎的即时通讯软件,以其独特的游戏整合功能和社交特性,为玩家提供了便捷的游戏内通信和社区交流平台。本文将深入探讨Xfire 1.2.6这一...
xfire是一款历史悠久的在线游戏平台,它在2004年由GameSpy Industries开发并发布,主要功能是为玩家提供即时通讯、好友列表、游戏内聊天和游戏统计等功能,旨在增强玩家的游戏体验。xfire 1.26是该平台的一个特定...
**XFire v1.99:WebService开发框架详解** XFire,全称为XFire Integration Library,是一个基于Java的开源框架,专门用于构建和部署Web服务。这个“XFire最高版本”指的是XFire项目的最终或最优化的版本,它提供了...
Xfire API 是一款专为游戏社区设计的接口,它允许开发者构建与Xfire服务交互的应用程序,从而增强玩家的游戏体验并提供社交功能。Xfire API 主要围绕Web服务概念,这意味着它通过网络提供一系列功能,使得第三方...
进行WebService开发中所用到的xfire所有相关包如:xfire-jsr181-api-1.0-M1.jar、xfire-jaxws-1.2.6.jar、xfire-java5-1.2.6.jar、xfire-core-1.2.6.jar、xfire-annotations-1.2.6.jar、xfire-aegis-1.2.6.jar、...
"Java 使用 XFire 调用 webService 接口" 在本文中,我们将学习如何使用 XFire 框架在 Java 中调用 webService 接口。XFIRE 是一个基于 Java 的开源框架,用于简化 Web 服务的开发和集成。下面,我们将通过一个简单...
《XFire 1.2.6:游戏服务器通信框架详解》 XFire,全称XFire Game Server Communication,是一款开源的游戏服务器通信框架,主要用于游戏服务器之间的实时通信和数据交换。在1.2.6版本中,它提供了稳定、高效的服务...
【xfire myeclipse10包】是一款专为MyEclipse10集成开发环境设计的XFire插件安装包。XFire是一款强大的Java Web服务框架,它提供了对Web服务的全面支持,包括创建、部署和消费Web服务的能力。在MyEclipse这样的集成...
这篇博客“Java使用XFire调用WebService接口”显然是讨论如何利用XFire这个开源框架来与Web服务交互。 XFire是Apache CXF项目的前身,它提供了一种简单的方式来创建和消费SOAP Web服务。XFire的强项在于其轻量级和...
【XFire创建的WebService】是基于Java平台的开源框架,用于构建和消费Web服务。它在Web服务领域提供了一个轻量级、高性能的选择,尤其适合快速开发。在本例中,我们将探讨如何使用XFire来创建一个简单的WebService...
XFire,全称为XML Fire,是一款历史悠久的开源Java框架,主要用作服务导向架构(SOA)中的Web服务实现工具。它允许开发者快速构建、部署和管理基于HTTP的服务,支持SOAP和RESTful通信协议。在Java开发中,XFire通过...
Spring 和 XFire 的集成是构建基于 SOAP 的 Web 服务的一种高效方法。XFire 是一个 Java 框架,专门用于创建和消费 Web 服务,而 Spring 框架则提供了全面的企业级应用开发支持。将这两者结合可以利用 Spring 的强大...
在本案例中,"Xfire的client.zip"是一个包含了Xfire客户端代码的压缩包,主要用于调用Web服务。 Xfire客户端代码是实现与Xfire服务器通信的代码库,它可能包含了多种语言的实现,如Java、C#或Python等。这些代码...
Xfire是一款曾经非常流行的社交软件,专为游戏爱好者设计,允许玩家在玩游戏时与朋友聊天、分享游戏状态和成就。这个“Xfire案例,webserver——Xfire案例”的主题可能涉及Xfire服务端的实现,特别是它如何作为web...
Xfire是一款古老的开源框架,它允许开发者轻松地创建和消费SOAP Web Services。然而,随着技术的发展,Xfire已经被Apache CXF所取代,但理解Xfire实现HTTPS调用WebService接口的基本原理仍然是有价值的。 标题...
XFire是Java平台上一个曾经流行的开源框架,专门用于构建和消费Web服务。本实例将深入探讨如何利用XFire来实现Web服务。 一、XFire简介 XFire是Apache CXF项目的前身,它提供了一个轻量级、高性能的框架,用于创建...
在IT行业中,集成框架是开发复杂应用程序的关键,Spring和XFire就是两个重要的工具。Spring作为一个强大的Java企业级应用开发框架,提供了丰富的功能,包括依赖注入、面向切面编程(AOP)以及各种服务管理。而XFire...
xfire客户端jar包是用于构建Web服务客户端的一个关键组件,它是Apache CXF项目早期的版本。Apache CXF是一个流行的开源框架,它支持多种Web服务标准,包括SOAP、RESTful API和WS-*规范。xfire-jar包包含了实现这些...