Building Web Services with XML Service Utility Library (XSUL)



Similar documents
Asynchronous Peer-to- Peer Web Services and Firewalls

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

Creating Web Services in NetBeans

JVA-561. Developing SOAP Web Services in Java

ITS. Java WebService. ITS Data-Solutions Pvt Ltd BENEFITS OF ATTENDANCE:

Developing Java Web Services

Grid Computing. Web Services. Explanation (2) Explanation. Grid Computing Fall 2006 Paul A. Farrell 9/12/2006

HexaCorp. White Paper. SOA with.net. Ser vice O rient ed Ar c hit ecture

Middleware and the Internet. Example: Shopping Service. What could be possible? Service Oriented Architecture

WEB SERVICES. Revised 9/29/2015

XIII. Service Oriented Computing. Laurea Triennale in Informatica Corso di Ingegneria del Software I A.A. 2006/2007 Andrea Polini

rpafi/jl open source Apache Axis2 Web Services 2nd Edition using Apache Axis2 Deepal Jayasinghe Create secure, reliable, and easy-to-use web services

Web Services Development for IBM WebSphere Application Server V7.0. Version: Demo. Page <<1/10>>

Building an Enterprise Service Bus Using Web Services and Apache Synapse v2

What is a Web service?

Web Services in Oracle Fusion Middleware. Raghu Kodali Consulting Product Manager & SOA Evangelist Oracle Fusion Middleware Oracle USA

Principles and Foundations of Web Services: An Holistic View (Technologies, Business Drivers, Models, Architectures and Standards)

AquaLogic Service Bus

Middleware and the Internet

COM 440 Distributed Systems Project List Summary

Using mobile phones to access Web Services in a secure way. Dan Marinescu

ActiveVOS Server Architecture. March 2009

Clustering with Tomcat. Introduction. O'Reilly Network: Clustering with Tomcat. by Shyam Kumar Doddavula 07/17/2002

Java Web Services Training

Web Services Development In a Java Environment

02267: Software Development of Web Services

Web Service Testing. SOAP-based Web Services. Software Quality Assurance Telerik Software Academy

WebSphere ESB Best Practices

T Network Application Frameworks and XML Web Services and WSDL Tancred Lindholm

ebay : How is it a hit

Middleware Lou Somers

How To Create A C++ Web Service

A standards-based approach to application integration

Apache CXF Web Services

Connecting Custom Services to the YAWL Engine. Beta 7 Release

Developing a Web Server Platform with SAPI Support for AJAX RPC using JSON

1. Introduction 2. Getting Started 3. Scenario 1 - Non-Replicated Cluster 4. Scenario 2 - Replicated Cluster 5. Conclusion

Writing Grid Service Using GT3 Core. Dec, Abstract

The Design and Implementation of Unified Invoking Component Based on Web Services Framework

Introduction to WebSphere Process Server and WebSphere Enterprise Service Bus

Introduction into Web Services (WS)

Web Services and Service Oriented Architectures. Thomas Soddemann, RZG

Copyright. Restricted Rights Legend. Trademarks or Service Marks. Copyright 2003 BEA Systems, Inc. All Rights Reserved.

Web Services Advanced Topics

JAVA API FOR XML WEB SERVICES INTRODUCTION TO JAX-WS, THE JAVA API FOR XML BASED WEB SERVICES (SOAP, WSDL)

SOA Best Practices (from monolithic to service-oriented)

Web Services. Distributed Object Systems 11. Web Services, SOAP and NET. Web Applications. Web Services. Web services vs Distributed Objects

WSDL Example (Interface) WSDL Example (Implementation) Universal Description, Discovery and Integration. UDDI Usage

OpenScape Voice V8 Application Developers Manual. Programming Guide A31003-H8080-R

irods and Metadata survey Version 0.1 Date March Abhijeet Kodgire 25th

Lesson 4 Web Service Interface Definition (Part I)

Introduction to Oracle WebLogic. Presented by: Fatna Belqasmi, PhD, Researcher at Ericsson

JAX-WS Developer's Guide

e-gov Architecture Service Interface Guidelines

Chapter 1: Web Services Testing and soapui

Course Description. Course Audience. Course Outline. Course Page - Page 1 of 5

IBM SPSS Collaboration and Deployment Services Version 6 Release 0. Single Sign-On Services Developer's Guide

Server based signature service. Overview

How To Develop A Web Service In A Microsoft J2Ee (Java) 2.5 (Oracle) 2-Year Old (Orcient) 2Dj (Oracles) 2E (Orca) 2Gj (J

JBoss SOAP Web Services User Guide. Version: M5

Introduction. Tom Dinkelaker, Ericsson Guido Salvaneschi, Mira Mezini, TUD

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

Learn Oracle WebLogic Server 12c Administration For Middleware Administrators

Introduction to Service Oriented Architectures (SOA)

SoapUI NG Pro and Ready! API Platform Two-Day Training Course Syllabus

Acknowledgments. p. 55

REST web services. Representational State Transfer Author: Nemanja Kojic

Web-Service Example. Service Oriented Architecture

Web Traffic Capture Butler Street, Suite 200 Pittsburgh, PA (412)

Internationalization and Web Services

Business Process Execution Language for Web Services

Virtual Credit Card Processing System

Realtests.C questions

Chapter 2 TOPOLOGY SELECTION. SYS-ED/ Computer Education Techniques, Inc.

WCF WINDOWS COMMUNICATION FOUNDATION OVERVIEW OF WCF, MICROSOFTS UNIFIED COMMUNICATION FRAMEWORK FOR.NET APPLICATIONS

A Survey Study on Monitoring Service for Grid

DEPLOYMENT ARCHITECTURE FOR JAVA ENVIRONMENTS

An Introduction to Globus Toolkit 3

Service-Oriented Architectures

CICS Modernization & Integration

Service-oriented architecture in e-commerce applications

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

Java Security Web Services Security (Overview) Lecture 9

Introduction to Web services for RPG developers

Connecting to WebSphere ESB and WebSphere Process Server

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

EMC XDS Repository Connector for ViPR

PROFESSIONAL. Node.js BUILDING JAVASCRIPT-BASED SCALABLE SOFTWARE. Pedro Teixeira WILEY. John Wiley & Sons, Inc.

Presentation Outline. Key Business Imperatives Service Oriented Architecture Defined Oracle SOA Platform SOA Maturity/Adoption Model Demo Q&A

Configuring Nex-Gen Web Load Balancer

Chapter 2: Remote Procedure Call (RPC)

Transcription:

Building Web Services with XML Service Utility Library (XSUL) Aleksander Slominski IU Extreme! Lab August 2005 Linked Environments for Atmospheric Discovery

Outline Goals and Features Creating Web Services with XSUL XML Schema, WSDL, <xwsdlc>, generated code: Xml Beans, Java Interface Embedded HTTP Container: connections and threading Accessing Web Services with XSUL Dynamic invocation, using generated Java Interface and XML Beans, asynchronous messaging Other Capabilities and Handlers Future work: Scalability and Reliability

Goals (No) One library to rule them all? Set of pieces that can be combined and recombined XML Schema (XS) 1.0 Support As complete as possible WSDL 1.1 doc/literal for SOAP 1.1/1.2 Messages described in XS Service composed out of messages: in and out Handlers: enable security, load balancing, etc. Implement and use services with minimal number of XSUL APIs Or none at all: service implementation should deal with logic and be SOAP toolkit independent XSUL as easy as LEGO

Features HTTP 1.0/1.1 One-way messaging and Request-response (RPC) message exchange patterns (over HTTP) SOAP 1.1/1.2 (only minimal support for SOAP-ENC) WSDL 1.1 doc/literal (minimally support rpc/encoded). WS-Addressing and asynchronous messaging Extended Apache WSIF API (complex types etc) XML Schemas (through XmlBeans) Security (next slide)

Security This is one of the most important requirements for Grid Web Services TLS/SSL GSI Security (grid-proxy, myproxy) WS-Security and WS-SecureConversation Security based on capabilities model XPola and CapMan Work on load balancing to boost time to process signed messages

Service Development Typical steps involved Obtain WSDL (Registry, Google, Write it) WSDL XS WSDL Compiler <xwsdlc> in build.xml Java interface Java Interface Java Class implements Java Interface (logic), Start Service

XML Schema in WSDL Apache XML Beans is used to generate Java classes that are encapsulating XML Schema Apache XmlBeans has the most complete support for XML Schema in Java WSDL 1.1 can contain any schema but binding must be doc/literal Very limited support for SOAP Encoding Ant task <xwsdlc> is used to process WSDL, call XML Beans code generator, and generate Java Interface Details online in XSUL Guide (including example)

Example Schema (Guide) <complextype name="decoderparameters"> <annotation><documentation xml:lang="en"> Type of input message: sequence of parameters. </documentation></annotation> <sequence> <element minoccurs="1" maxoccurs="1" name="topic" type="xsd:string"/> <element minoccurs="1" maxoccurs="1" name="correlationid" type="xsd:string"/> <element minoccurs="1" maxoccurs="1" name="inputfile" type="xsd:string"/> <element minoccurs="1" maxoccurs="1" name="outputdirectory" type="xsd:string"/> <element minoccurs="0" maxoccurs="1" name="stringarr" type="typens:arrayofstring"/> <element name="nproc" type="xsd:int" minoccurs="0" maxoccurs="1" default="64" > <annotation><documentation xml:lang="en"> Example parameter with default value. </documentation></annotation> </element> </sequence> <attribute name="somestringattrib" type="string"/> <attribute name="someboolattrib" type="boolean"/> </complextype>

Example WSDL Scaffolding required to declare what is input message and what is output message for <element name="decoder_run_inputparams" type="typens:decoderparameters "/> <message name="decoder_run_requestmessage"> <part name="run_inputparameters" element="typens:decoder_run_inputparams"/> </message> <message name="decoder_run_responsemessage"> <part name="run_outputparameters" element="typens:decoder_run_outputparams"/> </message> <porttype name="decoderporttype"> <operation name="rundecoder"> <input name="decoder_run_requestmessage" message="wsdlns:decoder_run_requestmessage"/> <output name="decoder_run_responsemessage" message="wsdlns:decoder_run_responsemessage"/> </operation> </porttype>

Generated Java Interface public interface DecoderPortType { public RunDecoderResultDocument rundecoder(rundecoderdocument inputmsg); }

Implementing Service class DecoderImpl implements DecoderPortType { public RunDecoderResultDocument rundecoder( RunDecoderDocument input) { //extract parameters from input message DecoderParameters params = input.getrundecoder(); String inputfile = params.getinputfile(); String outputdirectory = params.getoutputdirectory(); // do something with input logger.finest("got inputfile="+inputfile +" outputdirectory="+outputdirectory); // prepare response message RunDecoderResultDocument resultdoc = RunDecoderResultDocument.Factory.newInstance(); DecoderResults result = resultdoc.addnewrundecoderresult(); result.setstatus("ok"); return resultdoc; } }

Embedded HTTP Container Start simple Web Server that provides Web Service: HttpBasedServices httpservices = new HttpBasedServices(tcpPort); XService xsvc = httpservices.addservice( new XmlBeansBasedService( decoder, wsdl, new DecoderImpl())); xsvc.startservice(); WSDL for service will be available at http://host:port/decoder?wsdl

HTTP Mini Server Key Features Implements HTTP 1.0 and common subset of HTTP 1.1 Supports Keep-Alive Client can reuse connection to send multiple requests and receive responses Each connection creates A new thread Number of threads limited by number of connections (by default around 100s) Other policies possible (Tomcat container) Supports SSL/TLS and GSI through extensible socket factory abstraciton

Accessing Web Service Web Service Invocation Framework (WSIF) Dynamic service invocations without code generation java xsul.dii.xsuldynamicinvoker WSDL porttype parameters Example: java xsul.dii.xsuldynamicinvoker http://somehost/decoder?wsdl rundecoder Topic File Dir 1

Service Invocation Using XML Beans: steps involved Obtain WSDL (Registry, Google, Write it) WSDL XS WSDL Compiler <xwsdlc> in build.xml Java interface Java Interface Get stub (proxy) for remote Service based on WSDL

Accessing Web Service using XML Beans Prepare message using Java classes generated by XML beans RunDecoderDocument inputmsg = RunDecoderDocument.Factory.newInstance(); DecoderParameters params=inputmsg.addnewrundecoder(); params.setinputfile( ); params.setoutputdirectory( ); Access service by using WSDL and generated Java Interface: DecoderPortType stub = (DecoderPortType) XmlBeansWSIFRuntime.newClient(wsdlLoc);.generateDynamicStub(DecoderPortType.class); RunDecoderResultDocument outputmsg = stub.rundecoder(inputmsg);

Asynchronous Messaging Server sied is automatically async enabled using WS-Addressing to describe where message goes Client Side: AdderPT stub = WSIFRuntime.newClient(wsdlLoc).useAsyncMessaging( correlator ).generatedynamicstub(adderpt.class); Correlator is an interface that when implemented provides ability to correlate response message (asynchronous) with a request message sent WS-Addressing correlator: client acts as a server that can receive asynchronous messages Mini HTTP Server is started on client side WS-MsgBox correlator: works over firewalls

Other modules (bricks) WS-Dispatcher and WS-MsgBox Low level HTTP Client/Server libraries SOAP 1.1 and SOAP 1.2 and common SOAP abstraction WSDL 1.1 support WS-Addressing Some RPC SOAP Encoding support Security: digital signatures, XPola, CapMan WSIF API implementation Sticky SOAP Headers Asynchronous invocation support Handlers framework

Handler Chain Execution Handlers contain code independent from service implementation (such as security) Client side first processing outgoing message then incoming message and no need to create faults exceptions are local Server side execution flow: Handler A Handler B Handler B Service Impl (Java Class)

Future Work (XSUL 3.x) Scalability and reliability Monitoring Easy way to check service health Load balancing / clustering Higher performance, scalability, failover Improved WS-MsgBox (clustered) Integration with Servlet Container Deploy services to Tomcat WSDL 2.0

Load Balancing: DNS DNS resolves one service.lead.org to multiple IP addresses Host A (x.y.z.1) Service Container Host B (x.y.z.2) Service Container Database

Load Balancing: Dispatcher service.lead.org Service Dispatcher Host X (10.0.0.1) Host Y (10.0.0.2) Service Container Service Container Database

Load Balancing: Fail-Over service.lead.org Service Dispatcher Host X (10.0.0.1) alive alive Host Y (10.0.0.2) Service Container Service Container Database

Additional notes This kind of load balancing is invisible to service clients Exactly as high-traffic Web Server is balanced It may be desirable to add load balancing to client: WS Reliable Messaging is required for reliability Client retries messages until they are acknowledged Good place to add invisible load balancing on client side DNS level balancing an dispatcher/failover can be combined to avoid SPoF (Single Point of Failure) Database can be replicated For example master (read/write) and slaves (read) Portal may require sticky sessions and/or session replication