...
This sample explains how to use the Governance API of WSO2 Governance Registry to create a simple webservice which is capable of looking up service endpoints. WSO2 Governance Registry contains an Apache Axis2 based runtime as a part of the WSO2 Carbon Framework. You can deploy web services on this runtime, which can be used as internal endpoints to receive notifications generated on the WSO2 Governance Registry. We will be reusing the code of the Handler Sample in this example. This sample requires Apache Maven. See Installing Apache Maven on Windows or Installing Apache Maven on Linux. This Installation Prerequisites for links on how to install it. This example also explains how to use soapUI, which is a very useful tool for testing web services.
...
2. Add the following dependency to your POM file:
Info | title | Tip
---|
Project Object Model (POM) is an XML representation of a Maven project held in a file named pom.xml. You should find POM file by the name pom.xml inside |
...
Code Block | ||
---|---|---|
| ||
<!--Fragment-Host>org.wso2.carbon.registry.core</Fragment-Host--> |
Info | title | Tip
---|
The Fragment-Host Bundle Manifest Header declares this sample bundle to be a Fragment of the Registry Kernel. This would mean that the sample handler bundle will become an extension to the Registry Kernel. However, bundles containing Since the Fragment now also being an extension to the Registry Kernel, the combination of this bundle and the Registry Kernel (plus any other fragments) should start up before the Apache Axis2 runtime. But, due to the bundle not getting deployed until the Apache Axis2 runtime has been initialized, it will create a deadlock situation. Due to this reason, we have to get rid of the Fragment-Host header. |
...
Code Block |
---|
mvn clean install |
Info | title | Note
---|
The command |
A successful run of Apache Maven will generate a report similar to the following:
...
Code Block |
---|
http://localhost:9763/services/EndpointLookupService/getEndpoints?serviceName=SimpleStockQuoteService&environment=Dev |
Info | title | Note
---|
In this step, we only have passed in the parameters serviceName and environment. This sample service also supports serviceNamespace and version as optional parameters. |
...