Welcome!

Microservices Expo Authors: Jason Bloomberg, Karthick Viswanathan, Elizabeth White, Mehdi Daoudi, Pat Romanski

Related Topics: Microservices Expo

Microservices Expo: Blog Feed Post

SoapUI for Web Service Testing

Setting up a series of tests and even load/stress testing

A popular tool for web service testing is SoapUI. The following blog post describes how to use it for testing a simple web service, as well as setting up a series of tests and even load/stress testing. Without a doubt similar documentation is available on the SoapUI website; my post gives my spin on the product that maybe useful to others.

In this post we'll look at:

1) A simple web service example
2) Creating a simple test in SoapUI
3) Creating a test suite
4) Loast/stress testing your web services

Our web service

The web service we'll use here for testing is a simple Hello World example. It is comprised of the following solutions:

HelloWorldExample.xsd

xmlns:tns="urn: HelloWorldExample.wsdl" xmlns: xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsca="http://www.sagecomputing.com.au">






Finally the web service is served at the following address:

...and the WSDL at this location...

Starting SoapUI 3.0

On starting SoapUI 3.0 you'll see this screen:


Note in the left navigator the Projects node.

Creating your first web service test

We want to test the web service we recently created. To do follow these steps:

Right click on the Projects node and select New soapUI Project from the context menu. This will display the New soapUI Project dialog.

We'll enter an arbitrary Project Name. For the Initial WSDL/WADL we enter the complete URL of our web service's WSDL:


Leave the default check boxes, where Create Requests is checked, and the rest unchecked.

On completing the dialog the navigator will now look as follows:


Note how SoapUI has created the project, a node to represent the WSDL binding, a node to represent the WSDL operations (one in this case), and a dummy request.

If you double click on the request, this shows where SoapUI begins to sing:


The new window shows a potential request to send to your web service. You'll note thanks to the WSDLs and XSDs defined within the web service, SoapUI has automatically created a dummy payload with the required XML structure. We could overtype the inputElement's value, and then press the green arrow button to send the request to the web service, seeing this result:


The beauty of SoapUI is its taken care of virtually everything but the actual data values for you. Network communications, formation of the SOAP payloads, and even validating the XML structures. For the developer this is a boon as you can test one of your web services to see what's happening without writing any client side code.

Creating a test suite

The previous steps were good for one of adlibbed tests on our web service, but what if you wanted to create a series of tests, replay them, and add assertions based around the results? SoapUI offers the Test Suite.

In the navigator right click the dummy request (Request 1) and select Add to Test Case. In the Create Test Suite dialog, and the Create Test Case dialog, accept the default names. In the Add Request to Test Case dialog accept the defaults as following:



On accepting the dialog you'll have the following structure in the navigator and a new window for the Test Suite:


From the navigator you can guess that from the Test Suite you can create a number of Test Cases, with a sequenced set of Step Tests made up of requests. In our example the request has been copied from our previous dummy request:


Also unlike our original dummy request, with the test request open, looking at the bottom of the window we have an Assertions option, of which when we click on it (the word Assertion) we see the following:


An Assertion is a test to run against the web service response to ensure we get the result we require. The current Assertion SOAP Response – UNKNOWN is simply saying we should get a valid SOAP response. We could alternative add another Assertion to ensure the result is not a SOAP Fault by selecting the Add button then the "Not a SOAP Fault" option:


Once we've set up our tests and assertions, we want to run them. We return to the test case in the project navigator, open it and select the green arrow button to run the complete test suite. Assuming all things go well, we should see the following result:


If one of our assertions on our test case fails we'll see the following result:


Load/stress testing your web services

While running a test suite of tests can prove your web services are functionally correct, they don't tell you:

a) What's the maximum transactions per second (ie. load testing)
b) Does your program fail under multiple requests (ie. stress testing)

Load and stress testing are an integral part of ensuring your application will work on hitting productions.

Strictly speaking load and stress testing are proving different things, but for the remainder of this post I'll assume they're one and the same as they use the same facilities in SoapUI.

You'll have noted in the project navigator under the Test Suite an additional node Load Tests was created:


Right clicking on the Load Tests node, select New Load Test, accepting the default name in the New Load Test dialog, you'll see the Load Test window:


The easiest thing to do to understand this screen is just hit the green arrow. So what's happening?:


In the above picture you can see that the web service is being called multiple times. The process bar tells you the percentage completeness of the tests. The Limit field is the number of seconds the test will run for. The Threads is the number of threads (essentially simulated users) that SoapUI will spawn to send requests to the web service. Finally the Test Delay is the milliseconds between each response and next requests.

On completion of the test you'll see the collated statistics in the table:


Different figures are useful in assessing the performance of your web services, including:

Min and max shows you how fast and how slow your web service could process a request and send a response. Typically your worst time is on startup as the server initializes the web services.

Tps – the average transactions per second, which gives you a rough idea of the concurrent sessions you can support (remembering that at startup you will service less, but once the server is initialized generally you can support more)

Err – number of errors detected such as SOAP Faults.

Now an average of 6.71 transaction per second doesn't look that healthy. In this case it's SoapUI that's throttling your web services as the number of threads and the delay between requests means your web services can't fly, they're just not receiving enough work to do. If we change the numbers, increasing the threads, and reducing the delay as per the following screen shot we see we can really put our servers under some pressure:


(Nice bit about this screenshot is we're using an Oracle WebLogic Server behind the scenes, a fairly expensive server all round, but it certainly cranks along with this simplistic test case).

Read the original blog entry...

More Stories By Chris Muir

Chris Muir, an Oracle ACE Director, senior developer and trainer, and frequent blogger at http://one-size-doesnt-fit-all.blogspot.com, has been hacking away as an Oracle consultant with Australia's SAGE Computing Services for too many years. Taking a pragmatic approach to all things Oracle, Chris has more recently earned battle scars with JDeveloper, Apex, OID and web services, and has some very old war-wounds from a dark and dim past with Forms, Reports and even Designer 100% generation. He is a frequent presenter and contributor to the local Australian Oracle User Group scene, as well as a contributor to international user group magazines such as the IOUG and UKOUG.

@MicroservicesExpo Stories
Many organizations are now looking to DevOps maturity models to gauge their DevOps adoption and compare their maturity to their peers. However, as enterprise organizations rush to adopt DevOps, moving past experimentation to embrace it at scale, they are in danger of falling into the trap that they have fallen into time and time again. Unfortunately, we've seen this movie before, and we know how it ends: badly.
These days, APIs have become an integral part of the digital transformation journey for all enterprises. Every digital innovation story is connected to APIs . But have you ever pondered over to know what are the source of these APIs? Let me explain - APIs sources can be varied, internal or external, solving different purposes, but mostly categorized into the following two categories. Data lakes is a term used to represent disconnected but relevant data that are used by various business units wit...
There is a huge demand for responsive, real-time mobile and web experiences, but current architectural patterns do not easily accommodate applications that respond to events in real time. Common solutions using message queues or HTTP long-polling quickly lead to resiliency, scalability and development velocity challenges. In his session at 21st Cloud Expo, Ryland Degnan, a Senior Software Engineer on the Netflix Edge Platform team, will discuss how by leveraging a reactive stream-based protocol,...
Today most companies are adopting or evaluating container technology - Docker in particular - to speed up application deployment, drive down cost, ease management and make application delivery more flexible overall. As with most new architectures, this dream takes significant work to become a reality. Even when you do get your application componentized enough and packaged properly, there are still challenges for DevOps teams to making the shift to continuous delivery and achieving that reducti...
21st International Cloud Expo, taking place October 31 - November 2, 2017, 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. Me...
Enterprises are moving to the cloud faster than most of us in security expected. CIOs are going from 0 to 100 in cloud adoption and leaving security teams in the dust. Once cloud is part of an enterprise stack, it’s unclear who has responsibility for the protection of applications, services, and data. When cloud breaches occur, whether active compromise or a publicly accessible database, the blame must fall on both service providers and users. In his session at 21st Cloud Expo, Ben Johnson, C...
Many organizations adopt DevOps to reduce cycle times and deliver software faster; some take on DevOps to drive higher quality and better end-user experience; others look to DevOps for a clearer line-of-sight to customers to drive better business impacts. In truth, these three foundations go together. In this power panel at @DevOpsSummit 21st Cloud Expo, moderated by DevOps Conference Co-Chair Andi Mann, industry experts will discuss how leading organizations build application success from all...
‘Trend’ is a pretty common business term, but its definition tends to vary by industry. In performance monitoring, trend, or trend shift, is a key metric that is used to indicate change. Change is inevitable. Today’s websites must frequently update and change to keep up with competition and attract new users, but such changes can have a negative impact on the user experience if not managed properly. The dynamic nature of the Internet makes it necessary to constantly monitor different metrics. O...
The last two years has seen discussions about cloud computing evolve from the public / private / hybrid split to the reality that most enterprises will be creating a complex, multi-cloud strategy. Companies are wary of committing all of their resources to a single cloud, and instead are choosing to spread the risk – and the benefits – of cloud computing across multiple providers and internal infrastructures, as they follow their business needs. Will this approach be successful? How large is the ...
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...
You know you need the cloud, but you’re hesitant to simply dump everything at Amazon since you know that not all workloads are suitable for cloud. You know that you want the kind of ease of use and scalability that you get with public cloud, but your applications are architected in a way that makes the public cloud a non-starter. You’re looking at private cloud solutions based on hyperconverged infrastructure, but you’re concerned with the limits inherent in those technologies.
The nature of the technology business is forward-thinking. It focuses on the future and what’s coming next. Innovations and creativity in our world of software development strive to improve the status quo and increase customer satisfaction through speed and increased connectivity. Yet, while it's exciting to see enterprises embrace new ways of thinking and advance their processes with cutting edge technology, it rarely happens rapidly or even simultaneously across all industries.
Most of the time there is a lot of work involved to move to the cloud, and most of that isn't really related to AWS or Azure or Google Cloud. Before we talk about public cloud vendors and DevOps tools, there are usually several technical and non-technical challenges that are connected to it and that every company needs to solve to move to the cloud. In his session at 21st Cloud Expo, Stefano Bellasio, CEO and founder of Cloud Academy Inc., will discuss what the tools, disciplines, and cultural...
With the rise of DevOps, containers are at the brink of becoming a pervasive technology in Enterprise IT to accelerate application delivery for the business. When it comes to adopting containers in the enterprise, security is the highest adoption barrier. Is your organization ready to address the security risks with containers for your DevOps environment? In his session at @DevOpsSummit at 21st Cloud Expo, Chris Van Tuin, Chief Technologist, NA West at Red Hat, will discuss: The top security r...
"NetApp's vision is how we help organizations manage data - delivering the right data in the right place, in the right time, to the people who need it, and doing it agnostic to what the platform is," explained Josh Atwell, Developer Advocate for NetApp, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
The “Digital Era” is forcing us to engage with new methods to build, operate and maintain applications. This transformation also implies an evolution to more and more intelligent applications to better engage with the customers, while creating significant market differentiators. In both cases, the cloud has become a key enabler to embrace this digital revolution. So, moving to the cloud is no longer the question; the new questions are HOW and WHEN. To make this equation even more complex, most ...
One of the biggest challenges with adopting a DevOps mentality is: new applications are easily adapted to cloud-native, microservice-based, or containerized architectures - they can be built for them - but old applications need complex refactoring. On the other hand, these new technologies can require relearning or adapting new, oftentimes more complex, methodologies and tools to be ready for production. In his general session at @DevOpsSummit at 20th Cloud Expo, Chris Brown, Solutions Marketi...
Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
Today companies are looking to achieve cloud-first digital agility to reduce time-to-market, optimize utilization of resources, and rapidly deliver disruptive business solutions. However, leveraging the benefits of cloud deployments can be complicated for companies with extensive legacy computing environments. In his session at 21st Cloud Expo, Craig Sproule, founder and CEO of Metavine, will outline the challenges enterprises face in migrating legacy solutions to the cloud. He will also prese...
DevOps at Cloud Expo – being held October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA – announces that its Call for Papers is open. Born out of proven success in agile development, cloud computing, and process automation, DevOps is a macro trend you cannot afford to miss. From showcase success stories from early adopters and web-scale businesses, DevOps is expanding to organizations of all sizes, including the world's largest enterprises – and delivering real r...