NetworkedPlanet | TMCore Web Services Guide |
This section describes the methods supported by the NPCL Web Services.
Returns the full set of NPCL types and constraints contained in a single identified topic map.
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.
Error Code | Condition |
---|---|
INVALID_TOPICMAP | The 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_SCHEMA | There 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. |
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");
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.
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.
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");
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.
The name of the topic map to be searched for the topic type.
The subject identifier of the topic type whose constraints are to be returned.
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.
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.
Error Code | Condition |
---|---|
INVALID_TOPICMAP | The 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_SCHEMA | There 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_TOPIC | No topic was found in the specified topic map that has the requested type subject identifier. |
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");