Use the Web Service Client wizard to perform repeatable tests. The Web service client test provides a Java client to invoke the service and generates a Java class containing a JUnit test for each of the service methods. You then modify the JUnit test to provide the desired input. Use Assert statements to verify that the result is the expected result.
A <testclientname>.TestClient.java file is generated as a result of this process. To change the test data, such as to modify the parameters that are submitted when each service method is invoked or to run multiple invocations, edit this file.
Once the Java client is created, you can then automate the unit tests.
You can also use SOAP Inspector [link] to view the raw message.
From the context menu of a published service in the UDDI Browser
From the context menu of a deployed service in the Unwired Orchestrator or EAServer 5.x Connection Profile
From New | Other | Sybase | Web Service Client wizard.
To test a service using the Web Service Client wizard:
Configure proxy settings if it has not been done.
In the Enterprise Explorer view, right-click the WSDL document of a published service and select Create Web Service Client.
The Create Web Service Client wizard appears.
On the WSDL File page, complete the following:
WSDL File Page
Field | Description |
---|---|
From Local File | Click Browse to navigate to the WSDL document of a service in one of your projects, for example, my project|my service|myService.wsdl. |
From URL | Click Browse UDDI to navigate to the WSDL document of a published service in a UDDI registry. |
Validate WSDL | Verifies that the WSDL document can be used to create a Java client. If the message "Validation succeeded" appears, the WSDL is a well-formed XML doc. If the message "Validate failed" appears, check the structure of the WSDL. |
Click Next.
In the Select a Project page, select the project in which to store the new Java client or click Create New Java Project to create a separate project for it.
Select the target project and click Add Required Jars to Project.
Click Next.
On the Project References page, select projects containing resources used by the Java client and click Next.
In the Java Package page, select an existing package from the Package menu or enter the name of a new package to be created for the Web service client, for example, myPkg.
Click Next.
In the WSDL2Java Options page, define the options for generating the Java code for the Web service client. The Java classes generated by this wizard require JAR files such as axis.jar.
The default settings for the following options are sufficient for most uses.
WSDL2Java Options
Field | Description |
---|---|
Generate Code for This WSDL Only | Generate code only for the WSDL document that appears on the command line. The default behavior is to generate files for all WSDL documents: the immediate one and all imported ones. |
Timeout | Enter the number of seconds after which the process automatically stops if no results are returned. Default is 45 seconds. |
Use Special Treatment for "Wrapped" Document/Literal Style Operations | This turns off the special treatment of what is called wrapped document/literal style operations. By default, WSDL2Java recognizes certain conditions and unwraps the top-level element, treating each of the components of the element as arguments to the operation. |
Type Mapping Version | Choose the default type mapping registry to use: 1.1 or 1.2. The default is 1.2. |
Generate Code for All Elements (Including unreferenced ones) | Select the default behavior, which is to generate files for all WSDL documents: the immediate and all imported WSDLs. |
Emit Separate Helper Classes for Metadata | Choose whether to emit separate Helper classes for the metadata. |
User Name | Enter a user name accessing secured WSDL documents. See Adding Code for Testing a Password-Protected Web Service. |
Password | Enter a password for accessing secured WSDL documents. See Adding Code for Testing a Password-Protected Web Service. |
For additional information, go to http://ws.apache.org/axis/java/reference.html.
In the Input Parameters section, type or paste all values expected by the service.
Note that when using dateTime or time functions with the Dialog Tester or the Web Service Client Wizard, the time is sent as a UTC in the SOAP Request. For example, if a dateTime of 2006-03-07T17:00:00 (Mountain Standard Time) is entered, the SOAP Request would contain the dateTime 2006-03-08T00:00:00.000Z (Greenwich Mean Time). The UTC date format should be used in the rule for an AXIS client.
For additional information, see Using the Expression Editor or go to http://www.w3schools.com/schema/schema_dtypes_date.asp.
Click Invoke to call the method using the input you entered.
The results appear in the Output Parameter field.
Review the output.
Binary response data displays as an array.
Click Back to enter a new set of input parameters or Finish to generate the <testclientname>.TestClient.java file.
Testing a Service Using the Dialog Service Test Wizard
Testing a Service Using the SOAP Request Response Service Test Wizard
Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com