Validating WSDLs with WSO2 Governance Registry on a Machine that Doesn't Have an Internet Connection

  • By Lasith Chandrasekara
  • 19 Jun, 2013

Introduction

Adding a WSDL file to WSO2 Governance Registry requires active internet connection to accomplish the WSDL validation. When validating the WSDL, the Governance Registry will make a connection to ws-i.org site, in order to get few resources [3]. There can be problems and delays in validating WSDL, if the machine doesn't have an active internet connection at the moment. So, as a workaround for this issue, from this article we are going to explain how to host those required resources locally and validate WSDLs using those locally hosted resources without using an internet connection.

Applies To

WSO2 Governance Registry Version 4.1.0 and above

Table of Contents

  1. Install and running Apache server
  2. Publish files on Apache server
  3. Editing hosts file
  4. Verifying the steps
  5. Conclusion

Install and running Apache web server

If you are not already installed the Apache web server, please refer the [1] to download the latest version of the Apache web server.

For windows installations, you should download the windows version of Apache (the file with the .msi extension). For Linux based environments, binary releases are not often up to date. Therefore you can build Apache web server from its source in order to get the latest version. Resource [2] explains about building Apache web server from its source for Linux based environments.

To install and run, please refer the relevant section on Apache web server official documentation [4].
For windows installations please refer Apache windows installations documentation [5].

At the time when writing this article, the latest Apache web server version is 2.4. Therefore the instructions and references used in this article are related to the latest Apache server documentation version (2.4).

To verify the installations run the Apache server and locate the following link on your browser.

http://localhost/ or http://127.0.0.1/

Your browser should display content related to Apache web server. If not, you may have to check error logs of the Apache web server and resolve issues.

Publish files on Apache server

Please refer the Apache documentation [4] to locate the "web site publish directory" of the Apache server.

e.g. For Linux it is "/var/www" and for windows it can be "C:\Program Files (x86)\Apache Group\Apache2\htdocs"

As mentioned in the introduction section, WSO2 Governance Registry is connecting to ws-i.org to download few resources (which is two xml files). We should manually download these resources (xml files) and publish them on our Apache web server.

To do so, download following xml files from a computer, which is having an internet connection. When we are adding WSDL through Governance Registry to complete the validation Governance Registry needs these xml files.

http://ws-i.org/Testing/Tools/2004/12/AP10_BP11_SSBP10_TAD.xml

http://ws-i.org/Testing/Tools/2005/01/SSBP10_BP11_TAD_1-0.xml

After downloading above files, save them inside your "web site publish directory" of the Apache web server. Please remember to save these files under the corresponding folder structure (that matches the url resource path of ws-i.org site) inside your "web site publish directory" of the Apache web server.

e.g For a Linux environment it should be,

/var/www/Testing/Tools/2004/12/AP10_BP11_SSBP10_TAD.xml

/var/www/Testing/Tools/2005/01/SSBP10_BP11_TAD_1-0.xml

Above resource files (TAD- test assertion documents) contains, test assertions for WS-I profiles. These test assertions are used by the analyzer tool (inside the WSO2 Governance Registry when validating WSDL file), in order to determine the conformance of web service.

To verify what we have done so far, please locate the following links on your browser.

http://127.0.0.1/Testing/Tools/2004/12/AP10_BP11_SSBP10_TAD.xml

http://127.0.0.1/Testing/Tools/2005/01/SSBP10_BP11_TAD_1-0.xml

Above links should display the content of TAD xml files in the browser. If not something went wrong and please check the steps you have followed carefully.

Editing the hosts file

Hosts file is a text file that contains entries to map host names to IP addresses. By editing this file we can redirect requests (by Governance Registry) requesting ws-i.org site resources to out locally hosted Apache web server resources. In Linux environment, hosts file located at,

/etc/hosts

In windows it is under,

%SystemRoot%\system32\drivers\etc\hosts.

Please refer reference [6] to get more information about hosts file paths on different environments.
Open the hosts file on your machine and add following entries to it (better to take a backup of this hosts file, that is for safe side, before modifying this file).

127.0.1.1 www.ws-i.org

127.0.1.1 ws-i.org

Note: In this article we assume that Apache web server and WSO2 Governance Registry is installed on the same machine. But if you want, you can install Apache web server on another machine with appropriate changes to the hosts file (which is in the Governance Registry running machine) you can point to the Apache web server machine.

Verifying the steps

To verify this step, locate the following link on your browser (on the machine which is not having an internet connection),

http://www.ws-i.org/Testing/Tools/2004/12/AP10_BP11_SSBP10_TAD.xml

If you're able to see the content of the above .xml file, which is in the above link, that means WSO2 Governance Registry is ready to validate WSDL on a machine which is not having an internet connection.

To add WSDLs to the WSO2 Governance Registry, first you have to start up your WSO2 Governance Registry and log into it with credentials. Then please refer the managing WSDLs section on Governance Registry documentation [3] to add WSDLs.

If you have followed the above steps correctly, then you should be able to add and validate WSDL resources successfully with the WSO2 Governance Registry which runs on a machine that doesn't have an internet connection.

Note: This WSDL validation can be skipped by setting the disableWSDLValidation property to true on the corresponding handler configuration (you can edit handler configurations by editing registry.xml file which is located in the GREG_HOME/repository/conf/). If it is possible for you to skip this validation, then we don't need internet connection since those TAD files are required only during the validating phase ( to check the conformance of web service). Please refer managing WSDLs section on Governance Registry documentation [3] for more information.

Conclusion

WSO2 Governance Registry allows us to add WSDL files. But when adding WSDLs the Governance Registry validates WSDL files. When validating, it is necessary to have an internet connection in order to get TAD (Test assertion documents) files from ws-i.org to check the conformance of the web service. Above steps explains the process of locally hosting those required TAD files into a local web server and routing WSO2 Governance Registry requests to those locally hosted files. That allows WSO2 Governance Registry to validate WSDLs without the internet connection.

References

Author

Lasith Chandrasekara, Senior Software Engineer, WSO2 Inc.

About Author

  • Lasith Chandrasekara
  • Senior Software Engineer
  • WSO2 Inc.