© 2009 IBM Corporation 1 JAX-WS 2.1 Support For WS-Addressing In WebSphere Application Server V 7 18 March 2010.

Slides:



Advertisements
Similar presentations
WS-Addressing F2F Meeting Nov 05 WSDL extensions for Async support.
Advertisements

Service Description: WSDL COMP6017 Topics on Web Services Dr Nicholas Gibbins –
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
SOAP.
Web Services Web Services are the basic fundamental building blocks of invoking features that can be accessed by an application program. The accessibility.
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
Windows Communication Foundation and Web Services.
J2ME Web Services Specification.  With the promise to ease interoperability and allow for large scale software collaboration over the Internet by offering.
6/11/2015Page 1 Web Services-based Distributed System B. Ramamurthy.
Slide 1 EE557: Server-Side Development Lecturer: David Molloy Room: XG19 Mondays 10am-1pm Notes:
Intro to Programming Java Web Services using the Java TM API for XMLWeb Services (JAX-WS) Bill Champlin UCCS / CS526 Spring ‘09.
Introduction SOAP History Technical Architecture SOAP in Industry Summary References.
1 © Talend 2014 Service Registry / WS-Policy Registry Training Slides 2014 Jan Bernhardt Zsolt Beothy-Elo
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.
C Copyright © 2009, Oracle. All rights reserved. Appendix C: Service-Oriented Architectures.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Grid Computing, B. Wilkinson, 20043b.1 Web Services Part II.
Introducing Axis2 Eran Chinthaka. Agenda  Introduction and Motivation  The “big picture”  Key Features of Axis2 High Performance XML Processing Model.
Presentation: SOAP in a distributed object framework, Application Servers & AXIS SOAP.
1 HRS2422 Web Services JAX-WS and SOAP Introduction  Web service – A software component stored on one computer that can be accessed via method.
Web Services (SOAP, WSDL, and UDDI)
Web servisu izstrāde JAX-WS. Ievads JAX-WS = Java API for XML Web Services JAX-WS ir fundamentāla Web servisu izstrādes tehnoloģija Java EE 5 un Java.
James Holladay, Mario Sweeney, Vu Tran. Web Services Presentation Web Services Theory James Holladay Tools – Visual Studio Vu Tran Tools – Net Beans Mario.
Web Server Administration Web Services XML SOAP. Overview What are web services and what do they do? What is XML? What is SOAP? How are they all connected?
Lecture 15 Introduction to Web Services Web Service Applications.
Dodick Zulaimi Sudirman Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology.
1 ® Copyright 2009 Adobe Systems Incorporated. All rights reserved. Adobe confidential. 1 Building Portlets with ColdFusion Pete Freitag Foundeo, Inc.
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
1 Web Service Description Language (WSDL) 大葉大學資工系.
SCA Bindings Simon Holdsworth Piotr Przybylski. Agenda n SCA Bindings Overview l Bindings TC Charter n Bindings l Web Services Binding l JMS Binding l.
Copyright © 2013 Curt Hill SOAP Protocol for exchanging data and Enabling Web Services.
XML and Web Services (II/2546)
S imple O bject A ccess P rotocol Karthikeyan Chandrasekaran & Nandakumar Padmanabhan.
Kemal Baykal Rasim Ismayilov
Steve Graham WS-ResourceFramework Modeling Stateful Resources With Web services OASIS WSRF TC F2F Wednesday, April 28th, 2004.
.NET Mobile Application Development XML Web Services.
Introduction to Web Services Presented by Sarath Chandra Dorbala.
1 G52IWS: Web Services Description Language (WSDL) Chris Greenhalgh
DEVELOPING WEB SERVICES WITH JAVA DESIGN WEB SERVICE ENDPOINT.
SOAP, Web Service, WSDL Week 14 Web site:
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.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 9 Web Services: JAX-RPC,
Apache Axis2 XML Based Client API.
Java Web Services Orca Knowledge Center – Web Service key concepts.
Windows Communication Foundation and Web Services
Web Programming Developing Web Applications including Servlets, and Web Services using NetBeans 6.5 with GlassFish.V3.
Sabri Kızanlık Ural Emekçi
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
Chapter 5 Remote Procedure Call
WEB SERVICES.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Writing simple Java Web Services using Eclipse
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.
Outline SOAP and Web Services in relation to Distributed Objects
Outline SOAP and Web Services in relation to Distributed Objects
Windows Communication Foundation and Web Services
Knowledge Byte In this section, you will learn about:
Implementing a service-oriented architecture using SOAP
Web Server Administration
Service-centric Software Engineering
Chapter 9 Web Services: JAX-RPC, WSDL, XML Schema, and SOAP
Deepak Shenoy Agni Software
WebServices Using JAX-RPC
Introduction to Web Services
Distributed System using Web Services
WEB SERVICES From Chapter 19, Distributed Systems
Distributed System using Web Services
Presentation transcript:

© 2009 IBM Corporation 1 JAX-WS 2.1 Support For WS-Addressing In WebSphere Application Server V 7 18 March 2010

© 2009 IBM Corporation Introduction ■ IBM WebSphere Application Server V7 includes support for the Java API for XML-Based Web Services (JAX-WS) 2.1 specification. ■ JAX-WS 2.1 is a maintenance release of Java Specification Request (JSR) 224 that extends the functionality provided by the JAX-WS 2.0 specification with new capabilities. ■ The most significant new capability is support for Web Services Addressing (WS- Addressing) in the Application Programming Interface (API). ■ In this session, the speaker will work through the steps necessary to create a sample application that shows how to use this new WS-Addressing support to write a stateful web service. IBM Presentation Template Full Version

© 2009 IBM Corporation What is WS-Addressing? ■ EndpointReference (EPR) is simply a URI plus some additional information. An EPR can be flowed between services and clients and used by a client to target the endpoint that it represents. ■ Message Addressing Properties (MAPs) are standardised SOAP Headers that provide transport-neutral way of passing addressing information (eg, replyTo address). ■ MAPs may be useful to implementors of other WS* standards eg WS-AT but unlikely that an application will deal directly with the SOAP Headers. ■ EPRs can be sent in the body of the SOAP message and therefore used to propagate a reference to an endpoint back to the client. For example, WSA can then be used to provide stateful web service support. IBM Presentation Template Full Version

© 2009 IBM Corporation IBM history with WS-Addressing ■ IBM was an early implementer and so have an extensive API/SPI for WS-Addressing ■ WebSphere Application Server v6.0 provided support for WS-AtomicTransaction that used WS-Adressing support internally. NO PUBLIC SUPPORT! –This was the submission specification only ■ WebSphere Application Server v6.1 provided API/SPI support for customers use of WSAddressing v1.0. –Final specification and submission specification supported –WS-RF implementation in WAS IBM Presentation Template Full Version

© 2009 IBM Corporation Motivation for JAX-WS ■ Better platform independence for Java applications. –Using JAX-WS APIs, development of Web services and clients is simplified with better platform independence for Java applications. JAX-WS takes advantage of the dynamic proxy mechanism to provide a formal delegation model with a pluggable provider. This is an enhancement over JAX-RPC, which relies on the generation of vendor-specific stubs for invocation. ■ Annotations –JAX-WS supports the use of annotations based on the Metadata Facility for the Java Programming Language (JSR 175) specification, the Web Services Metadata for the Java Platform (JSR 181) specification and annotations defined by the JAX-WS 2.1 specification. ■ Invoking Web services asynchronously –With JAX-WS, Web services are called both synchronously and asynchronously. JAX- WS adds support for both a polling and callback mechanism when calling Web services asynchronously. ■ Using resource injection –JAX-WS uses Java EE 5 feature of resource injection to further simplify development of Web services. ■ This talk is not a comparison of JAX-RPC vs JAX-WS. See this developerWorks article for more on this topic: IBM Presentation Template Full Version

© 2009 IBM Corporation WebSphere, JAX-WS and WS-Addressing specifications support ■ JAX-WS 2.0 –Feature Pack for Web Services in WebSphere Application Server v6.1 ■ JAX-WS 2.1 –Support for WSAddressing 1.0 Core, SOAP Binding and WSDL Binding –WebSphere Application Server v7.0 ■ JAX-WS 2.2 –Support for WS-Addressing 1.0 Metadata specification ■ Websphere Application Server has integrated its existing support for the submission spec with the JAX-WS programming model. IBM Presentation Template Full Version

© 2009 IBM Corporation JAX-WS 2.1 API for WS-Addressing IBM Presentation Template Full Version ■ JAX-WS 2.1 EPR Creation –BindingProvider.getEndpointReference() –Endpoint.getEndpointReference() –MessageContext.getEndpointReference() ■ JAX-WS 2.1 EPR Propagation –Using JAXB 2.1 bind W3C EPR to W3CEndpointReference class –Marshall/Unmarshall W3CEndpointReference class using JAXB

© 2009 IBM Corporation Next... ■ EndpointReferences –Creating, using, converting ■ EndpointReferences –Fragile, WLM, HA ■ Enabling and Disabling WS-Addressing ■ Annotations for WS-Addressing in JAX-WS 2.1 IBM Presentation Template Full Version

© 2009 IBM Corporation Creating EPRs using an address ■ IBM API/SPI v6.1 onwards ■ JAX-WS programming model v7 onwards IBM Presentation Template Full Version

© 2009 IBM Corporation Creating EPRs using WSDL service name and endpoint (port) name ■ IBM API/SPI v6.1 onwards ■ JAX-WS programming model v7 onwards IBM Presentation Template Full Version

© 2009 IBM Corporation Creating EPRs to self. ■ IBM API/SPI v6.1 onwards –Use previous example i.e. EndpointReferenceManager.createEndpointReference(service_name, endpoint_qname) ■ JAX-WS 2.1 Submission Specification –No equivalent – use IBM API/SPI i.e. EndpointReferenceManager.createEndpointReference(service_name, endpoint_qname) ■ JAX-WS programming model v7 onwards: Creating an EPR to self via the WebServiceContext. IBM Presentation Template Full Version

© 2009 IBM Corporation Retrieving ReferenceParameters ■ Returning an EPR containing 'conversation' information, eg. CartID use the Reference Parameters. These can be accessed in the application code, or the EPR is simply used to target a message, at which point the Reference Parameters become SOAPHeader elements. ■ IBM API/SPI v6.1 onwards and JAX-WS 2.1 Submission specification ■ JAX-WS 2.1 programming model: IBM Presentation Template Full Version

© 2009 IBM Corporation Retrieving ReferenceParameters ■ JAX-WS 2.1 also allows you to use the javax.xml.ws.WebServiceContext to pass state information: ■ You must mark a variable ■ This variable must be either of type Object (the default) or of type WebServiceContext. ■ WebServiceContext holds the MessageContext for the request being processed. ■ The MessageContext contains a bag of properties, both provided ones plus you can set your own. IBM Presentation Template Full Version

© 2009 IBM Corporation IBM proprietary SPI IBM Presentation Template Full Version

© 2009 IBM Corporation IBM proprietary SPI IBM Presentation Template Full Version

© 2009 IBM Corporation Integrating IBM proprietary SPI with JAX-WS 2.1 API for WS- Addressing IBM Presentation Template Full Version

© 2009 IBM Corporation Integrating IBM proprietary with JAX-WS example IBM Presentation Template Full Version ■ EndpointReferenceConverter class enables HA/WLM EndpointReferences to be created and used within a JAX-WS 2.1 application.

© 2009 IBM Corporation Wsimport -b ■ wsimport tool generates client-side artifacts, mapping endpoint references in the WS- Addressing Core 1.0 namespace to the W3CEndpointReference class. ■ To map endpoint references in the WS-Addressing Member Submission namespace to the SubmissionEndpointReference class you will need to specify the provided binding file, SubmissionEndpointReference.xjb ■ This is done using a -b parameter to the wsimport tool. ■ The binding file can be found in the util directory of your WebSphere Application Server installation.

© 2009 IBM Corporation Next... ■ EndpointReferences –Creating, using, converting ■ EndpointReferences –Fragile, WLM, HA ■ Enabling and Disabling WS-Addressing ■ Annotations for WS-Addressing in JAX-WS 2.1 IBM Presentation Template Full Version

© 2009 IBM Corporation EPR generation in WebSphere Application Server : Fragile EPRs ■ WebSphere Application Server will generate the correct URI address for the EPR based on your deployment. ■ The EPR's address depends on whether the endpoint will be accessed directly or via an intermediary such as a proxy or firewall. ■ The simplest use of WS-Addressing is an EPR containing a URI to a service. ■ The host name and port of the node hosting the endpoint will be used to generate the EPR [address] URI. ■ This can be referred to as a Fragile EPR. It is valid only whilst that specific endpoint is available. IBM Presentation Template Full Version

© 2009 IBM Corporation Fragile EPRs with intermediary ■ Nothing much changes if there is an HTTP or IBM Proxy Server for WebSphere in front of WebSphere Application Server ■ The [address] URI will now point to the host and port configured for the intermediary to front this endpoint. IBM Presentation Template Full Version

© 2009 IBM Corporation WLM'able and non-WLM'able EPRs ■ There's more to IBM's EPR generation than first meets the eye. EPRs created by the WebSphere Application Server API will have some additional "value add" when used in a Websphere environment. ■ These EPRs, however, may still be used by non- Websphere clients. ■ An example of WebSphere Application Server workload-managed (WLM) cluster environment. ■ Messages (requests or responses) targeted at the EPR will be automatically workload managed as long as the server hosting the endpoint is fronted by a WebSphere Application Server proxy or WebSphere Application Server client in the same administrative cell. IBM Presentation Template Full Version

© 2009 IBM Corporation Stateful Web Services – Highly Available EPRs ■ So, what if you don't want the EPR to be workload managed. ■ A ShoppingCart instance might be a stateful session bean retaining in-memory state data. ■ Every request targeted at its EPR must be targeted at the same stateful session bean. ■ In a distributed environment, by creating the EPR and passing in an additional parameter (a reference to the stateful session bean) to the createEndpointReference method, you can ensure that affinity is maintained for requests targeted at the EPR in the cluster topologies described above. ■ Moreover, this support is fully integrated with the WebSphere Application Server stateful session bean high availability support. So, if the node containing your stateful session bean suddenly goes down, and the bean is failed over to another node, your EPR will still work. ■ You can also prevent WLM for non stateful session beans by passing a null reference to the createEndpointReference method. This is useful in a more general case where affinity is required to a specific server (for example, because an endpoint implementation locally caches state on the server on which the endpoint was created). IBM Presentation Template Full Version

© 2009 IBM Corporation Next... ■ EndpointReferences –Creating, using, converting ■ EndpointReferences –Fragile, WLM, HA ■ Enabling and Disabling WS-Addressing ■ Annotations for WS-Addressing in JAX-WS 2.1 IBM Presentation Template Full Version

© 2009 IBM Corporation Enabling and disabling WS-Addressing IBM Presentation Template Full Version ■ Service clients: WS-Addressing is disabled by default ■ Attach a Web services policy set to the client and optionally: –Enable mandatory WS-Addressing –Enable WS-Policy policy sharing ■ WebServiceFeature in client code ■ Specify the UsingAddressing required=true/false element in the WSDL document for the service. Not for dispatch clients that don't use the WSDL. ■ Set the com.ibm.websphere.webservices.use.asyn c.mep property on the client request context. ■ Use the IBM proprietary WS-Addressing SPI to add message-addressing properties to the message request context. ■ Service providers: WS-Addressing is enabled by default ■ Attach a Web services policy set to the client and: –Enable mandatory WS-Addressing –Enable WS-Policy policy sharing ■ Annotations in service code ■ Specify the UsingAddressing required=true/false element in the WSDL document for the service. If the service uses the Addressing annotation and you generate the WSDL document from the code, the UsingAddressing element already exists. This method does not apply to Dispatch clients, because these clients do not use the WSDL document. ■ Use the IBM proprietary WS-Addressing SPI to add message-addressing properties to the message request context.

© 2009 IBM Corporation Enabling WS-Addressing in WAS ■ Attach a WebSphere Web services policySet –Select WS-Addressing is mandatory to specify that WS-Addressing information must be included in SOAP message headers. For servers, this setting means that the server returns a fault if it receives a message that does not contain a WS-Addressing header. For clients, this setting means that WS-Addressing headers are always added to SOAP messages. If you have enabled WS-Policy, this requirement is communicated between servers and clients that support WS-Policy. –In the Messaging style box, select the message exchange pattern to use: Synchronous and asynchronous. The targeting of response messages is not restricted. Synchronous only. Response messages must be targeted at the WS-Addressing anonymous URI. Asynchronous only. Response messages must not be targeted at the WS- Addressing anonymous URI. IBM Presentation Template Full Version

© 2009 IBM Corporation Enabling WS-Addressing in WAS ■ Client side WS-Policy –Provider policy only. Configure the client based solely on the policy of the service provider. This option is available when a client policy set is not attached. –Client and provider policy. Configure the client based on both the client policy set and the policy of the service provider. This option is available when a client policy set is attached. ■ Server side WS-Policy –Include the policy configuration of the service provider in the WSDL. The WSDL is then available to publish, or to obtain by using an HTTP Get request. –Enable the Web Services Metadata Exchange (WS-MetadataExchange) protocol so that the policy configuration of the service provider is included in the WSDL and is available to a WS-MetadataExchange GetMetadata request. –An advantage of using the WS-MetadataExchange protocol is that you can apply message-level security to WS-MetadataExchange GetMetadata requests by using a suitable system policy set. IBM Presentation Template Full Version

© 2009 IBM Corporation Enable WSAddressing on the service client using JAX-WS Features ■ JAX-WS 2.1 introduces 'features' for programmatic control of the client. ■ Provided in JAX-WS 2.1 –WS-Addressing 1.0 Core specification namespace –javax.xml.ws.soap.AddressingFeature extends javax.xml.ws.WebServiceFeature ■ Proprietary, provided by WebSphere Application Server: –WS-Addressing submission specification namespace –com.ibm.websphere.wsaddressing.jaxws21.SubmissionAddressingFeature extends javax.xml.ws.WebServiceFeature ■ Overrides settings in the WSDL ■ Format: –Optional parameters: WS-Addressing is enabled :: true/false WS-Addressing is required :: required Examples : (true, required), (false) The default settings are that WS-Addressing is enabled but not required. IBM Presentation Template Full Version

© 2009 IBM Corporation Enable WSAddressing on the provider using JAX-WS Annotations ■ JAX-WS 2.1 introduces specific WS-Addressing annotations that mirror Features ■ Provided in JAX-WS 2.1 javax.xml.ws.soap.Addressing –WS-Addressing 1.0 Core specification namespace ■ Proprietary in WebSphere Application Server v7 com.ibm.websphere.wsaddressing.jaxws21.SubmissionAddressing –WS-Addressing submission specification namespace ■ Format: –Optional parameters: WS-Addressing is enabled :: true/false. If WS-Addressing is disabled then any WS-Addressing headers in inbound requests will be ignored. WS-Addressing is required :: true will cause a fault to be returned if WS-Addressing headers not received. The default settings are that WS-Addressing is enabled but not required. IBM Presentation Template Full Version

© 2009 IBM Corporation Enabling and disabling WS-Addressing in the service client ■ Set the com.ibm.websphere.webservices.use.async.mep property on the client request context. ■ Specify the UsingAddressing required=true/false element in the WSDL document for the service. If the service uses the Addressing annotation and you generate the WSDL document from the code, the UsingAddressing element already exists. This method does not apply to Dispatch clients, because these clients do not use the WSDL document. ■ Use the IBM proprietary WS-Addressing SPI to add message-addressing properties to the message request context. Source If Applicable IBM Presentation Template Full Version

© 2009 IBM Corporation Next... ■ EndpointReferences –Creating, using, converting ■ EndpointReferences –Fragile, WLM, HA ■ Enabling and Disabling WS-Addressing ■ Annotations for WS-Addressing in JAX-WS 2.1 IBM Presentation Template Full Version

© 2009 IBM annotations ■ New annotations to support the mapping of WS-Addressing actions to WSDL operations. annotation allows an action to be explicitly associated with the input, and output of a WSDL operation. annotation is used inside of annotation to associate each fault with an action. annotation is required in order to use annotations, otherwise they are ignored. ■ When an SEI is generated using the WSDL, annotations are not added automatically and must be manually added to the SEI.

© 2009 IBM Corporation What can you do with this in your applications? ■ I have a Web Service for an online shop called BuildingSuppliesShop ■ It has the following methods: –W3CEndpointReference newShoppingCart(); –addItem(String item, int quantity); –addToAccount(String accountName, String cartID); ■ My service will be Highly Available and store state relating to this shopper. IBM Presentation Template Full Version

© 2009 IBM Corporation An example... IBM Presentation Template Full Version WebSphere Application Server Cluster Administrative Cell Firewall Proxy Server for WebSphere

© 2009 IBM Corporation An example... IBM Presentation Template Full Version WebSphere Application Server Cluster Administrative Cell Firewall Proxy Server for WebSphere

© 2009 IBM Corporation An example... IBM Presentation Template Full Version WebSphere Application Server Cluster Administrative Cell Firewall Proxy Server for WebSphere

© 2009 IBM Corporation An example... IBM Presentation Template Full Version WebSphere Application Server Cluster Administrative Cell Firewall Proxy Server for WebSphere

© 2009 IBM Corporation An example... IBM Presentation Template Full Version WebSphere Application Server Cluster Administrative Cell Firewall Proxy Server for WebSphere

© 2009 IBM Corporation An example... IBM Presentation Template Full Version WebSphere Application Server Cluster Administrative Cell Firewall Proxy Server for WebSphere

© 2009 IBM Corporation An example... IBM Presentation Template Full Version WebSphere Application Server Cluster Administrative Cell Firewall Proxy Server for WebSphere

© 2009 IBM Corporation Summary ■ IBM's API/SPI for WS-Addressing ■ JAX-WS 2.1 API for WS-Addressing ■ Integration capabilities in WebSphere Application Server ■ Features and Annotations for WS-Addressing ■ Enabling and disabling WS-Addressing ■ Stateful Web Services with JAX-WS 2.1 ■ Highly Available Web Services with WebSphere Application Server IBM Presentation Template Full Version

© 2009 IBM Corporation Useful Links ■ ■ ■ ase.doc/info/aes/ae/cwbs_wsa.html ase.doc/info/aes/ae/cwbs_wsa.html ■ WS-Addressing development lead : ■ Me : IBM Presentation Template Full Version