WS/XML Service Utility Library (WS and LEGO?)

Slides:



Advertisements
Similar presentations
1 Dynamic Proxies Explained Simply. 2 Dynamic Proxies License Copyright © 2008 Ciaran McHale. Permission is hereby granted, free of charge, to any person.
Advertisements

COS 461 Fall 1997 Network Objects u first good implementation: DEC SRC Network Objects for Modula-3 u recent implementation: Java RMI (Remote Method Invocation)
SOAP.
RPC Robert Grimm New York University Remote Procedure Calls.
Implementing Remote Procedure Calls Andrew Birrell and Bruce Nelson Presented by Kai Cong.
Webservices using JAXB and JAX-WS Lalit Bhatt SpiderLogic
FONG CHAN SING (143334) WONG YEW JOON (143388). JAVA RMI is a distributive system programming interface introduced in JDK 1.1. A library that allows an.
6/11/2015Page 1 Web Services-based Distributed System B. Ramamurthy.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
Java RMI, JAX-RPC and JWSDP
Introduction to Remote Method Invocation (RMI)
SOAP Chandra Dutt Yarlagadda Introduction  Why ?  What ?  How ?  Security Issues in SOAP  Advantages  Uses  Conclusion.
A Framework for Smart Proxies and Interceptors in RMI Nuno Santos P. Marques, L. Silva CISUC, University of Coimbra, Portugal
1 Lecture 22 George Koutsogiannakis Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
1 3. Implementing Web Services 1.Create SOAP proxy interfaces and WSDL based service descriptions 2.Register/publish services 3.Stores service descriptions.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 12 Communicating over.
Presentation: SOAP in a distributed object framework, Application Servers & AXIS SOAP.
COP 4991 Component Based Software Development Lecture #4 Java Web Services Onyeka Ezenwoye.
An program As a simple example of socket programming we can implement a program that sends to a remote site As a simple example of socket.
James Holladay, Mario Sweeney, Vu Tran. Web Services Presentation Web Services Theory James Holladay Tools – Visual Studio Vu Tran Tools – Net Beans Mario.
11 September 2008CIS 340 # 1 Topics To examine the variety of approaches to handle the middle- interaction (continued) 1.RPC-based systems 2.TP monitors.
INMIDIO: an INteroperable MIddleware for service Discovery and service InteractiOn Daniele Sacchetti
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
1 Cisco Unified Application Environment Developers Conference 2008© 2008 Cisco Systems, Inc. All rights reserved.Cisco Public Introduction to Etch Scott.
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
What is a Servlet? Java Program that runs in a Java web server and conforms to the servlet api. A program that uses class library that decodes and encodes.
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch.
Overview of Grid Webservices in Distributed Scientific Applications Dennis Gannon Aleksander Slominski Indiana University Extreme! Lab.
Web Service Definition Language. Web Services: WSDL2 Web Service Definition Language ( WSDL ) What is a web service? [ F. Leymann 2003 ] A piece of code.
Remote Method Invocation RMI architecture stubs and skeletons for remote services RMI server and client in Java Creating an RMI Application step-by- step.
WP3 Implementing R-GMA grid services in GT3 Abdeslem Djaoui & WP3 Grid Services Task Force 7 th EU Datagrid meeting 26/09/2003
SOAP RMI Aleksander Slominski, Madhusudhan Govindaraju, Randall Bramley, Dennis Gannon Indiana University Extreme! Lab A New-Old Programming Model for.
Net-centric Computing Web Services. Lecture Outline  What is Web Service  Web Service Architecture  Creating and using Java Web Services  Apache Axis.
Beginning 자바 웹 서비스 웹 서비스 호출 Meilan JIANG Cyber infrastructure Research Laboratory Department of Advanced Technology.
The Java API for XML-Based Web Services. A Web Service example in Java SOAP-awareServlet (e.g. Apache Axis2) SOAP-awareServlet Any class processing the.
Apache Axis2 XML Based Client API.
Introduction to Servlets
Client-Server Communication
Principles of Software Development
The Java Dynamic Proxy.
Chapter 5 Remote Procedure Call
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Web Services-JAX-RPC JAX-RPC enables a Web Service endpoint to be developed using either a Java Servlet or Enterprise JavaBeans (EJB) component model.
Notes on WSMAN Client for OpenPegasus
Outline SOAP and Web Services in relation to Distributed Objects
Java Distributed Computing
Dynamic Proxy Proxy: Addition to the Java 1.3 reflection package:
Outline SOAP and Web Services in relation to Distributed Objects
Java Socket Programming and Java RMI CS
Web Server Administration
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Introduction to Web Services
Understanding Web Services based on dev. java
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
CSE 451: Operating Systems Spring 2012 Module 22 Remote Procedure Call (RPC) Ed Lazowska Allen Center
WebServices Using JAX-RPC
Introduction to Web Services
Student: Popa Andrei-Sebastian
Distributed System using Web Services
Distributed System using Web Services
Web Services Enhancements 2.0
Java Socket Programming and Java RMI CSE 291
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
System Models Bina Ramamurthy 9/7/2019 B.Ramamurthy.
Presentation transcript:

WS/XML Service Utility Library (WS and LEGO?) Aleksander Slominski

XML Web Services Fusion Transport (ex. HTTP) Security (XML dsig.) WS/XML Service RPC style Reliable Messaging Type Mapping Future? WS-Stuff

WS/LEGO Game Puzzle of WS-Standards? How to connect blocks? XML Infoset Unlimited Number Of Connections As much as you need?! Build Your Own LEGO Set Keep Experimenting! LEGO comes from Danish words "LEg GOdt" meaning "play well". Ironically, in Latin the lego means "I study" or "I put together"

More Bricks, More Fun Reliable Messaging Layer RPC Layer DSig Layer HTTP Transport SMTP Transport

Virtual Laboratory Toolset: Very Quick XML Service Creation Allow Building Any Kind of XML Services From XML router to RMI runtime Encourage Experimentations Set of Small Modules Allow Easy Code Recombination XML Infoset as connecting glue

XSUL Layers Client Stack Server Stack Soap RPC Client Invoke Java interface Type Mapping (XML  Java) Soap RPC Service Use Java Object Invoker send XML document Processor receive XML document Pluggable Module SOAP/HTTP Invoker SOAP/HTTP Processor Globus / XML Digital sig. HTTP 1.x Client (HTTP 1.x POST/GET) HTTP 1.x Server (HTTP 1.x POST/GET) Common / Utility Legend: depends on XML Infoset

Modules Theory vs. Practice

HTTP Client private HttpClientConnectionManager connMgr = HttpClientConnectionManager.newInstance(); HttpClientRequest req = connMgr.connect(host, port, 4 * 60 * 1000); req.setRequestLine("POST", requestUri, "HTTP/1.0"); HttpClientResponse resp = req.sendHeaders(); OutputStream out = resp.getBodyOutputStream(); Writer utf8Writer = new Utf8Writer(out, 8*1024); … more

Invoker (SOAP 1.1 / HTTP) Soap11HttpDynamicInfosetInvoker invoker = new Soap11HttpDynamicInfosetInvoker() invoker.setLocation("http://localhost:"+port); XmlElement request = builder.parseFragmentFromReader(new StringReader("<getN><arg>/hello</></>")); XmlElement response = invoker.invokeMessage(request);

SOAP RPC Client TypeHandlerRegistry typeMapping = XsdTypeHandlerRegistry.getInstance(); Soap11InvocationHandler handler = new Soap11InvocationHandler(invoker, typeMapping); XDirectoryService ref = (XDirectoryService) Proxy.newProxyInstance( Thread.currentThread().getContextClassLoader(), new Class[] { XDirectoryService.class }, handler); XmlNode result = ref.getNode("/hello");

Client Stack RPC Client Invoker (SOAP 1.1 / HTTP) HTTP Client Translates Java Interface into XML message Invoker (SOAP 1.1 / HTTP) XML Message is wrapped into SOAP 1.1 Envelope and serialized into transport output stream HTTP Client Actual sending happens here! Design Issues Can add new transport (new invoker)? Can inject XML processing layers? XML transformations: digital signatures?

Adding DSig Module To Client App Soap11HttpDynamicInfosetInvoker invoker = new Soap11HttpDynamicInfosetInvoker() { public XmlDocument invokeXml(XmlDocument request) throws DynamicInfosetInvokerException { // WSRMHandler.getInstance().augmentRequest(request); XmlDocument signedRequest = GlobusCredSOAPEnvelopeSigner.getInstance().signSoapMessage(request); XmlDocument response = super.invokeXml(signedRequest); GlobusCredSOAPEnvelopeVerifier.getInstance().verifySoapMessage(response); // WSRMHandler.getInstance().processResponse(response); return response; } };

HTTP Server server = new HttpMiniServer(serverPort); servlet= new MyServlet(); server.useServlet(servlet); server.startServer(); class MyServlet extends HttpMiniServlet { public void service(HttpServerRequest req, HttpServerResponse res) { … more }

Processor (SOAP 1.1 / HTTP) Soap11HttpDynamicInfosetProcessor processor = new Soap11HttpDynamicInfosetProcessor() { public XmlElement processMessage(XmlElement message) { message.setParent(null); message.setName(message.getName()+"Response"); return message; } }; processor.setServerPort(port); processor.start(); Full SOAP Echo Service Impl!

SOAP RPC Server TypeHandlerRegistry typeMapping = XsdTypeHandlerRegistry.getInstance() XDirectoryService serviceLogic = new XDirectoryServiceImpl(); final Soap11ReflectionBasedService service = new Soap11ReflectionBasedService(serviceLogic, typeMapping); … Soap11HttpDynamicInfosetProcessor processor = new Soap11HttpDynamicInfosetProcessor() { public XmlElement processMessage(XmlElement requestMsg) XmlElement responseMsg = service.processMessage(requestMsg); return responseMsg; } };

Server Stack RPC Server Processor (SOAP 1.1 / HTTP) HTTP Server User Java Reflection to convert XML message into Java invocation Processor (SOAP 1.1 / HTTP) Accept XML Message that is wrapped into SOAP 1.1 Envelope and unwrap it HTTP Server Listen for XML messages! Design Issues Can add new transport (new listening server) Can inject XML processing layers XML transformations: digital signatures and authorization checks?

Using DSig/Authz in App Soap11HttpDynamicInfosetProcessor processor = new Soap11HttpDynamicInfosetProcessor() { public XmlDocument processSoap11Envelope(XmlElement envelope) { XmlDocument respDoc = null; SignatureInfo si = SOAPEnvelopeVerifier.getInstance().verifySoapMessage(envelope); if(!isAuthorized(si.getSubjectDn(), envelope)) { XmlDocument fault = Soap11Util.wrapBodyContent(Soap11Util.generateSoap11Fault( XmlConstants.NS_URI_SOAP11, "Client", "unathorized access")); respDoc = fault; } else { respDoc = super.processSoap11Envelope(envelope); } XmlDocument signedDoc = GlobusCredSOAPEnvelopeSigner.getInstance().signSoapMessage(respDoc); return signedDoc; };

WORK IN PROGRESS!!! OSS site (CVS hosted in SourceForge) www.extreme.indiana.edu/xgws/xsul www.extreme.indiana.edu/viewcvs/xsul WikiWiki And Blog portal.extreme.indiana.edu:3456/xsul Place to Track Progress And Gather Feedback Bugzilla www.extreme.indiana.edu/bugs Your Feedback is Welcome Use Modules and Build Your Own Module

Conclusions Encourages experimentation Easy to add new modules LEGO “experience” Easy to add new modules WS-RM, WSS4J, WSDL Invoker, … Better Than CORBA? Maybe … … but higher “playability” level  Add what needed Piece by piece …

Addendum As More is Better …

Adding Caching to Improve DSig Performance Soap11HttpDynamicInfosetProcessor processor = new Soap11HttpDynamicInfosetProcessor() { public XmlDocument processSoap11Envelope(XmlElement envelope) { XmlDocument respDoc = null; if( (respDoc = lookupCachedResponse(envelope) ) != null ) { { //NOTE: needs to check that request is idempotent and resource is not changed! return respDoc; } SignatureInfo si = GlobusCredSOAPEnvelopeVerifier.getInstance().verifySoapMessage(envelope); if(!isAuthorized(si.getSubjectDn(), envelope)) { XmlDocument fault = Soap11Util.wrapBodyContent(Soap11Util.generateSoap11Fault( XmlConstants.NS_URI_SOAP11, "Client", "unathorized access")); respDoc = fault; } else { XmlDocument respDoc = super.processSoap11Envelope(envelope); XmlDocument signedDoc = GlobusCredSOAPEnvelopeSigner.getInstance().signSoapMessage(respDoc); return signedDoc; };

DSig Steps Breakdown Client Server Generate SOAP call Sign Send … wait Receive Verify DSig Pass result Receive SOAP Message Verify DSig Reflection Based Invocation Sign Send SOAP Message

RPC Client implementation details (Using Dynamic Proxy, without WSDL) class Soap11InvocationHandler implements InvocationHandler { public Object invoke(Object proxy, Method method, Object[] params) throws Throwable { String methodName = method.getName(); XmlElement request = builder.newFragment( methodName ); for (int i = 0; i < params.length; i++) { XmlElement param = registry.javaToXmlElement(params[i],null, "param"+i); request.addChild(param); } XmlElement response = invoker.invokeMessage(request); // map back to Java return type or Exception if S:Fault …

Client Side APIs WSDL/RMI GlobalWeatherSoap gws = (GlobalWeatherSoap) WsdlNaming.lookup("http://www.example.com/weather?WSDL"); String s = gws.GetWeather(cityName, countryName) WSDL/Dynamic Proxy Stub GlobalWeatherSoap ref = (GlobalWeatherSoap) WsdlNaming.lookup("http://www.example.com/weather?WSDL“, GlobalWeatherSoap.class); WSDL/Dynamic Invocation Interface (DII) WsdlDynamicInfosetInvoker dii = WsdlNaming.lookup("http://www.example.com/weather?WSDL"); //NOTE: invoke() uses new JDK 1.5 multi args. “...” instead new Object[] {}); XmlElement result = dii.invoke("GetWeather", cityName, countryName); String cityName = result.string("cityName");