Previous Topic: Error RepliesNext Topic: Query String in URIs


URIs, HTTP Methods, and XML Documents

A URI represents a CA Automation Point resource upon which operations are performed. The meaning of an HTTP method is determined by the specified URI. The API documentation is organized alphabetically by each resource URI and HTTP method. These methods accomplish each CA Automation Point operation, and identify the XML documents that are required or delivered by that operation.

These methods are documented in:

The base name of a URI targeted to a CA Automation Point web service running under Tomcat on the local machine using TLS would be:

https://localhost:8443/apwebsvc

This example base name is used for all URIs listed in the upcoming sections. In practice, a specific host name is used by a client application running on another computer. Further, a site can choose to configure Tomcat to use a non-default port number. Finally, during initial testing, a site may choose to avoid TLS for simplicity. That site would then use the http scheme and the non-TLS default Tomcat port of 8080. Utilize your site-specific values for any URI in upcoming examples. The remainder of the URI reflects the CA Automation Point resource of interest.

When issuing a web service request from the command line using the CA RequestService client application, be aware of special characters that your operating system recognizes. These special characters are likely introduced when specifying a query, which is expressed as part of the URI. When the URI contains such special characters, enclose this URI in double quotes. The command interpreter for your operating system does not interpret special characters when enclosed in double quotes. For example, when requesting a list of all sessions that are automated, you issue a GET request with a query:

https://localhost:8443/apwebsvc/sessions?Automated=yes

On a Windows operating system, the equals sign is interpreted by the Windows Command Interpreter. The syntax is not interpreted as a single URI parameter, and the command fails. To prevent Windows from misinterpreting this parameter, enclose the parameter in double quotes:

“https://localhost:8443/apwebsvc/sessions?Automated=yes”

As each XML document is identified in one of the described methods, the XML schema that defines that document is specified. The XML schemas for all CA Automation Point web service XML documents are contained in:

%ap_home%\distrib\websvc\*.xsd

Documentation for all AP web service XML schemas is contained in:

%ap_home%\Doc\help\websvc\xmlSchemas\*.html

In XML documents, CA Automation Point web services utilize namespaces to avoid naming conflicts. Set the CA Automation Point web service namespace as the default namespace in an attribute of the root element. Setting this attribute allows all CA Automation Point elements not to require qualifiers in this document. Each CA Automation Point XML document is validated against the XML schema, which defines that document. Specify the name of the schema as an attribute in the root element.

Example General Format:
<?xml version="1.0" encoding="utf-8"?>
<YourXMLDocumentRootElement
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ca.com/distauto/ap/websvc/msgData   XmlSchemaName.xsd"
xmlns="http://www.ca.com/distauto/ap/websvc/msgData">

<ContentOfYourXMLDocument>
</YourXMLDocumentRootElement>

Note: Only the XML schema name (bolded) changes from one document to another.

Example Specific Case:

This example sends a simple notification.

<?xml version="1.0" encoding="utf-8"?>
<NotificationRequest
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ca.com/distauto/ap/websvc/msgData   NotificationRequest.xsd"
xmlns="http://www.ca.com/distauto/ap/websvc/msgData">

<Name>PersonThatYouWantToNotifiy</Name>
<Tell>Hi. This is a notification test.</Tell>
</NotificationRequest>