Skip to main content link. Accesskey S
  • Help
  • IBM Logo
  • IBM Notes and Domino Application Development wiki
  • All Wikis
  • All Forums
  • THIS WIKI IS READ-ONLY. Learn more...
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
  • API Documentation
Search
Community Articles > Integrating Applications > Web Services > Testing your Domino web service provider and consumer using SoapUI.
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

Click to view profileIBM contributorSimon O'Doherty
Contribution Summary:
  • Articles authored: 4
  • Articles edited: 1
  • Comments Posted: 1

Recent articles by this author

Installing the C-API toolkit on Mac OSX 10.8.

This wiki article details how to install the C-API toolkit on Mac OSX. Developing at the command line and in Xcode.

Testing your Domino web service provider and consumer using SoapUI.

This walkthrough shows you how to test your Domino web service provider and consumer, using SoapUI.

Creating your first Web Service provider and consumer in LotusScript and Java.

This simple walkthrough will introduce you to create a LotusScript and Java Web Service provider and consumer. This tutorial assumes you have no knowledge of what web services are.

Connecting to a Domino server over SSL in Java, using a self signed certificate.

This walkthrough will detail how to create a self signed certificate, enable SSL on the Domino server and connect to that SSL connection in a Java application.
Community articleTesting your Domino web service provider and consumer using SoapUI.
Added by IBM contributorSimon O'Doherty | Edited by IBM contributorSimon O'Doherty on January 1, 2012 | Version 18
expanded Abstract
collapsed Abstract
This walkthrough shows you how to test your Domino web service provider and consumer, using SoapUI.
Tags: wsdl soap soapui domino webservices java
ShowTable of Contents
HideTable of Contents
  • 1 Introduction
  • 2 Initial Setup
  • 3 Setting up the SoapUI project
  • 4 Testing the web service provider
  • 5 Testing the web service consumer

Introduction

Any issues that arise from using web services normally can be traced back to the data sent via SOAP. SoapUI is a very powerful application and this walkthrough only covers the basics to capture the SOAP request and response. 

Initial Setup

You will need the following to complete this walkthrough. 

  • Domino server. 
  • Notes Designer + Admin client. 
  • SoapUI installed (defaults).
  • Completed the "Creating your first Web Service provider and consumer in LotusScript and Java" tutorial. 

In the examples below the following refer to your Notes/Domino install location.

  • Domino:  C:\Domino 
  • Notes: C:\Notes 

Change these to match your server as required. 


Setting up the SoapUI project

1. Launch SoapUI. 

 

2. Select the "File -> New Project" menu option. 

 

3. Fill out the following options on the dialog (leave the rest as default). Change SERVER_NAME to match your servers name (eg. localhost, whatever.lan ).

New SoapUI Project

  • Project Name: Test Hello World
  • Initial WSDL/WADL : http://SERVER_NAME/WS.nsf/HWLSP?WSDL
  • Create Requests: SELECTED
  • Create MockService: SELECTED

 

4. Click OK. 

 

5. SoapUI will load in the WSDL file and then display the "Generate MockService" dialog. Click OK. 

 

6. For the "Specify name of MockService to create" dialog just click OK. 

Generate Mock Service window

 

Your project is now created!


Testing the web service provider

1. In SoapUI expand your projects outline and double click the "Request 1" item. 

Request 1 window

 

2. The "Request 1" window will open up and has two sub windows in it. One is the SOAP request and should contain the following code. 

	<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

	xmlns:xsd="http://www.w3.org/2001/XMLSchema"

	xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

	xmlns:urn="urn:DefaultNamespace">

	   <soapenv:Header/>

	   <soapenv:Body>

	      <urn:HELLO soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

	         <TXT xsi:type="xsd:string">?</TXT>

	      </urn:HELLO>

	   </soapenv:Body>

	</soapenv:Envelope>

 

The "?" is the value that will be sent to the web service. Change that to "SOAP Test". Like as follows. 

 <TXT xsi:type="xsd:string">SOAP Test</TXT>

The second sub window on the right is the SOAP response. It will be blank. 

 

3. Click the run icon (Green Arrow). The SOAP response will show the response sent back by the server. 

Request 1 Run button

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

	xmlns:xsd="http://www.w3.org/2001/XMLSchema"

	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

	xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">

	   <soapenv:Body>

	      <ns1:HELLOResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:DefaultNamespace">

	         <HELLOReturn xsi:type="xsd:string">Hello SOAP Test</HELLOReturn>

	      </ns1:HELLOResponse>

	   </soapenv:Body>

	</soapenv:Envelope>

 


Testing the web service consumer

1. In SoapUI expand your projects outline and double click the "Response 1" item. 

Response 1 window

 

2. Paste in the SOAP response you got from testing the provider in the previous section. 

 

3. Close the "Response 1" window. 

 

4. in the SoapUI outline double click the "DominoSoapBinding MockService". This will open the Mock Service window. 

 

5. Select the settings icon (spanner + screwdriver). 

 

6. Make sure the host is set to your servers name and click OK. The settings in this dialog define the endpoint for your mock provider.

Mock Service Options

 

Translates to:

http://SERVER_NAME:8088/mockDominoSoapBinding

 

7. Click the run button. You will see the message "running on port 8088". 

Mock Service Running

 

8. Open WS.nsf on your server in Domino Designer. 

 

9. Expand the outline and select the Agents item. 

Designer outline

 

10. Select the "TestJava" and copy and paste it. This will create "Copy of TestJava" agent. 

 

11. Open "Copy of TestJava" agent. 

 

12. Open the "JavaAgent.java" file. 

 

13. Just after where stub is created add the following line to the code to define your endpoint (Change SERVER_NAME to your servers name). 

stub.setEndpoint("http://SERVER_NAME:8088/mockDominoSoapBinding");

 

The final file should look like this. 

	import lotus.domino.*;

	 

	public class JavaAgent extends AgentBase {

	 

	    public void NotesMain() {

	 

	      try {

	          Session session = getSession();

	          AgentContext agentContext = session.getAgentContext();

	 

	          HwProvider stub = new HwProviderServiceLocator().getDomino();

	          stub.setEndpoint("http://SERVER_NAME:8088/mockDominoSoapBinding");

	      

	          String answer = "" + stub.HELLO("world"); 

	          System.out.println("The answer is : " + answer); 

	 

	      } catch(Exception e) {

	          e.printStackTrace();

	       }

	   }

	}

 

14. Close and save the JavaAgent.java file. 

 

15. Close and save the "Copy of TestJava" agent. 

 

16. Right click on the agent and select "Run". 

 

17. When the agent completes select "Tools -> Show Java Debug Console" menu option. You will see the message "The answer is : Hello SOAP Test" displayed. 

Mock Service response

 

18. Go back to SoapUI and you will that your SOAP request has been logged. Double click it. 

Mock Service Request Captured

 

19. When the message viewer window opens you can see the web service consumers SOAP request which should be like as follows. 

 


	<?xml version="1.0" encoding="UTF-8"?>
	<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	 <soapenv:Body>
	  <ns1:HELLO soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:DefaultNamespace">
	   <TXT xsi:type="xsd:string">world</TXT>
	  </ns1:HELLO>
	 </soapenv:Body>
	</soapenv:Envelope>

 

expanded Attachments (10)
collapsed Attachments (10)
File TypeSizeFile NameCreated OnDelete file
image/x-png 9 KB MockService response.png 1/1/12, 5:20 AM
image/x-png 76 KB NewSoapUIProject.png 1/1/12, 5:23 AM
image/x-png 47 KB generateMockService.png 1/1/12, 5:28 AM
image/x-png 18 KB Request1.png 1/1/12, 5:30 AM
image/x-png 36 KB MockServiceOptions.png 1/1/12, 5:33 AM
image/x-png 18 KB Response1.png 1/1/12, 5:35 AM
image/x-png 24 KB Designer.png 1/1/12, 5:38 AM
image/x-png 34 KB MockServiceRequestCaptured.png 1/1/12, 5:47 AM
image/x-png 15 KB MockServiceRunning.png 1/1/12, 5:49 AM
image/x-png 12 KB Request1Run.png 1/1/12, 5:50 AM
expanded Versions (26)
collapsed Versions (26)
Version Comparison     
VersionDateChanged by              Summary of changes
26Jan 1, 2012, 6:12:26 AMSimon O'Doherty  IBM contributorMinor change
25Jan 1, 2012, 6:12:09 AMSimon O'Doherty  IBM contributor
24Jan 1, 2012, 6:11:18 AMSimon O'Doherty  IBM contributor
23Jan 1, 2012, 6:10:28 AMSimon O'Doherty  IBM contributor
22Jan 1, 2012, 6:05:07 AMSimon O'Doherty  IBM contributor
21Jan 1, 2012, 6:03:40 AMSimon O'Doherty  IBM contributor
20Jan 1, 2012, 6:02:23 AMSimon O'Doherty  IBM contributor
19Jan 1, 2012, 6:01:44 AMSimon O'Doherty  IBM contributor
This version (18)Jan 1, 2012, 6:00:04 AMSimon O'Doherty  IBM contributor
17Jan 1, 2012, 5:59:00 AMSimon O'Doherty  IBM contributor
16Jan 1, 2012, 5:56:29 AMSimon O'Doherty  IBM contributor
15Jan 1, 2012, 5:51:54 AMSimon O'Doherty  IBM contributor
14Jan 1, 2012, 5:50:49 AMSimon O'Doherty  IBM contributor
13Jan 1, 2012, 5:39:01 AMSimon O'Doherty  IBM contributor
12Jan 1, 2012, 5:33:15 AMSimon O'Doherty  IBM contributor
11Jan 1, 2012, 5:30:12 AMSimon O'Doherty  IBM contributor
10Jan 1, 2012, 5:23:55 AMSimon O'Doherty  IBM contributor
9Jan 1, 2012, 5:22:55 AMSimon O'Doherty  IBM contributor
8Jan 1, 2012, 5:21:02 AMSimon O'Doherty  IBM contributor
7Jan 1, 2012, 5:19:48 AMSimon O'Doherty  IBM contributor
6Jan 1, 2012, 5:17:47 AMSimon O'Doherty  IBM contributor
5Jan 1, 2012, 5:14:20 AMSimon O'Doherty  IBM contributor
4Jan 1, 2012, 5:12:57 AMSimon O'Doherty  IBM contributor
3Jan 1, 2012, 5:01:24 AMSimon O'Doherty  IBM contributor
2Jan 1, 2012, 4:56:22 AMSimon O'Doherty  IBM contributor
1Jan 1, 2012, 4:52:39 AMSimon O'Doherty  IBM contributor
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • FacebookIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkThe Social Lounge
  • Wiki Help
  • Forgot user name/password
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use