Implementing SQI via SOAP Web-Services



Similar documents
Consuming, Providing & Publishing WS

Consuming and Producing Web Services with WST and JST. Christopher M. Judd. President/Consultant Judd Solutions, LLC

Mutual Fund Web Service Developer Guide

Consuming and Producing Web Services with Web Tools. Christopher M. Judd. President/Consultant Judd Solutions, LLC

Module 13 Implementing Java EE Web Services with JAX-WS

Brekeke PBX Web Service

ADFS 2.0 Application Director Blueprint Deployment Guide

JBoss SOAP Web Services User Guide. Version: M5

Building and Using Web Services With JDeveloper 11g

Web Service Development Using CXF. - Praveen Kumar Jayaram

PowerTier Web Development Tools 4

Connecting Custom Services to the YAWL Engine. Beta 7 Release

Cúram Deployment Guide for WebSphere Application Server

A Sample OFBiz application implementing remote access via RMI and SOAP Table of contents

Author: Gennaro Frazzingaro Universidad Rey Juan Carlos campus de Mostòles (Madrid) GIA Grupo de Inteligencia Artificial

Brekeke PBX Version 3 Web Service Developer s Guide Brekeke Software, Inc.

T320 E-business technologies: foundations and practice

Hello World RESTful web service tutorial

Overview of Web Services API

Web Development on the SOEN 6011 Server

Application Notes for Packaging and Deploying Avaya Communications Process Manager Sample SDK Web Application on a JBoss Application Server Issue 1.

Java Access to Oracle CRM On Demand. By: Joerg Wallmueller Melbourne, Australia

Web Applications. Originals of Slides and Source Code for Examples:

WIRIS quizzes web services Getting started with PHP and Java

Creating Web Services Applications with IntelliJ IDEA

Developing Java Web Services to Expose the WorkTrak RMI Server to the Web and XML-Based Clients

Enterprise Service Bus

Running and Testing Java EE Applications in Embedded Mode with JupEEter Framework

SDK Code Examples Version 2.4.2

Developing Web Services with Eclipse and Open Source. Claire Rogers Developer Resources and Partner Enablement, HP February, 2004

Trademarks: Yellowfin and the Yellowfin Logo are registered trademarks of Yellowfin International.

Web Services using Tomcat and Eclipse

Cúram Deployment Guide for WebLogic Server

Introduction to HP ArcSight ESM Web Services APIs

STREAMEZZO RICH MEDIA SERVER

Web Services Developer s Guide

Understanding class paths in Java EE projects with Rational Application Developer Version 8.0

IUCLID 5 Guidance and Support

BPM Scheduling with Job Scheduler

Accessing Data with ADOBE FLEX 4.6

NetBeans IDE Field Guide

SOAP RPC. SimpleObjectAccessProtocol. RemoteProcedureCall mittels XML über Port 80. Sascha Sadikni BPS Präsentation

Server Setup and Configuration

Programming on the Web(CSC309F) Tutorial: Servlets && Tomcat TA:Wael Aboelsaadat

Joke Server example. with Java and Axis. Web services with Axis SOAP, WSDL, UDDI. Joke Metaservice Joke Server Joke Client.

HOBOlink Web Services V2 Developer s Guide

Onset Computer Corporation

Introduction to Web services for RPG developers

Implementing a Web Service Client using Java

Deploying Microsoft Operations Manager with the BIG-IP system and icontrol

ActiveVOS Server Architecture. March 2009

NetBeans IDE Field Guide

MarkLogic Server. MarkLogic Connector for Hadoop Developer s Guide. MarkLogic 8 February, 2015

Web Applications and Struts 2

FUSE-ESB4 An open-source OSGi based platform for EAI and SOA

Java Web Programming with Eclipse

Developer Guide: Unwired Server Management API. Sybase Unwired Platform 2.1

WebSphere v5 Administration, Network Deployment Edition

In this chapter, we lay the foundation for all our further discussions. We start

Developing Web Services with Apache CXF and Axis2

Getting Started with Web Applications

CREATING AND DEPLOYING ABL WEB SERVICES

Web Applications. For live Java training, please see training courses at

Advantage Joe. Deployment Guide for WebLogic v8.1 Application Server

Magento Search Extension TECHNICAL DOCUMENTATION

[1]Oracle Communications Billing and Revenue Management Web Services Manager Release 7.5 E

Banner Payment Processor Connection Handbook. December 2011

On-campus Tomcat Deployment Client

Monitoring Oracle Enterprise Performance Management System Release Deployments from Oracle Enterprise Manager 12c

ZeroTurnaround License Server User Manual 1.4.0

TIBCO ActiveMatrix BPM Web Application Component Development. Software Release 2.0 November 2012

Extending XSLT with Java and C#

a) Install the SDK into a directory of your choice (/opt/java/jdk1.5.0_11, /opt/java/jdk1.6.0_02, or YOUR_JAVA_HOME_DIR)

WebSphere Business Monitor V7.0: Clustering Single cluster deployment environment pattern

Crawl Proxy Installation and Configuration Guide

DeskNow. Ventia Pty. Ltd. Advanced setup. Version : 3.2 Date : 4 January 2007

Web Application Architecture (based J2EE 1.4 Tutorial)

Agile Product Lifecycle Management

Java Web Services SDK

Java Servlet and JSP Programming. Structure and Deployment China Jiliang University

Hello World Portlet Rendered with JSP for WebSphere Portal Version 4.1

Web-Service Example. Service Oriented Architecture

CONFIGURATION AND APPLICATIONS DEPLOYMENT IN WEBSPHERE 6.1

Corticon Server: Deploying Web Services with Java

CORISECIO. Quick Installation Guide Open XML Gateway

Glassfish, JAVA EE, Servlets, JSP, EJB

Workshop Advanced GeoNetwork

Publishing, Consuming, Deploying and Testing Web Services

EMC XDS Repository Connector for ViPR

DEVELOPING CONTRACT - DRIVEN WEB SERVICES USING JDEVELOPER. The purpose of this tutorial is to develop a java web service using a top-down approach.

Configure a SOAScheduler for a composite in SOA Suite 11g. By Robert Baumgartner, Senior Solution Architect ORACLE

CHAPTER 10: WEB SERVICES

: Test 217, WebSphere Commerce V6.0. Application Development

Install guide for Websphere 7.0

an open source web service toolkit for Java Mark Volkmann Object Computing, Inc.

Transcription:

IST-2001-37264 Creating a Smart Space for Learning Implementing SQI via SOAP Web-Services Date: 10-02-2004 Version: 0.7 Editor(s): Stefan Brantner, Thomas Zillinger (BearingPoint) 1

1 Java Archive for SQI service implementation In order to facilitate the development of SQI services as well as the invocation of remote services a Java archive file (JAR) has been developed that contains SOAP wrapper classes for all the services needed for SQI 1. This chapter describes this Java archive and provides source code examples on how to implement and invoke a service. The JAR file named queryservice.jar which is part of the ZIP file queryservice.zip can be obtained from the following web-address: http://nm.wu-wien.ac.at/e-learning/interoperability. The ZIP file also contains the WSDL files of all the involved services in the sub-directory "wsdl". These files can be used for example to automatically create the wrapper classes for a non-java system or for a web-service package other than Apache Axis. Furthermore the ZIP file contains all the Java-Doc files for the classes described in section 1.1. 1.1 Java archive structure Each service is implemented in its own Java package below the base package org.elena.services. Each of these packages contains all the wrapper classes in order to implement this service or to invoke this service on a remote host. Figure 1 depicts all the packages as well as the Java files that are part of the JAR file 2. There are two different types of services specified in the SQI specification: Services that implement classical client-server type of interfaces (client calls server), i.e. Session Management. Services that can not be classified as client-server because the communication is twoway both sides of the communication need to be server and client for different types of methods. This is the case for the query and the resource management services. Here, for example both sides carrying out a query need to act as client and server. For the second type of services where both communication partners act as client as well as server the respective interface definition have been split into two separate classes (with the same name!) that reside in two different sub-packages of the service base package. For example the part of the query interface that must be implemented by the source resides in package org.elena.services.query.source. The part of the interface that must be implemented by the target is in org.elena.services.query.target. 1 The SOAP wrapper classes can be only used with the Java Open-Soruce SOAP package Apache AXIS. 2 The JAR file obviously also contains the compiled Java class files. 2

+- org +- elena +- services +- sessionmgmt +- SessionManagement.java +- SessionManagementService.java +- SessionManagementServiceLocator.java +- SessionManagementSoapBindingImpl.java +- SessionManagementSoapBindingStub.java +- query +- source +- Query.java +- QueryService.java +- QueryServiceLocator.java +- QuerySoapBindingImpl.java +- QuerySoapBindingStub.java +- target +- Query.java +- QueryService.java +- QueryServiceLocator.java +- QuerySoapBindingImpl.java +- QuerySoapBindingStub.java +- tools +- sessionmgmt +- ComSession.java +- ComSessionManager.java Figure 1: Java archive packages and classes 1.2 Service implementation In order to implement one of the above services as a SOAP service the empty implementation classes provided in each of the above packages can be used. These implementation classes (file suffix is "Impl.java") implement the respective interface and can be used as a starting point for ones own service implementation. As an example we describe here the implementation of the target query interface, which is implemented in the Java interface class org.elena.services.query.target.- Query.java. This interface consists of the following methods: void setquerylanguage(string, String) void setresultsformat(string, String) void setresultssetsize(string, Integer) void setmaxqueryresults(string, Integer) void setmaxduration(string, Integer) String synchronousquery(string, String) String getadditionalqueryresults(string, Integer) Integer gettotalresultscount(string) 3

void asynchronousquery(string, String, String) void setsourcelocation(string, String) String getresourcedescription(string, String) In order to write a new implementation of the target query service the Java class org.elena.services.query.target.querysoapbindingimpl.java can be taken as starting point. In this file all the above methods are already there but with an empty implementation. Implementers are strongly recommended to change the package name of the default implementation and write their own classes based on those default implementations. As a consequence the WSDD deployment files have to be adapted accordingly (see section 1.4). As soon as the new service implementation is finished, it can be deployed to a TomCat 4 installation via one of the WSDD files part of the ComAPI.zip file available under http://nm.wu-wien.ac.at/e-learning/interoperability. This deployment process is described in greater detail in section 1.4. 1.3 Service Invocation In order to invoke a SOAP service implemented on a LM network node, one can directly use the classes provided in the soapservice.jar archive. If, for example, a source network node wants to query a target network node it needs to use the wrapper classes provided in package org.elena.services.query.target. The following Java code first gets a session-id from the target's session management service and then invokes a sample synchronous query at the given target: import java.net.url; // classes from the soapservice.jar archive import org.elena.service.sqi.target.*; import org.elena.service.sessionmgmt.*; import org.elena.tools.sessionmgmt.md5; public class QueryTester { public static void main(string[] args) { String targetservicebaseurl = "http://my.target.host:8080/services/"; // get a session ID from the target node SessionManagementService service1 = new SessionManagementServiceLocator(); SessionManagement sessionmgmt = Service1.getSessionManagement( new URL(targetServiceBaseURL + "Query")); String sessionid = sessionmgmt.createsession("username", MD5.getMD5FromString("passwordMD5")); // send a synchronous query to the target node 4

} } QueryService service = new QueryServiceLocator(); Query port = service.getquery(new URL(targetServiceBaseURL + "Query")); String queryresult = port.synchronousquery(sessionid, "Hello Query")); System.out.println("Result = " + queryresult); Listing 1: A simple Java client that requests a session ID at the target and then sends a synchronous query to the target. In order for the above code to work the following libraries need to be in the CLASSPATH: axis.jar axis-ant.jar commons-discovery.jar commons-logging.jar jaxrpc.jar saaj.jar wsdl4j.jar All of these Java archive files are part of the Axis 1.1 distribution which can be downloaded at http://ws.apache.org/axis/index.html. 1.4 Service Deployment with Axis and TomCat This chapter only deals with using Axis in existing web-applications. Documentation about other possibilities of using axis can be found at the Axis home-page. In case Axis web-services shall be used in an existing web-application the following two steps need to be taken first: Add axis.jar, wsdl4j.jar, saaj.jar, jaxrpc.jar and the other dependent libraries (see above) to your web-application's /WEB-INF/lib directory. Copy the following Axis Servlet declarations and mappings to your own web.xml file: <servlet> <display-name>apache-axis Servlet</display-name> <servlet-class> org.apache.axis.transport.http.axisservlet </servlet-class> </servlet> <servlet> <servlet-name>adminservlet</servlet-name> <display-name>axis Admin Servlet</display-name> <servlet-class> org.apache.axis.transport.http.adminservlet 5

</servlet-class> <load-on-startup>100</load-on-startup> </servlet> <url-pattern>/servlet/axisservlet</url-pattern> <url-pattern>*.jws</url-pattern> <url-pattern>/services/*</url-pattern> <servlet-name>adminservlet</servlet-name> <url-pattern>/servlet/adminservlet</url-pattern> As soon as you have created your own web-services classes according to 1.2 Axis needs to be told how to expose these web-services. Axis takes a Web Service Deployment Descriptor (WSDD) file that describes in XML what the service is, what methods it exports and other aspects of the SOAP endpoint. In order to deploy your own web-service follow the following three steps: CLASSPATH setup: Java must be able to find axis.jar, commons-discovery.jar, commonslogging.jar, jaxrpc.jar, saaj.jar, log4j-1.2.8.jar (or whatever is appropriate for your chosen logging implementation), and the XML parser jar file or files (e.g., xerces.jar) in your CLASSPATH. set AXIS_HOME=c:\axis set AXIS_LIB=%AXIS_HOME%\lib set CLASSPATH=%AXIS_LIB%\axis.jar; %AXIS_LIB%\commons-discovery.jar; %AXIS_LIB%\commons-logging.jar; %AXIS_LIB%\jaxrpc.jar; %AXIS_LIB%\saaj.jar; %AXIS_LIB%\log4j-1.2.8.jar; %AXIS_LIB%\xml-apis.jar; %AXIS_LIB%\xercesImpl.jar Find the appropriate deployment descriptor: In the appropriate service sub-directory of the soapservice.zip ZIP file (see directory org.elena.service) you can find the appropriate web-service deployment descriptor file deploy.wsdd for your web-service. Copy this file to a directory on your hard disc. In case you have changed the package name of your service implementation class you will have to adapt the following entry to show the correct package and class name: <parameter name="classname" 6

Run the Axis admin client: value="your.package.yourserviceimplclass"/> Execute the following command from the directory you copied the deploy.wsdd file to: java org.apache.axis.client.adminclient -lhttp://localhost:8080/[webappcontext]/services/adminservice deploy.wsdd The above URL of the AdminService must be constructed according to the context name of your web-application. More detailed information about service deployment and Axis installation can be found in the Axis installation instructions at http://ws.apache.org/axis/java/install.html. 7