Welcome!

Microservices Expo Authors: Liz McMillan, Jason Bloomberg, Elizabeth White, Pat Romanski, Zakia Bouachraoui

Related Topics: Microservices Expo, Machine Learning

Microservices Expo: Article

Web Services and SOA

Practical Interoperability Approaches, WS-Security and WS-Addressing Explained

People sometimes ask what a service-oriented architecture enables today that could not have been done with the older, proprietary integration stacks of the past 5 to 15 years, such as those from Tibco, IBM, or Vitria. One such ability is the greater degree of interoperability between heterogeneous technology stacks that is made possible by the standards SOA is built on, such as Web services and BPEL. Although interoperability is only one facet of the SOA value proposition, it is one that has become increasingly more important, due in large part to the evolving IT environment, merger and acquisition activity, and increased partner connectivity.

Building business solutions for SOA requires the ability to secure data exchanged over a network, and control access to services in an environment where long-running business processes and asynchronous services are increasingly common. To meet these key requirements, two WS-* standards have moved to the forefront: WS-Security for authentication and encryption of service data, and WS-Addressing for correlation of messages exchanged with asynchronous services.

As these standards have begun to take hold, many commercial technologies have been introduced that add support for them. Likewise, many developers are implementing them in custom applications or with open source frameworks. Furthermore, standards that are logically layers above core Web services and security are referencing them. For example, the WS-BPEL specification is a Web service orchestration language with rich support for both synchronous and asynchronous services. BPEL, as it is commonly known, is highly complementary with WS-Security and WS-Addressing.

This article focuses on interoperability with asynchronous messaging and on the security challenges of using BPEL processes to orchestrate Web services deployed onto various technology platforms. The specific example used is BPEL processes deployed on Oracle BPEL Process Manager, invoking services implemented with Microsoft .NET Windows Communication Foundation (WCF).

WS-BPEL and WS-Addressing Interoperability Challenges
For those readers who may not be versed in asynchronous service requirements, we will first provide some background on why a standard such as WS-Addressing is needed. The core Web services standards, including WSDL, SOAP, and XML schema are sufficient for synchronous service operations in which a client of a service sends a request and either gets no response at all (a "one-way" operation) or gets a result back as the output of the operation itself. In either case, the operation completes the interaction between the service client and the service itself.

However, for logical operations that may take a long time to complete, the concept of an asynchronous operation whereby the client initiates a service operation but does not wait for an immediate response makes sense. At some later time, the service will call the client back with the result of the operation - or with an error or exception message. In this case, the client must pass at least two pieces of information to the service: a location where the service can call the client back with the result, and an identifier of some sort that will allow the client to uniquely identify the operation with which the callback is associated. Early in the development of Web services standards, individual projects would include custom mechanisms for interacting with asynchronous services; however, this meant that developers had to explicitly code this support, and interoperability among toolkits was nonexistent.

WS-Addressing provides a standard for describing the mechanisms by which the information needed to interact reliably with asynchronous Web services can be exchanged. In the long term, this promises seamless interoperability, even for asynchronous services, between clients and services implemented on different technology stacks.

The main purpose of WS-Addressing is to incorporate message-addressing information into SOAP messages (for example, where the provider should send a response). SOAP is an envelope-encoding specification that represents Web service messages in a transport neutral format. However, SOAP itself does not provide any features that identify endpoints. The usual endpoints, such as message destination, fault destination, and message intermediary are delegated up to the transport layer. Combining WS-Addressing with SOAP creates a complete messaging specification. WS-Addressing specifies that address information be stored in SOAP headers in an independent manner, instead of embedding that information into the payload of the message itself. WS-Addressing is complemented by two other specifications, WS-Addressing SOAP Binding, and WS-Addressing WSDL Binding which specify how to represent the WS-Addressing properties into SOAP and WSDL respectively.

At a high level, WS-Addressing defines an EndpointReference construct to represent a Web service endpoint. It also defines a set of headers, ReplyTo, FaultTo, RelatesTo, and MessageId which are used to dynamically define an asynchronous message flow between endpoints.

BPEL relies on WS-Addressing to enhance endpoint representation and asynchronous Web services invocations. However, because WS-Addressing has evolved through several versions, interoperability can be a challenge. Today up to four different WS-Addressing versions are commonly used-three versions of the specification are named by their release date: the March 2003 version, the March 2004 version, and the August 2004 version, developed before the specification moved to W3C. The 1.0 version, recently completed in May 2006, was developed after the specification went under the umbrella of W3C. After moving to W3C, the specification split into multiple parts: a core specification, and two specifications that describe bindings for SOAP and WSDL.

Explicit vs. Implicit Addressing Mechanisms
Ideally, all server platforms would support all possible versions of WS-Addressing, but we are forced to live (and code) in the real world. At this time, many servers support one or more active WS-Addressing versions, but it is still all too possible that a service and client will be built on platforms that support incompatible WS-Addressing versions. However, interoperability is possible with a minimal amount of developer effort.

When the same WS-Addressing version is supported by both the process (client) and service layers, it is called "implicit" addressing because the developer need only state at the metadata level which version of WS-Addressing should be used to correlate asynchronous messages. In this case, WS-Addressing manipulation is completely transparent to the BPEL process itself, and the SOAP layer simply adds the requested SOAP headers as needed.

However, in order to interoperate with WS-Addressing versions not implicitly supported, a server should provide an explicit mechanism by which developers can build and attach WS-Addressing to SOAP messages easily. The following section describes an explicit addressing mechanism used to achieve asynchronous service interoperability between Microsoft WCF using WS-Addressing 1.0 and Oracle BPEL Process Manager using WS-Addressing March 2003; however, the same principles should hold true for interoperability between any two BPEL and Web service toolkits.

WS-Addressing Interoperability Example: WCF and WS-Addressing Microsoft's Windows Communication Foundation (WCF) represents the next generation of distributed programming and service-oriented technologies built on top of the Microsoft .NET platform for the upcoming Windows Vista release. WCF unifies the existing set of distributed programming technologies such as ASP .NET Web services, .NET Remoting, COM+, and so on, under a common, simple, and service-oriented programming model. WCF implements a vast set of WS-* protocols, including WS-Addressing 1.0.

To demonstrate explicit interoperability with WCF, we use Oracle BPEL Process Manager. It has had rich support for WS-Addressing for several years and includes WS-Addressing of March 2003, March 2004, and August 2004. This example uses BPEL with WS-Addressing March 2003 and WCF with WS-Addressing 1.0 to demonstrate explicit addressing support. Consider the WS-Addressing interoperability scenario illustrated in Figure 1.

The following explains the occurrences in Figure 1:

  • A BPEL process exposes WS-Addressing headers on the process WSDL to expose a long-running process as an asynchronous service.
  • A WCF client invokes the BPEL process, and passes the ReplyTo the WS-Addressing v1.0 (www.w3.org/TR/2005/CR-ws-addr-core-20050817/) header representing the URL of a WCF service that is expecting the operation response message. The client also sends a MessageID WS-Addressing v1.0 header to uniquely identify the request (step 1).
  • The BPEL process receives the message, performs various operations, and uses the ReplyTo address to define a dynamic endpoint using the WS-Addressing 03/2003 (http://msdn.microsoft.com/webservices/webservices/ default.aspx?pull=/library/en-us/dnglobspec/html/ws-addressing0303.asp). (steps 2-4).
  • The BPEL process sends a reply message to the WCF service specified on the ReplyTo address, and passes the RelatesTo WS-Addressing v1.0 header to enable the WCF client to correlate the original request with the response (step 5).
  • The WCF service receives the response message and is able to correlate it back to the request (step 6).
In this example, WCF uses WS-Addressing v1.0; however, the BPEL service uses the March 2003 version of WS-Addressing. To make this work, explicit strategies for interoperability need to be applied, as described below.

As part of the process, the WSDL, which represents the interface of the BPEL process, imports the WS-Addressing v1.0 XSD and declares the ReplyTo and MessageID headers as part of the binding section. It also declares messages of type ReplyTo, MessageID, and RelatesTo as variable types in the BPEL process, as shown in Listing 1. Note: By using this technique, we're explicitly declaring that the BPEL process expects the WS-Addressing ReplyTo and MessageID headers as part of the incoming message.

Based on the messages types in Listing 1, the BPEL process also defines variables of message type ReplyTo, MessageID, and RelatesTo:

<variable name="wcfServiceAddr" messageType="ns1:wsaReplyTo"/>
<variable name="wcfRequestId" messageType="ns1:wsaMessageId"/>
<variable name="wcfResponseId" messageType="ns1:wsaRelatesTo"/>

With this in place, we can assign the SOAP header information to them later on and vice versa. The next step is to populate these variables from incoming SOAP message:

<receive name="receiveInput" partnerLink="client"
      portType="client:WCFAddr" operation="initiate"
      variable="inputVariable" createInstance="yes"
      bpelx:headerVariable="wcfServiceAddr wcfRequestId"
/>

By using bpelx:headerVariable (an extension of the WS-BPEL standard), the process code has access to the MessageID sent from the client as well as to its callback location.

Let's define a variable of type EndpointReference, which will provide the dynamic endpoint reference, needed for initiating the partnerLink later:

<variable name="wcfEndpoint" element="ns3:EndpointReference"/>

Note that the ns3 prefix is associated with the WS-Addressing 03/2003 namespace (xmlns:ns3=http://schemas.xmlsoap.org/ws/2003/03/addressing).

The next step is to populate the wcfEndpoint variable (defined in the previous step) using the ReplyTo header from wcfServiceAddr (Note the <copy> sections, marked yellow).

By using standard BPEL activities, these values are assigned by using a series of copy rules in an <assign> construct, as shown in Listing 2.

Assign the wcfEndpoint variable to the wcfService partnerLink, which represents an outgoing reference to a Web service. With this in place, the partnerLink knows which location to call:

<assign name="PartnerlinkWSAAssign">
   <copy>
     <from variable="wcfEndpoint"/>
     <to partnerLink="wcfService"/>
   </copy>
</assign>

In order to allow the client to correlate the request and response messages, we have to copy the value of the wcfRequestId (the unique MessageID) to wcfResponseId (RelatesTo):

<copy>
   <from variable="wcfRequestId" part="parameters" query="/ns2:MessageID"/>
   <to variable="wcfResponseId" part="parameters" query="/ns2:RelatesTo"/>
</copy>

The last step on the BPEL server-side is to use an invoke activity, which will call the WCF service (defined through the wcfService partnerLink), and to pass the RelatesTo header, available within the wcfResponseId variable. Make sure to use bpelx:inputHeaderVariable for this.

    <invoke name="Invoke_ExternalWCFService" partnerLink="wcfService"
       portType="ns1:IOperationCallback" operation="SendResult"
       inputVariable="wcfRequest"
       bpelx:inputHeaderVariable="wcfResponseId"/>

After the server side, create a WCF client, which invokes the BPEL process through SOAP. Then create a WCF BindingElement that allows the use of WS-Addressing v1.0, and wrap the call to the BPEL process within an OperationContextScope to populate the WS-Addressing headers, as shown in Listing 3.

Testing the code in Listing 3 produces a SOAP message that follows. Note the <a:Address> field containing the service address:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:a="http://www.w3.org/2005/08/addressing">
    <s:Header>
      <a:Action s:mustUnderstand="1">http://tempuri.org/IOperationCallback/SendResult</a:Action>
      <a:ReplyTo>
        <a:Address>WCF Service Address...</a:Address>
      </a:ReplyTo>
      <a:To s:mustUnderstand="1">Oracle BPEL Process Address...</a:To>
      <a:MessageID>urn:uuid:847b546e-16e5-4ea9-8267-b6fe559f0c1f</a:MessageID>
    </s:Header>
    <s:Body>Body</s:Body>
</s:Envelope>


More Stories By Jesus Rodriguez

Jesus Rodriguez is a co-founder and CEO of KidoZen, an enterprise mobile-first platform as a service redefining the future of enterprise mobile solutions. He is also the co-founder to Tellago, an award-winning professional services firm focused on big enterprise software trends. Under his leadership, KidoZen and Tellago have been recognized as an innovator in the areas of enterprise software and solutions achieving important awards like the Inc 500, Stevie Awards’ American and International Business Awards.

A software scientist by background, Jesus is an internationally recognized speaker and author with contributions that include hundreds of articles and sessions at industry conferences. He serves as an advisor to several software companies such as Microsoft and Oracle, sits at the board of different technology companies. Jesus is a prolific blogger on all subjects related to software technology and entrepreneurship. You can gain valuable insight on business and software technology through his blogs at http://jrodthoughts.com and http://weblogs.asp.net/gsusx .

More Stories By Clemens Utschig

Clemens Utschig works within the Oracle SOA Product Management Team responsible for security aspects and cross product integration. Aside from technology, Clemens' focus is on project management and consulting aspects coming along with SOA implementations. As a native Austrian, Clemens' Oracle career started in Europe at the local consulting services branch—working with customers on J2EE and SOA projects, and founded the local Java community. He is a frequent speaker at conferences evangelizing either on technology or the human factor—two key aspects when introducing new concepts and shifts in corporate IT strategy.

More Stories By Heidi Buelow

Heidi Buelow is a product manager for the Oracle SOA Suite. She spent the last 10 years building business process management systems with a focus on service integration and interoperability of diverse systems. Heidi’s career developing service-oriented architecture started with the early services- and object-oriented transport and messaging stacks of Xerox PARC’s XNS networking protocols. Her recent experience includes the development of the BPMS platform and tools for very large SOA-based solutions, an example of which is the managed care system of one the largest managed healthcare companies in the United States.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Microservices Articles
CloudEXPO New York 2018, colocated with DXWorldEXPO New York 2018 will be held November 11-13, 2018, in New York City and will bring together Cloud Computing, FinTech and Blockchain, Digital Transformation, Big Data, Internet of Things, DevOps, AI, Machine Learning and WebRTC to one location.
DevOpsSummit New York 2018, colocated with CloudEXPO | DXWorldEXPO New York 2018 will be held November 11-13, 2018, in New York City. Digital Transformation (DX) is a major focus with the introduction of DXWorldEXPO within the program. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term.
Two apparently distinct movements are in the process of disrupting the world of enterprise application development: DevOps and Low-Code. DevOps is a cultural and organizational shift that empowers enterprise software teams to deliver better software quicker – in particular, hand-coded software. Low-Code platforms, in contrast, provide a technology platform and visual tooling that empower enterprise software teams to deliver better software quicker -- with little or no hand-coding required. ...
"We do one of the best file systems in the world. We learned how to deal with Big Data many years ago and we implemented this knowledge into our software," explained Jakub Ratajczak, Business Development Manager at MooseFS, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
All zSystem customers have a significant new business opportunity to extend their reach to new customers and markets with new applications and services, and to improve the experience of existing customers. This can be achieved by exposing existing z assets (which have been developed over time) as APIs for accessing Systems of Record, while leveraging mobile and cloud capabilities with new Systems of Engagement applications. In this session, we will explore business drivers with new Node.js apps ...
Using new techniques of information modeling, indexing, and processing, new cloud-based systems can support cloud-based workloads previously not possible for high-throughput insurance, banking, and case-based applications. In his session at 18th Cloud Expo, John Newton, CTO, Founder and Chairman of Alfresco, described how to scale cloud-based content management repositories to store, manage, and retrieve billions of documents and related information with fast and linear scalability. He addres...
While some developers care passionately about how data centers and clouds are architected, for most, it is only the end result that matters. To the majority of companies, technology exists to solve a business problem, and only delivers value when it is solving that problem. 2017 brings the mainstream adoption of containers for production workloads. In his session at 21st Cloud Expo, Ben McCormack, VP of Operations at Evernote, discussed how data centers of the future will be managed, how the p...
Digital Transformation is well underway with many applications already on the cloud utilizing agile and devops methodologies. Unfortunately, application security has been an afterthought and data breaches have become a daily occurrence. Security is not one individual or one's team responsibility. Raphael Reich will introduce you to DevSecOps concepts and outline how to seamlessly interweave security principles across your software development lifecycle and application lifecycle management. With ...
Containers and Kubernetes allow for code portability across on-premise VMs, bare metal, or multiple cloud provider environments. Yet, despite this portability promise, developers may include configuration and application definitions that constrain or even eliminate application portability. In this session we'll describe best practices for "configuration as code" in a Kubernetes environment. We will demonstrate how a properly constructed containerized app can be deployed to both Amazon and Azure ...
The now mainstream platform changes stemming from the first Internet boom brought many changes but didn’t really change the basic relationship between servers and the applications running on them. In fact, that was sort of the point. In his session at 18th Cloud Expo, Gordon Haff, senior cloud strategy marketing and evangelism manager at Red Hat, will discuss how today’s workloads require a new model and a new platform for development and execution. The platform must handle a wide range of rec...