This documentation is for WSO2 Governance Registry 5.3.0. View documentation for the latest release.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
iconfalse

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.

For more information about the Web Services API, see Web Services API - WSO2 Governance Registry, and WS-API Sample.

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
maxLevel3
minLevel3
locationtop
styleborder:1
locationtop
typeflat
separatorpipe

...

Adding a Resource to the Registry

Code Block
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

Code Block
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

Code Block
String newPath = "/dev_guide_new/r1_move";

registry.move(path, newPath);

registry.rename(newPath, "r2_renamed");

...

Retrieving the Resource's Content

Code Block
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.

Excerpt
hiddentrue

Instructions on how to set up the WS-Registry Client and WS-Security in the Governance Registry.