Export (0) Print
Expand All

Programming Using the Orchestrator Web Service

System Center

Updated: December 20, 2012

Applies To: System Center 2012 - Orchestrator, System Center 2012 R2 Orchestrator, System Center 2012 SP1 - Orchestrator

You can use any programming language or scripting language to use the Orchestrator web service as long as it has the ability to send an HTTP request and receive its response.

Programming in Visual Studio With the Orchestrator Web Service

If you are using Visual Studio to create your application using the Orchestrator web service, you can add a Service Reference to your project which allows you to work with the web service without the complexities of building the HTTP requests. With a service reference added to your project, you start your code by creating an OrchestratorContext object. This object provides you access to all of the collections and entries provided by the Orchestrator web service. See the code samples in this section for examples of how to use the service reference and the OrchestratorContext object.

To add a service reference to a Visual Studio project

  1. In Solution Explorer, right-click the name of the project that you want to add the service to, and then click Add Service Reference.

  2. In the Address box, enter the URL for the Orchestrator web service, for example http://server1.contoso.com:81/Orchestrator2012/Orchestrator.svc. If your current user account doesn’t have access to Orchestrator then you may be prompted for a username and password.

  3. Click Go.

  4. In the Namespace box, enter the namespace that you want to use for the reference, for example SCOService.

  5. Click OK.

Scripting With the Orchestrator Web Service

Scripts written in such languages as Windows PowerShell and VBScript do not have the ability to use a service reference like in Visual Studio. You must explicitly construct the URL to perform the query or action that you want to perform and include it in an HTTP request. You use a GET request method to retrieve data from the Orchestrator database and a POST request method to update data. Data is returned in XML according to the AtomPub standard, and you must provide logic in your script to parse and interpret this information. See the code samples in this section for examples of how to create scripts using Windows PowerShell.

A set of functions and sample scripts using Windows PowerShell is available on CodePlex. While these scripts are not officially supported by Microsoft, they can alleviate a significant amount of complexity in constructing the required HTTP requests for the most common scenarios using the Orchestrator web service.

See Also

 
Show:
© 2015 Microsoft