Welcome!

Microservices Expo Authors: John Worthington, Pat Romanski, Stackify Blog, Automic Blog, Simon Hill

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
identify the sources of event storms and performance anomalies will require automated, real-time root-cause analysis. I think Enterprise Management Associates said it well: “The data and metrics collected at instrumentation points across the application ecosystem are essential to performance monitoring and root cause analysis. However, analytics capable of transforming data and metrics into an application-focused report or dashboards are what separates actual application monitoring from relat...
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...
DevOps teams have more on their plate than ever. As infrastructure needs grow, so does the time required to ensure that everything's running smoothly. This makes automation crucial - especially in the server and network monitoring world. Server monitoring tools can save teams time by automating server management and providing real-time performance updates. As budgets reset for the New Year, there is no better time to implement a new server monitoring tool (or re-evaluate your current solution)....
The benefits of automation are well documented; it increases productivity, cuts cost and minimizes errors. It eliminates repetitive manual tasks, freeing us up to be more innovative. By that logic, surely, we should automate everything possible, right? So, is attempting to automate everything a sensible - even feasible - goal? In a word: no. Consider this your short guide as to what to automate and what not to automate.
Cavirin Systems has just announced C2, a SaaS offering designed to bring continuous security assessment and remediation to hybrid environments, containers, and data centers. Cavirin C2 is deployed within Amazon Web Services (AWS) and features a flexible licensing model for easy scalability and clear pay-as-you-go pricing. Although native to AWS, it also supports assessment and remediation of virtual or container instances within Microsoft Azure, Google Cloud Platform (GCP), or on-premise. By dr...
Let's do a visualization exercise. Imagine it's December 31, 2018, and you're ringing in the New Year with your friends and family. You think back on everything that you accomplished in the last year: your company's revenue is through the roof thanks to the success of your product, and you were promoted to Lead Developer. 2019 is poised to be an even bigger year for your company because you have the tools and insight to scale as quickly as demand requires. You're a happy human, and it's not just...
"Opsani helps the enterprise adopt containers, help them move their infrastructure into this modern world of DevOps, accelerate the delivery of new features into production, and really get them going on the container path," explained Ross Schibler, CEO of Opsani, and Peter Nickolov, CTO of Opsani, in this SYS-CON.tv interview at DevOps Summit at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Enterprises are adopting Kubernetes to accelerate the development and the delivery of cloud-native applications. However, sharing a Kubernetes cluster between members of the same team can be challenging. And, sharing clusters across multiple teams is even harder. Kubernetes offers several constructs to help implement segmentation and isolation. However, these primitives can be complex to understand and apply. As a result, it’s becoming common for enterprises to end up with several clusters. Thi...
It’s “time to move on from DevOps and continuous delivery.” This was the provocative title of a recent article in ZDNet, in which Kelsey Hightower, staff developer advocate at Google Cloud Platform, suggested that “software shops should have put these concepts into action years ago.” Reading articles like this or listening to talks at most DevOps conferences might make you think that we’re entering a post-DevOps world. But vast numbers of organizations still struggle to start and drive transfo...
The nature of test environments is inherently temporary—you set up an environment, run through an automated test suite, and then tear down the environment. If you can reduce the cycle time for this process down to hours or minutes, then you may be able to cut your test environment budgets considerably. The impact of cloud adoption on test environments is a valuable advancement in both cost savings and agility. The on-demand model takes advantage of public cloud APIs requiring only payment for t...
High-velocity engineering teams are applying not only continuous delivery processes, but also lessons in experimentation from established leaders like Amazon, Netflix, and Facebook. These companies have made experimentation a foundation for their release processes, allowing them to try out major feature releases and redesigns within smaller groups before making them broadly available. In his session at 21st Cloud Expo, Brian Lucas, Senior Staff Engineer at Optimizely, discussed how by using ne...
While we understand Agile as a means to accelerate innovation, manage uncertainty and cope with ambiguity, many are inclined to think that it conflicts with the objectives of traditional engineering projects, such as building a highway, skyscraper or power plant. These are plan-driven and predictive projects that seek to avoid any uncertainty. This type of thinking, however, is short-sighted. Agile approaches are valuable in controlling uncertainty because they constrain the complexity that ste...
"We're developing a software that is based on the cloud environment and we are providing those services to corporations and the general public," explained Seungmin Kim, CEO/CTO of SM Systems Inc., in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
The cloud revolution in enterprises has very clearly crossed the phase of proof-of-concepts into a truly mainstream adoption. One of most popular enterprise-wide initiatives currently going on are “cloud migration” programs of some kind or another. Finding business value for these programs is not hard to fathom – they include hyperelasticity in infrastructure consumption, subscription based models, and agility derived from rapid speed of deployment of applications. These factors will continue to...
"This all sounds great. But it's just not realistic." This is what a group of five senior IT executives told me during a workshop I held not long ago. We were working through an exercise on the organizational characteristics necessary to successfully execute a digital transformation, and the group was doing their ‘readout.' The executives loved everything we discussed and agreed that if such an environment existed, it would make transformation much easier. They just didn't believe it was reali...
"CA has been doing a lot of things in the area of DevOps. Now we have a complete set of tool sets in order to enable customers to go all the way from planning to development to testing down to release into the operations," explained Aruna Ravichandran, Vice President of Global Marketing and Strategy at CA Technologies, in this SYS-CON.tv interview at DevOps Summit at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
We just came off of a review of a product that handles both containers and virtual machines in the same interface. Under the covers, implementation of containers defaults to LXC, though recently Docker support was added. When reading online, or searching for information, increasingly we see “Container Management” products listed as competitors to Docker, when in reality things like Rocket, LXC/LXD, and Virtualization are Dockers competitors. After doing some looking around, we have decided tha...
Agile has finally jumped the technology shark, expanding outside the software world. Enterprises are now increasingly adopting Agile practices across their organizations in order to successfully navigate the disruptive waters that threaten to drown them. In our quest for establishing change as a core competency in our organizations, this business-centric notion of Agile is an essential component of Agile Digital Transformation. In the years since the publication of the Agile Manifesto, the conn...
"Codigm is based on the cloud and we are here to explore marketing opportunities in America. Our mission is to make an ecosystem of the SW environment that anyone can understand, learn, teach, and develop the SW on the cloud," explained Sung Tae Ryu, CEO of Codigm, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Many enterprise and government IT organizations are realizing the benefits of cloud computing by extending IT delivery and management processes across private and public cloud services. But they are often challenged with balancing the need for centralized cloud governance without stifling user-driven innovation. This strategy requires an approach that fundamentally reshapes how IT is delivered today, shifting the focus from infrastructure to services aggregation, and mixing and matching the bes...