The Web Services-Interoperability Organization (WS-I) was formed by Oracle
and other industry leaders to promote the interoperability of web services technologies
across a variety of platforms, operating systems, and programming languages.
JDeveloper provides tools that allow you to test the interoperability of web
services by checking that the services conform to the WS-I Basic Profile (currently
Version1.1).
WS-I analyzes web services for interoperability across four areas:
Discovery of a service via a UDDI registry entry
Description of a service using WSDL file
Messages being exchanged by a running service, usually over a network
Envelope used for transmitting the message
A set of test assertions is used to test a web service for conformity across
these areas.
This How To document describes the steps to analyze a service for conformance
to the Basic Profile using JDeveloper's integrated WS-I testing environment.
The HTTP Analyzer is used to monitor and log running web services and you can
use any WS-I conformant analyzer and test assertions (called the testing tools)
to check conformance with the Basic Profile. In this document, you use the tools
provided by WS-I.
Using JDeveloper a tested web service can be:
one you have created that is listed in the Navigator (a WSDL file or web
service container)
a deployed, running web service that you call using a client-side proxy
a web service listed in a UDDI connections node
This How To shows you how to analyze each of these types of service.
In JDeveloper, open the Preferences dialog (Tools-->Preferences) and
navigate to the WS-I Testing Tools preferences.
Set the Home Location to your stored testing tools location
You need to specify the Test Assertions document that you plan to use.
A Test Assertions document is included as part of the testing tools that
you downloaded in the step above so if you intend to use this one, check
the Specify Test Assertions Document check box and navigate
to the \common\profiles
subdirectory of the location where you unzipped the downloaded file. Select
the BasicProfile_1.1_TAD.xml
file and click Open. However, if you wish to use your own set of assertions,
specify its location here.
Test the WSDL description of a service
This How To uses an Oracle J2EE web service as an example. You can also generate
an Apache SOAP web service and a JAX-RPC web service using the JAX-RPC extension
available from OTN. It is outside the scope of this How To
to provide a detailed description of publishing and running a web service.
Running the Analyzer against the WSDL file
Create HelloWorld Java class
public class HelloWorld
{
public HelloWorld()
{
}
public String sayHello(String name)
{
return "Hello " + name;
}
}
Publish as Oracle J2EE web service named HelloWorldService
If the Log window is not open, use the menu View -> Log Window to display
it
Use context menu of generated HelloWorldService to analyze the WSDL file
Note that the log window returns the messages from the WS-I testing tool.
The WS-I tools and output are fully integrated into the JDeveloper IDE
Note that the WS-I Profile Conformance Report (wsi-report.html) is generated
and opened for viewing
Reading the Conformance Report
Scroll down to the Summary section. Note that this WSDL
file has passed the interoperability checks. Also note that the report is
broken into four areas (discovery, description, message, envelope)
Scroll down to the Artifact: discovery section. The discovery
section covers the conformance of a web service's entry in a UDDI registry.
In this example a UDDI registry was not used - so all the assertions are flagged
as Missing Input. Note: Missing inputs do not constitute
failure, however you should check that you are expecting missing inputs (as
in this case).
Scroll down to the Artifact: description section.
Scroll down through the Summary Table and note the color
scheme used for Assertion IDs. Those that have passed the conformancy checks
are listed in green; those to which the checks are not applicable are listed
in blue, and those that have some input missing are listed in red.
You can click on any Assertion ID to see details about the selected assertion.
Click BP2098 to see the details of its Test Assertion to
understand why it has been flagged as having input missing. As you see from
the screenshot below, it highlights the fact that the import element in the
WSDL has an empty value for the location attribute.
Scroll down to the Entry list table. This table allows
you to see the test results for the various component types in the web service.
Click the Reference Id for the sayHello
message type.
Note that the two assertions in this message have passed the conformancy
test.
Scroll to the Artifact: message section of the report.
This section of the report tests the conformancy of the messages being passed
between a client and a web service. In this example we are testing a WSDL
file only, so all the inputs to this section are flagged as missing
Test the messages of a running service
To test the HelloWorldService you run it using the embedded OC4J in JDeveloper
and generate a Java proxy client to call it. It is outside the scope of this
How To to provide detailed steps on achieving this, but if you need guidance
on how to do these steps, refer to the OBE tutorials, Developing Contract-Driven
Web Services Using JDeveloper and Developing, Deploying and Managing
Web Services Using JDeveloper and Oracle Application Server on OTN.
Running the HTTP Analyzer against the WSDL file
Run the HelloWorldService you created earlier using the embedded OC4J.
Generate a Web Service proxy and add the following line to the Main method
System.out.println(myPort.sayHello(" to you "));
Run the proxy and view the output in the Log window
hello to you
Process exited with exit code 0.
Open the HTTP Analyzer from the View menu and click the green Start button
Run the client again. Note the request/response packets are listed in the
HTTP Analyzer.
To see the contents of a packet pair, select it in the History page, then
click the Data tab. The data page shows the value that was sent to the web
service in the request information (left panels), and the value returned by
the web service in the response information (right panels).
If you have run other things with the HTTP Analyzer started, you can use the
Previous Request/Response Pair and Next Request/Response Pair buttons to examine
other packet pairs.
Stop the HTTP Analyzer by clicking the red Stop button. Then click the WS-I
Analyze button (last icon on the right) to launch the WS-I Analyze
wizard. The WS-I Profile Conformance Report is produced.
To close the HTTP Analyzer window, click the x on the HTTP Analyzer tab.
Reading the Conformance Report
Scroll down to the Summary section. Note that, again, this
service has passed the conformancy checks. Again, the report is broken into
the four areas (discovery, description, message and envelope)
The Description and Discovery sections should be the same as in the WSDL report
created earlier in this example
Under the Summary section, click on the message link to
navigate to the Artifact: message section. Notice that this
time most of the assertions have passed the checks, with a few reported as
Not Applicable. However there are no failures.
( If the table shows all the assertions as Missing Input, then there is a
mismatch between the endpoint that is named in the conformance report and
the endpoint that is being returned over the wire. See Troubleshooting).
Test the discovery of a service via a UDDI registry
In this release of JDeveloper you can test the WSDL file of a web service from
a UDDI registry entry. You cannot use JDeveloper to analyze the Discovery
portion of the Basic Profile that checks conformance of the UDDI Registry
entry itself.
Locating a web service in the UDDI registry
In the JDeveloper Connections Manager, expand the UDDI Registry
node. Note that it contains a default connection to the XMethods Public
UDDI Registry. Right-click this connection and choose Find
Web Services from the context menu. The Find Web Services wizard
is invoked
In the wizard choose to search by category, then select the UDDI Types taxonomy
and expand the Web Service Specification and XML Based Web Service Specification
nodes. Choose Web Service Described via WSDL and shuttle
it into the Selected pane and then click Next.
A list of tModels is displayed. You scroll through the list to select a
tModel. In reality this would be the tModel for a web service you plan to
use in your application, and which you first want to check for WS-I Basic
Profile conformance. For this How To select Address Finder(Netherlands)
and click Next.
Step 5 of the wizard displays details of the tModel you have selected. When
you click Finish JDeveloper offers you a number of choices
for what to do with the web service. Specify that you want to generate a proxy
for the service into your project.
The Create Web Service Proxy wizard is invoked. Once the proxy has been
created you see the service in the UDDI Registry node in the Connections Navigator
Analyzing the WSDL
In the UDDI Registry expand the new node to identify the WSDL. Right-click
the WSDL and from the context menu, choose WS-I Analyze WSDL
Browse the generated wsi-report.html
Description section for conformance failures and warnings
Troubleshooting
Problem
Possible Solution
Message Assertions all have Missing Input
You are running a WSDL analysis only so only the Description assertions
are tested
The machine name and port no. captured in the wsi-report.html do not
correspond to the name and port being returned 'over the wire'. This is
most likely to occur when you are running the service in the embedded
OC4J. Check that the port number is 8988 (in the WSDL file) before you
start to run the TCP Packet Monitor. Also, try changing the machine name
to the IP_address or the hostname (in lower case). See the JDeveloper
online Help topic Analyzing Web Services Running in the Embedded Server
for more details
Service Name and Port No. of WS-I Analyze Web Service Wizard
are blank
The web service is not running. Deploy and start the service
or use the embedded OC4J
The machine name and port no. do not correspond (see above)
HTTP Analyzer does not capture request and response data
Check your proxy settings. If you have problems making connections
from JDeveloper you may need to change the proxy server settings you use.
For example, if you are connecting to an IP address behind a proxy server,
and your machine is also behind the same proxy server, then make sure that
JDeveloper's web proxy preferences exclude the IP address you are trying
to connect to. For more information see JDeveloper online Help topic Proxy
Settings and the HTTP Analyzer
Expanding UDDI Registry and XMethods node gives a 'Failed
to Find Business Entites' message
As above, you need to check your proxy settings. If you have
problems making connections from JDeveloper you may need to change the proxy
server settings you use. For example, if you are connecting to an IP address
behind a proxy server, and your machine is also behind the same proxy server,
then make sure that JDeveloper's web proxy preferences exclude the IP address
you are trying to connect to.
Discovery section of wsi-report.html has missing inputs
JDeveloper does not test the Discovery assertions of WS-I
Basic Profile 1.0
Search by Category of IBM/Microsoft Public registry does
not return enough rows
Sometimes providers place restrictions on the number of rows
that are returned by a Category search. There is now way to get round this.
Category searching is most effective when used for private UDDI instances.
Conclusion
JDeveloper seamlessly integrates the testing of web services against WS-I Basic
Profile 1.1. You can test both the description and messages of services. It
is up to the user to decide whether failure to meet a specific Basic Profile
assertion will impact the interoperability of a particular service in their
environment.