WSO2 Governance Registry has the capability to discover the services via ws-discovery and store the discovered services and related metadata. If you have set up WSO2 Governance Registry as a remote governance registry for your application, you have the option of configuring your server to use the governance registry as a WS-Discovery proxy. Any WS-Discovery compliant web services hosting server (E.g.: Axis2/JAX-WS/JAX-RS) can be configured to use Governance Registry as a WS-Discovery proxy, which would discover any deployed services for governing purposes such as LifeCycle Management.
The following instructions explain how to discover JAX-WS/JAX-RS web services in WSO2 Application Server using WS-Discovery in the WSO2 Governance Registry:
Add the following property to the
axis2.xmlfile of WSO2 AS to configure WSO2 Governance Registry (GReg) to work as a WS-Discovery proxy. In this example, the value of the parameter is the endpoint of the "DiscoveryProxy" service, which is deployed in Governance Registry to discover services.
- If required, you can define scopes and the metadata version as a
WEB-INF/web.xml. If the scopes and metadata version are not defined, the default version will be effective.
The following configuration adds the http://wso2.com/as scope:
The following configuration adds the metadata version:
Start the two products (WSO2 Governance Registry and WSO2 Application Server) following the instructions in Running the Product.
Note that you must add a port offset in the
<PRODUCT_HOME>/repository/conf/carbon.xmlfile to ensure that both products are not using the same port.
- Log in to the management console of WSO2 AS and add a JAX-WS service (E.g. java_first_jaxws.war). The service would be displayed on the service list.
Now, log in to the management console of WSO2 Governance Registry and go to the Services menu. The service list will display the services that were deployed in Application Server.
The name of this service will be shown as the web application name followed by the name of service available in the web application. For example, if java_first_jaxws.war has a service called hello_world, then the service will be listed as java_first_jaxws_hello_world.
This means that Governance Registry has discovered all the web services deployed in Application Server and stored them in Governance Registry. Now these service endpoints can be used from Governance Registry for various purposes.