The Registry WS API is one of many APIs supported by the WSO2 Governance Registry. Read more on Supported APIs and Standards for a complete list of APIs supported by WSO2 Governance Registry.
The operations of the WSO2 Governance Registry can now be accessed through Web Service calls using the Web Service API (WS-API).
The WS-API supports almost all operations exposed through the main Registry API. A WS client is provided for the WS-API which allows you to access the Registry just as you would through the main Registry API.
Setting up the WS API Registry Client and WS-Security
The following code shows how to set up the WS Client and authenticate it against an instance of the Governance Registry.
|Table of Contents|
Adding a Resource to the Registry
Resource r1 = registry.newResource(); String path = "/dev_guide/r1"; String r1content = "R1 content"; r1.setContent(r1content); registry.put(path, r1);
Commenting, Tagging and Rating a Resource
registry.addComment(path, new Comment("This is a WS-API comment")); registry.rateResource(path, 5); registry.applyTag(path, "WS tag");
Moving and Renaming a Resource
String newPath = "/dev_guide_new/r1_move"; registry.move(path, newPath); registry.rename(newPath, "r2_renamed");
Retrieving the Resource's Content
Resource resource = registry.get("/dev_guide_new/r2_renamed"); System.out.println(new String((byte)resource.getContent()));
This will output the original content to the console, for example, "R1 content."
See more operation in Basic Registry API Knowledge.
Instructions on how to set up the WS-Registry Client and WS-Security in the Governance Registry.