Welcome!

Microservices Expo Authors: Jason Bloomberg, Elizabeth White, Liz McMillan, Pat Romanski, Mehdi Daoudi

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.


@MicroservicesExpo Stories
In his session at @DevOpsSummit at 20th Cloud Expo, Kelly Looney, director of DevOps consulting for Skytap, showed how an incremental approach to introducing containers into complex, distributed applications results in modernization with less risk and more reward. He also shared the story of how Skytap used Docker to get out of the business of managing infrastructure, and into the business of delivering innovation and business value. Attendees learned how up-front planning allows for a clean sep...
In IT, we sometimes coin terms for things before we know exactly what they are and how they’ll be used. The resulting terms may capture a common set of aspirations and goals – as “cloud” did broadly for on-demand, self-service, and flexible computing. But such a term can also lump together diverse and even competing practices, technologies, and priorities to the point where important distinctions are glossed over and lost.
Enterprise architects are increasingly adopting multi-cloud strategies as they seek to utilize existing data center assets, leverage the advantages of cloud computing and avoid cloud vendor lock-in. This requires a globally aware traffic management strategy that can monitor infrastructure health across data centers and end-user experience globally, while responding to control changes and system specification at the speed of today’s DevOps teams. In his session at 20th Cloud Expo, Josh Gray, Chie...
"At the keynote this morning we spoke about the value proposition of Nutanix, of having a DevOps culture and a mindset, and the business outcomes of achieving agility and scale, which everybody here is trying to accomplish," noted Mark Lavi, DevOps Solution Architect at Nutanix, in this SYS-CON.tv interview at @DevOpsSummit at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
We have already established the importance of APIs in today’s digital world (read about it here). With APIs playing such an important role in keeping us connected, it’s necessary to maintain the API’s performance as well as availability. There are multiple aspects to consider when monitoring APIs, from integration to performance issues, therefore a general monitoring strategy that only accounts for up-time is not ideal.
In his session at 20th Cloud Expo, Mike Johnston, an infrastructure engineer at Supergiant.io, discussed how to use Kubernetes to set up a SaaS infrastructure for your business. Mike Johnston is an infrastructure engineer at Supergiant.io with over 12 years of experience designing, deploying, and maintaining server and workstation infrastructure at all scales. He has experience with brick and mortar data centers as well as cloud providers like Digital Ocean, Amazon Web Services, and Rackspace. H...
When you focus on a journey from up-close, you look at your own technical and cultural history and how you changed it for the benefit of the customer. This was our starting point: too many integration issues, 13 SWP days and very long cycles. It was evident that in this fast-paced industry we could no longer afford this reality. We needed something that would take us beyond reducing the development lifecycles, CI and Agile methodologies. We made a fundamental difference, even changed our culture...
As many know, the first generation of Cloud Management Platform (CMP) solutions were designed for managing virtual infrastructure (IaaS) and traditional applications. But that’s no longer enough to satisfy evolving and complex business requirements. In his session at 21st Cloud Expo, Scott Davis, Embotics CTO, will explore how next-generation CMPs ensure organizations can manage cloud-native and microservice-based application architectures, while also facilitating agile DevOps methodology. He wi...
Docker is sweeping across startups and enterprises alike, changing the way we build and ship applications. It's the most prominent and widely known software container platform, and it's particularly useful for eliminating common challenges when collaborating on code (like the "it works on my machine" phenomenon that most devs know all too well). With Docker, you can run and manage apps side-by-side - in isolated containers - resulting in better compute density. It's something that many developer...
These days, change is the only constant. In order to adapt and thrive in an ever-advancing and sometimes chaotic workforce, companies must leverage intelligent tools to streamline operations. While we're only at the dawn of machine intelligence, using a workflow manager will benefit your company in both the short and long term. Think: reduced errors, improved efficiency and more empowered employees-and that's just the start. Here are five other reasons workflow automation is leading a revolution...
We have Continuous Integration and we have Continuous Deployment, but what’s continuous across all of what we do is people. Even when tasks are automated, someone wrote the automation. So, Jayne Groll evangelizes about Continuous Everyone. Jayne is the CEO of the DevOps Institute and the author of Agile Service Management Guide. She talked about Continuous Everyone at the 2016 All Day DevOps conference. She describes it as "about people, culture, and collaboration mapped into your value streams....
Cloud adoption is often driven by a desire to increase efficiency, boost agility and save money. All too often, however, the reality involves unpredictable cost spikes and lack of oversight due to resource limitations. In his session at 20th Cloud Expo, Joe Kinsella, CTO and Founder of CloudHealth Technologies, tackled the question: “How do you build a fully optimized cloud?” He will examine: Why TCO is critical to achieving cloud success – and why attendees should be thinking holistically ab...
Docker is on a roll. In the last few years, this container management service has become immensely popular in development, especially given the great fit with agile-based projects and continuous delivery. In this article, I want to take a brief look at how you can use Docker to accelerate and streamline the software development lifecycle (SDLC) process.
We define Hybrid IT as a management approach in which organizations create a workload-centric and value-driven integrated technology stack that may include legacy infrastructure, web-scale architectures, private cloud implementations along with public cloud platforms ranging from Infrastructure-as-a-Service to Software-as-a-Service.
Did you know that you can develop for mainframes in Java? Or that the testing and deployment can be automated across mobile to mainframe? In his session and demo at @DevOpsSummit at 21st Cloud Expo, Dana Boudreau, a Senior Director at CA Technologies, will discuss how increasingly teams are developing with agile methodologies, using modern development environments, and automating testing and deployments, mobile to mainframe.
As DevOps methodologies expand their reach across the enterprise, organizations face the daunting challenge of adapting related cloud strategies to ensure optimal alignment, from managing complexity to ensuring proper governance. How can culture, automation, legacy apps and even budget be reexamined to enable this ongoing shift within the modern software factory?
While some vendors scramble to create and sell you a fancy solution for monitoring your spanking new Amazon Lambdas, hear how you can do it on the cheap using just built-in Java APIs yourself. By exploiting a little-known fact that Lambdas aren’t exactly single-threaded, you can effectively identify hot spots in your serverless code. In his session at @DevOpsSummit at 21st Cloud Expo, Dave Martin, Product owner at CA Technologies, will give a live demonstration and code walkthrough, showing how ...
There are several reasons why businesses migrate their operations to the cloud. Scalability and price are among the most important factors determining this transition. Unlike legacy systems, cloud based businesses can scale on demand. The database and applications in the cloud are not rendered simply from one server located in your headquarters, but is instead distributed across several servers across the world. Such CDNs also bring about greater control in times of uncertainty. A database hack ...
@DevOpsSummit at Cloud Expo taking place Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center, Santa Clara, CA, is co-located with the 21st International Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is ...
API Security is complex! Vendors like Forum Systems, IBM, CA and Axway have invested almost 2 decades of engineering effort and significant capital in building API Security stacks to lockdown APIs. The API Security stack diagram shown below is a building block for rapidly locking down APIs. The four fundamental pillars of API Security - SSL, Identity, Content Validation and deployment architecture - are discussed in detail below.