Service Operations

This section describes the methods supported by the NPCL Web Services.

Get Schema

Returns the full set of NPCL types and constraints contained in a single identified topic map.

Method Name

GetSchema

Parameters
topicmap

The name of the topic map to return the NPCL schema for.

Returns

All of the NPCL types and constraints read from the named topic map will be returned as a document conforming to the NPCL XML Schema.

Errors
Error CodeCondition
INVALID_TOPICMAPThe name provided in the topicmap parameter does not match the name of any topic map known to the server. The client should retry, specifying the correct topic map name.
INVALID_SCHEMAThere was an error processing the schema information contained in the topic map. This error condition cannot be fixed without first modifying the topic map to correct the schema information it contains.
Examples

Example 47. Invoking the GetSchema Operation using HTTP GET

To get the schema for a topic map you can simply use a HTTP GET with a URL like the following:

http://topicmaps.mycorp.com/npclws/GetSchema.aspx?topicmap=mytopicmap

Example 48. Invoking the GetSchema Operation using HTTP POST

As an alternative the the GET method, you can POST an XML document containing the request parameters to the GetSchema.aspx request page. The XML document should look like this:

<request>
  <param name="topicmap">mytopicmap</param>
</request>

Example 49. Invoking the GetSchema Operation over SOAP using the Web Client library

The following C# snippet shows how to get the NPCL schema for a topic map using the Web Client library.

NpclClient client = new NpclClient("http://topicmaps.mycorp.com/npclws/NpclSchemaService.asmx");
XmlNode npclSchema = client.GetSchema("mytopicmap");

Get Forms Schema

Returns an XML document conforming to the NPCL Forms XML Schema which describes the occurrence and association constraints for each topic type in the specified topic map.

Method Name

GetFormsSchema

Parameters
topicmap

The name of the topic map to be read.

Returns

On success, returns an XML document conforming to the NPCL Forms XML Schema containing one nf:topicType element for each topic type defined in the NPCL schema for the specified topic map.

Examples

Example 50. Invoking the GetFormsSchema Operation using HTTP GET

To get the schema for a topic map you can simply use a HTTP GET with a URL like the following:

http://topicmaps.mycorp.com/npclws/GetFormsSchema.aspx?topicmap=mytopicmap

Example 51. Invoking the GetFormsSchema Operation using HTTP POST

As an alternative the the GET method, you can POST an XML document containing the request parameters to the GetSchema.aspx request page. The XML document should look like this:

<request>
  <param name="topicmap">mytopicmap</param>
</request>

Example 52. Invoking the GetFormsSchema Operation over SOAP using the Web Client library

The following C# snippet shows how to get the NPCL schema for a topic map using the Web Client library.

NpclClient client = new NpclClient("http://topicmaps.mycorp.com/npclws/NpclSchemaService.asmx");
XmlNode npclSchema = client.GetFormsSchema("mytopicmap");

Get Forms Schema For Type

Returns an XML document conforming to the NPCL Forms XML Schema which describes the occurrence and association constraints for the topic type in the specified topic map with the specified subject identifier.

Method Name

GetFormsSchemaForType

Parameters
topicmap

The name of the topic map to be searched for the topic type.

type

The subject identifier of the topic type whose constraints are to be returned.

Returns

On success, returns an NPCL Forms XML Schema containing on nf:topicType element which describes all of the applicable constraints for the topic type identified by the request parameters.

Note

If the topic identified by the type parameter is not an NPCL topic type, then the NPCL Forms XML Schema document returned will consist of only an empty nf:schema element.

Errors
Error CodeCondition
INVALID_TOPICMAPThe name provided in the topicmap parameter does not match the name of any topic map known to the server. The client should retry, specifying the correct topic map name.
INVALID_SCHEMAThere was an error processing the schema information contained in the topic map. This error condition cannot be fixed without first modifying the topic map to correct the schema information it contains.
NO_SUCH_TOPICNo topic was found in the specified topic map that has the requested type subject identifier.
Examples

Example 53. Invoking the GetFormsSchemaForType Operation using HTTP GET

To get the schema for a topic map you can simply use a HTTP GET, passing the parameters in the URL. Note that the subject identifier in the type parameter will require URL escaping.

http://topicmaps.mycorp.com/npclws/GetFormsSchemaForType.aspx?topicmap=mytopicmap&type=http%3A%2F%2Fpsi.example.com%2f...

Example 54. Invoking the GetFormsSchemaForType Operation using HTTP POST

As an alternative the the GET method, you can POST an XML document containing the request parameters to the GetFormsSchemaForType.aspx request page. The XML document should look like this:

<request>
  <param name="topicmap">mytopicmap</param>
  <param name="type">http://psi.example.com/organization/company</param>
</request>

Example 55. Invoking the GetFormsSchemaForType Operation over SOAP using the Web Client library

The following C# snippet shows how to get the NPCL schema for a topic map using the Web Client library.

NpclClient client = new NpclClient("http://topicmaps.mycorp.com/npclws/NpclSchemaService.asmx");
XmlNode npclSchema = client.GetFormsSchemaForType("mytopicmap", "http://psi.example.com/organization/company");