Presentation is loading. Please wait.

Presentation is loading. Please wait.

Business and Systems Aligned. Business Empowered. TM Implementing SQI via SOAP Web- Services Simple Query Interface - Developer’s Meeting Thursday 29 th.

Similar presentations


Presentation on theme: "Business and Systems Aligned. Business Empowered. TM Implementing SQI via SOAP Web- Services Simple Query Interface - Developer’s Meeting Thursday 29 th."— Presentation transcript:

1 Business and Systems Aligned. Business Empowered. TM Implementing SQI via SOAP Web- Services Simple Query Interface - Developer’s Meeting Thursday 29 th of April – Friday 30 th of April FHG-FIT in Schloss Birlinghoven, Bonn, Germany Stefan Brantner, BearingPoint Graz

2 2 © BearingPoint GmbH, March 2004 Overview Purpose of this presentation To present an API that facilitates the development of SQI services as well as the invocation of remote services via SOAP by using Apache AXIS Presentation outline Structure of ZIP and Java Archive (JAR) file for SQI development How to implement and deploy an SQI service How to invoke a remote SQI service Tool classes

3 3 © BearingPoint GmbH, March 2004 sqiservice.zip Can be downloaded from LR-Interop Yahoo Group: http://groups.yahoo.com/group/LORinterop ELENA Interoperability web-site: http://nm.wu-wien.ac.at/e-learning/interoperability Contains … All relevant WSDL files for building an SQI web-service The file sqiservice.jar which holds the necessary Java wrapper classes for creating and invoking a web-service via Apache Axis The needed WSDD deployment descriptors for Apache Axis A PDF file explaining how to use the JAR file Java-Doc files that explain the SQI API in detail

4 4 © BearingPoint GmbH, March 2004 sqiservice.jar Two types of services 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 two-way – both sides of the communication need to be server and client for different types of methods, i.e. Query — In this case interface definitions are split into two separate interface classes, that have the same class-name but reside in two different sub-packages — org/elena/service/query/source/Query.java — org/elena/services/query/target/Query.java

5 5 © BearingPoint GmbH, March 2004 sqiservice.jar +- 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 +- ComSessionImpl.java +- ComSessionFactory.java +- ComSessionFactoryImpl.java +- ComSessionManager.java

6 6 © BearingPoint GmbH, March 2004 Service implementation / invocation Needed JARs: axis.jar axis-ant.jar commons-discovery.jar commons-logging.jar jaxrpc.jar saaj.jar wsdl4j.jar These are part of Axis 1.1 distribution which can be downloaded from http://ws.apache.org/axis/index.html

7 7 © BearingPoint GmbH, March 2004 Service implementation Empty implementation classes can be used as starting point for service implementation See directory org/elena/service/* in sqiservice.zip Example: Implementation of the target query service Service class must implement the interface org.elena.services.query.target.Query.java Start from empty implementation classes and adapt package name

8 8 © BearingPoint GmbH, March 2004 Service deployment with TomCat For web-applications: Add dependent JAR files to the WEB-INF/lib directory Add Axis servlet definitions to web.xml file Deploy the web-service to Axis via a WSDD (Web service deployment descriptor) file Take appropriate WSDD file from the sqiservice.zip as starting point Adapt class name to your chosen package Run the Axis admin client to deploy the service java org.apache.axis.client.AdminClient -lhttp://localhost:8080/[WebAppContext]/services/AdminService deploy.wsdd Detailed instructions: http://ws.apache.org/axis/java/install.html

9 9 © BearingPoint GmbH, March 2004 Service invocation All classes for service invocation available in sqiservice.jar Example Source wants to query a target network node Use wrapper classes provided in package org.elena.services.query.target Imports import org.elena.service.sqi.target.*; import org.elena.service.sessionmgmt.*; import org.elena.tools.sessionmgmt.MD5;

10 10 © BearingPoint GmbH, March 2004 Service invocation Example (contd.) import java.net.URL; 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/"; SessionManagementService service1 = new SessionManagementServiceLocator(); SessionManagement sessionMgmtPort = service1.getSessionManagement( new URL(targetServiceBaseURL + "SessionManagement")); String sessionID = sessionMgmtPort.createSession("username", MD5.getMD5FromString("password")); QueryService service = new QueryServiceLocator(); Query queryPort = service.getQuery(new URL(targetServiceBaseURL + "Query")); String queryResult = queryPort.synchronousQuery(sessionID, "Hello Query")); System.out.println("Result = " + queryResult); }

11 11 © BearingPoint GmbH, March 2004 Helper classes for service implementation Session Management (package org.elena.tools.sessionmgmt ) ComSessionManager.java — A abstract base class for creating and destroying user-specific and anonymous sessions ComSession.java, ComSessionFactory.java — Two interface classes for implementing and creating concrete instances of session objects (abstract factory pattern) ComSessionImpl.java, ComSessionFactoryImpl.java — A default implementation of the ComSession interface. A default session object factory implementing the ComSessionFactory interface. See JavaDoc for more details. Queries (package org.elena.tools.sqi ) Vocabulary.java — Some constants for query languages and result formats

12 12 © BearingPoint GmbH, March 2004 Authors This presentation was prepared by: Stefan Brantner BearingPoint GmbH Seering 6 8141 Unterpremstätten Phone: +43 316 8003 2102 Fax: +43 316 8003 1080 e-mail: stefan.brantner@bearingpoint.com © Copyright BearingPoint GmbH, Graz, 2004 All rights reserved. The content of this document is protected by copyright. The modification, abridgement, expansion and endorsement of the document require the prior written consent from BearingPoint GmbH, Vienna. Every duplication is permitted for personal use only and subject to the condition that the duplication contains this copyright notation. Every publication or every translation requires the prior written consent by BearingPoint GmbH, Vienna. The commercial use or use for educational purpose by third parties requires the prior written consent by BearingPoint GmbH, Vienna as well.

13


Download ppt "Business and Systems Aligned. Business Empowered. TM Implementing SQI via SOAP Web- Services Simple Query Interface - Developer’s Meeting Thursday 29 th."

Similar presentations


Ads by Google