Click here to close now.

Welcome!

Industrial IoT Authors: Elizabeth White, Pat Romanski, AppDynamics Blog, Carmen Gonzalez, Liz McMillan

Blog Feed Post

SOAP-to-REST with Parameterized URLs and content-based routing using the Vordel API Server

The world is moving from SOAP to REST. Many applications continue to send old-style SOAP messages. Therefore, a very common usage of the Vordel API Server is to convert from legacy SOAP messages into REST API calls. This provides the best of both worlds: (1) Existing SOAP apps continue to work and don't have to be re-coded, and (2) going forward, REST APIs are used instead.

I've put together an example of this below. In this case, I'm using the common Parlay-X format which is SOAP-based, and I'm converting to the GSMA OneAPI, which is a REST API. The example I'm using is the common "amountCharging" service, which, here in Vordel, we often encounter with our telecoms customers [Side note: Here is some information about how BT, 3 UK, Telefonica, and TIM Brasil are using Vordel with their telecoms services]. 

Here's an example of a legacy SOAP message to our Parlay-X API:


<?xml version="1.0" encoding="UTF-8" standalone="no"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <par2:chargeAmount xmlns:par2="http://www.csapi.org/schema/parlayx/payment/amount_charging/v2_1/local"> <!-- Element must appear exactly once --> <par2:endUserIdentifier>www.abc.com</par2:endUserIdentifier> <!-- Element must appear exactly once --> <par2:charge> <!-- Element must appear exactly once --> <description>a</description> <!-- Zero or one occurrences --> <currency>a</currency> <!-- Zero or one occurrences --> <amount>1.0</amount> <!-- Zero or one occurrences --> <code>a</code> </par2:charge> <!-- Element must appear exactly once --> <par2:referenceCode>a</par2:referenceCode> </par2:chargeAmount> </soap:Body> </soap:Envelope>


You can see above that this is a charge for some "Game Currency", of the amount of 25 US Dollars. 

We want to convert this to a REST API call like this:

http://api.myhostname.com/1/payment/6175551234/transactions/amount

You might notice, in the example, that the "endUserIdentifier" value in the SOAP message must be mapped into part of the URL used by the REST API. This is sometimes called a "Parameterized URL", or REST API parameterization.

Let's see how this is configured at the Vordel API Server...

The first step is to register the Parlay-X WSDL. I am doing this within the API Server's Repository, which I am accessing using the Policy Studio (Under "API Server" -> "Business Services", then right-clicking on the group I want to import the service into, and selecting "Register Web Service"). 



I am choosing the "chargeAmount" operation, as shown above, by selecting it. I simply follow through the rest of the steps as default, and for the final step, I'm choosing to deploy under a group called "Default Services", which has a number of HTTP listeners, and an SSL listener, as shown below:

The API Server will automatically create the mapping from the inbound path to the policy for our Parlay-X service. 

Finally we hit "Deploy" to deploy our new SOAP service to the API Server. 


The next step is to map from the SOAP message to the REST API call. Let's see how this is done.

Here is the WSDL for the virtualized Parlay-X service at the API Gateway. I load this up into the free Vordel SOAPbox tool (or SOAPUI) in order to generate a sample SOAP request to this Parlay-X service. 


I then save this sample request as a file called "SampleSOAPMessage.xml". We will use this in order to tell the API Server how to look up the "EndUserIdentifier" value from the SOAP now.

When I registered the Parlay-X WSDL, a sample "handler" was created for me. I am going to delete this, and configure my own handler, which reads the value from the SOAP and dynamically constructs the REST API requests based on the "EndUserIdentifier" value. So first let's delete the default handler:


Next, I drag in a "Set Service Context" into my empty canvas, and I choose the WSDL for the Parlay-X service I just imported. What I am doing here is telling the API Server (and Vordel Analytics) the name of the SOAP service, so that this shows up in monitoring and Analytics. 


Remember to select "Set as start" for this filter. Otherwise it will continue to be grayed out and will not run. Here I am setting it as start:


In the next step, I am setting Schema Validation for my incoming message. Note that, if we don't want to schema-validate the message, you can skip this step. I put a green arrow from the "Set Service Context" filter into the "Schema Validation" filter. 


Next, I am using a "Retrieve from message" filter to select the value of the EndUserIdentifier field from the XML. As you can see below, I am using the XPath Wizard in Policy Studio with the sample message which I made from SOAPbox (or SOAPui if you prefer). I select the place where the EndUserIdentifer is to be found in the message, and I set that it will be placed into an attribute (variable) called "EndUserIdentifier". 



Next, I am using a "Switch" filter to switch based on the content of that "EndUserIdentifier" variable. You can see that I'm saying "If it starts with '617', use routing policy 'Route to Px Service 1", "If it starts with '212', use routing policy 'Route to Px Service 2", etc. This Switch filter is very powerful.


At this point your policy should look like this next screenshot:


So let's look at one of the routing policies which we are calling from our Switch filter. This is a routing policy which is creating a REST API request. It consists of four simple steps. 

Step one is to rewrite the URL, taking into account the EndUserIdentifier value which we read in from the SOAP message. You can see it below with the syntax ${EndUserIdentifier}


Step two is to set the verb to "GET". Because the incoming SOAP message was sent using a POST verb, but we want to use GET to connect to our REST API, I am using a "Set HTTP Verb" filter to convert the verb to "GET".


Step three is to use a "Static Router" filter to set the hostname and port of my REST API server which I want to route to:



Step four is to place a "Connection" filter after the "Static Router". I accept all the default for the "Connection" filter. Note that if I was connecting over SSL to the API, I'd have to make sure I checked the boxes for the certificates used at the endpoint, so that they are trusted.


And that's it! What we achieved here is:

1) Converting from a legacy SOAP request to a REST API call
2) Parameterization of a URL, based on a value read from a SOAP message
3) Conditional routing based on the value from a message (content-based routing).

If you'd like to see more "recipes" like this, check out the tutorials on the Vordel website.

Read the original blog entry...

More Stories By Mark O'Neill

Mark O'Neill is VP Innovation at Axway - API and Identity. Previously he was CTO and co-founder at Vordel, which was acquired by Axway. A regular speaker at industry conferences and a contributor to SOA World Magazine and Cloud Computing Journal, Mark holds a degree in mathematics and psychology from Trinity College Dublin and graduate qualifications in neural network programming from Oxford University.

@ThingsExpo Stories
The Internet of Things is a misnomer. That implies that everything is on the Internet, and that simply should not be - especially for things that are blurring the line between medical devices that stimulate like a pacemaker and quantified self-sensors like a pedometer or pulse tracker. The mesh of things that we manage must be segmented into zones of trust for sensing data, transmitting data, receiving command and control administrative changes, and peer-to-peer mesh messaging. In his session at @ThingsExpo, Ryan Bagnulo, Solution Architect / Software Engineer at SOA Software, focused on desi...
An entirely new security model is needed for the Internet of Things, or is it? Can we save some old and tested controls for this new and different environment? In his session at @ThingsExpo, New York's at the Javits Center, Davi Ottenheimer, EMC Senior Director of Trust, reviewed hands-on lessons with IoT devices and reveal a new risk balance you might not expect. Davi Ottenheimer, EMC Senior Director of Trust, has more than nineteen years' experience managing global security operations and assessments, including a decade of leading incident response and digital forensics. He is co-author of t...
The multi-trillion economic opportunity around the "Internet of Things" (IoT) is emerging as the hottest topic for investors in 2015. As we connect the physical world with information technology, data from actions, processes and the environment can increase sales, improve efficiencies, automate daily activities and minimize risk. In his session at @ThingsExpo, Ed Maguire, Senior Analyst at CLSA Americas, will describe what is new and different about IoT, explore financial, technological and real-world impact across consumer and business use cases. Why now? Significant corporate and venture...
While great strides have been made relative to the video aspects of remote collaboration, audio technology has basically stagnated. Typically all audio is mixed to a single monaural stream and emanates from a single point, such as a speakerphone or a speaker associated with a video monitor. This leads to confusion and lack of understanding among participants especially regarding who is actually speaking. Spatial teleconferencing introduces the concept of acoustic spatial separation between conference participants in three dimensional space. This has been shown to significantly improve comprehe...
Today’s enterprise is being driven by disruptive competitive and human capital requirements to provide enterprise application access through not only desktops, but also mobile devices. To retrofit existing programs across all these devices using traditional programming methods is very costly and time consuming – often prohibitively so. In his session at @ThingsExpo, Jesse Shiah, CEO, President, and Co-Founder of AgilePoint Inc., discussed how you can create applications that run on all mobile devices as well as laptops and desktops using a visual drag-and-drop application – and eForms-buildi...
There will be 150 billion connected devices by 2020. New digital businesses have already disrupted value chains across every industry. APIs are at the center of the digital business. You need to understand what assets you have that can be exposed digitally, what their digital value chain is, and how to create an effective business model around that value chain to compete in this economy. No enterprise can be complacent and not engage in the digital economy. Learn how to be the disruptor and not the disruptee.
The enterprise market will drive IoT device adoption over the next five years. In his session at @ThingsExpo, John Greenough, an analyst at BI Intelligence, division of Business Insider, will analyze how companies will adopt IoT products and the associated cost of adopting those products. John Greenough is the lead analyst covering the Internet of Things for BI Intelligence- Business Insider’s paid research service. Numerous IoT companies have cited his analysis of the IoT. Prior to joining BI Intelligence, he worked analyzing bank technology for Corporate Insight and The Clearing House Pay...
The Domain Name Service (DNS) is one of the most important components in networking infrastructure, enabling users and services to access applications by translating URLs (names) into IP addresses (numbers). Because every icon and URL and all embedded content on a website requires a DNS lookup loading complex sites necessitates hundreds of DNS queries. In addition, as more internet-enabled ‘Things' get connected, people will rely on DNS to name and find their fridges, toasters and toilets. According to a recent IDG Research Services Survey this rate of traffic will only grow. What's driving t...
SYS-CON Events announced today that MetraTech, now part of Ericsson, has been named “Silver Sponsor” of SYS-CON's 16th International Cloud Expo®, which will take place on June 9–11, 2015, at the Javits Center in New York, NY. Ericsson is the driving force behind the Networked Society- a world leader in communications infrastructure, software and services. Some 40% of the world’s mobile traffic runs through networks Ericsson has supplied, serving more than 2.5 billion subscribers.
With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo in Silicon Valley. Learn what is going on, contribute to the discussions, and ensure that your enterprise is as "IoT-Ready" as it can be! Internet of @ThingsExpo, taking place Nov 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 17th Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The Internet of Things (IoT) is the most profound change in personal an...
The Internet of Things promises to transform businesses (and lives), but navigating the business and technical path to success can be difficult to understand. In his session at @ThingsExpo, Sean Lorenz, Technical Product Manager for Xively at LogMeIn, demonstrated how to approach creating broadly successful connected customer solutions using real world business transformation studies including New England BioLabs and more.
The world is at a tipping point where the technology, the device and global adoption are converging to such a point that we will see an explosion of a world where smartphone devices not only allow us to talk to each other, but allow for communication between everything – serving as a central hub from which we control our world – MediaTek is at the heart of both driving this and allowing the markets to drive this reality forward themselves. The next wave of consumer gadgets is here – smart, connected, and small. If your ambitions are big, so are ours. In his session at @ThingsExpo, Jack Hu, D...
17th Cloud Expo, taking place Nov 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA, will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud strategy. Meanwhile, 94% of enterprises are using some form of XaaS – software, platform, and infrastructure as a service.
The recent trends like cloud computing, social, mobile and Internet of Things are forcing enterprises to modernize in order to compete in the competitive globalized markets. However, enterprises are approaching newer technologies with a more silo-ed way, gaining only sub optimal benefits. The Modern Enterprise model is presented as a newer way to think of enterprise IT, which takes a more holistic approach to embracing modern technologies.
The true value of the Internet of Things (IoT) lies not just in the data, but through the services that protect the data, perform the analysis and present findings in a usable way. With many IoT elements rooted in traditional IT components, Big Data and IoT isn’t just a play for enterprise. In fact, the IoT presents SMBs with the prospect of launching entirely new activities and exploring innovative areas. CompTIA research identifies several areas where IoT is expected to have the greatest impact.
There's no doubt that the Internet of Things is driving the next wave of innovation. Google has spent billions over the past few months vacuuming up companies that specialize in smart appliances and machine learning. Already, Philips light bulbs, Audi automobiles, and Samsung washers and dryers can communicate with and be controlled from mobile devices. To take advantage of the opportunities the Internet of Things brings to your business, you'll want to start preparing now.
P2P RTC will impact the landscape of communications, shifting from traditional telephony style communications models to OTT (Over-The-Top) cloud assisted & PaaS (Platform as a Service) communication services. The P2P shift will impact many areas of our lives, from mobile communication, human interactive web services, RTC and telephony infrastructure, user federation, security and privacy implications, business costs, and scalability. In his session at @ThingsExpo, Robin Raymond, Chief Architect at Hookflash, will walk through the shifting landscape of traditional telephone and voice services ...
Explosive growth in connected devices. Enormous amounts of data for collection and analysis. Critical use of data for split-second decision making and actionable information. All three are factors in making the Internet of Things a reality. Yet, any one factor would have an IT organization pondering its infrastructure strategy. How should your organization enhance its IT framework to enable an Internet of Things implementation? In his session at Internet of @ThingsExpo, James Kirkland, Chief Architect for the Internet of Things and Intelligent Systems at Red Hat, described how to revolutioniz...
The security devil is always in the details of the attack: the ones you've endured, the ones you prepare yourself to fend off, and the ones that, you fear, will catch you completely unaware and defenseless. The Internet of Things (IoT) is nothing if not an endless proliferation of details. It's the vision of a world in which continuous Internet connectivity and addressability is embedded into a growing range of human artifacts, into the natural world, and even into our smartphones, appliances, and physical persons. In the IoT vision, every new "thing" - sensor, actuator, data source, data con...
All major researchers estimate there will be tens of billions devices - computers, smartphones, tablets, and sensors - connected to the Internet by 2020. This number will continue to grow at a rapid pace for the next several decades. With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo, June 9-11, 2015, at the Javits Center in New York City. Learn what is going on, contribute to the discussions, and ensure that your enterprise is as "IoT-Ready" as it can be