CLOUDPort Tutorial : Virtualizing an Existing Service

CLOUDPort, emulates a web service. A service can either be captured or created and then replayed by the free runtime player on any windows machine. No additional infrastructure or licenses are needed.  So lets start by virtualizing a remote service, Crosscheck Networks has nothing to do with. W3schools. As Canadians know, weather is our favourite topic of conversation. Summers can be brutally hot and winters can be brutally cold. Our office is developing application that makes a call on in order to convert Celsius To Fahrenheit and visa versa for people visiting our Canadian offices. You tasked with the application, but are away at the cottage and the Internet connectivity to W3schools is sporadic at best. If only you could run the service on your Laptop that you also using to develop and test on. But the service is not even owned by you and how much work would it be to create a duplicate infrastructure? Enter CLOUDPort. 

1. Run CLOUDPort Enterprise as an administrator. If you don’t have CLOUDPort, you can as for a 14 day no obligation trial here. Select Build Simulation option.

2. In the Capture WSDL bar, enter the service you wish to virtualize . For this example we using add ?wsdl on the end for and click on capture WSDL icon on the right of the bar. Since its a SOAP service, the scheme is defined and can be imported.

Capture WDSL

Notice that 2 services are captured in the left hand column, FahrenheitToCelcius and CelsiusToFahrenheit. If you don’t get that, maybe your internet it already down?

2 services list

3. Select Network Listeners then change URI to /CLOUDPort/tempconvert.asmx and lets leave the rest the same for now. Listeners is were you wish to put the virtualized service.

Note IP address = All Machine IP Address. If you wishes to put this on a particular lab machine, you could define an IP address for the virtual service.


4. Getting sidetracked (was that a Moose?). Lets take a look at Documents. Selecting documents lets you see the Main WSDL and the Embedded Schema

4 Documents

5. Selecting FahrenheitToCelcius_1 we see that SOAPSonar highlights 1) tns:FahrenheitToCelcius in the Request tab identifying a rule.

5 Request

6. Lets define a response for that rule. Select the Response tab. Although there are a number of options on how to populate the response field using automated data sources, run-time variables etc,  Its 38 degrees on your deck today, and you are missing the office environmental controls and so wish to force the response to be 22 degrees regardless of the value in-putted. Enter 22 as the value in the field via CLOUDPort’s GUI. and Commit Settings.6.1 Response

6 Response

Notice you can change the  HTTP response Code from 200? Select Workflow Events tab at the bottom to look around.

7. Select Go to CelsiusToFahrenheit_1 and enter a response value of  -21. The temperature the lake water will feel like if you jumped in right now. Commit settings

8 . File ; Save Project As and name your new project file. Notice the size?

7 save

9. Select Simulation from the main menu, and Deploy Simulation (local) The free run-time player is launched with the service you just created. Notice the URI and WSDL address? Copy Generated WSDL Link to Clipboard.

9 Runtime

10.  Time to get to work, you can unplug from the internet now, as you don’t need the remote service anymore. In fact not used it for a while. Unplug your Ethernet cable if you would like. Yes, actually that was a moose. Launch SOAPSonar to validate your service is virtualized. Run SOAPSonar as Admin. and paste the copied URI into Capture WSDL bar and select Capture WSDL10 Capture in SS

Notice you have 2 Services in the left hand column?

11. Select FahrenheitToCelcius_1 enter a value of 100 (what it feels like out here) and Commit your settings

11 run Fahrenheit

12. Send the Current request to Server. Since you dont have access to the sever and the URI is the one for your virtual service, the request is not actually being made by the server. Rather it is being made of CLOUDPort running on your own machine. Looking at the response we see that the response value is 21.

12 Success

13. Look back at CLOUDPorts free run-time player. Select Transaction Viewer.  and select the transaction you just made.

Look at the message request, do you see the request had 100 as the value and the response was 21? The response time was .07ms and request size was 413 bytes?

13 Transaction viewer

Now CLOUDPort Run-time player is free, the licensed version is only needed to create the test plan. So email the perfect temp.smp file to Lee, since you know he is climbing on a plane and have nothing better to do for 7 hours so he can run the virtualized service on his machine while travelling.

Now take a second and think of all those services you rely on in the lab or in some 3rd party’s lab. How many hours spent on gaining and maintaining access and data integrity?