Skip to main content

Web Service API

The Web Service provides a direct interface to SCCM and can be used by third-party applications.

For more information on how to use the interface, see the API Reference at:

If SOAP header security is enabled, the web service can only be called with a specific SOAP header. This is generated using the enclosed .NET class library. In addition, a suitable token must be created. This configuration is explained below using an example.

Integration in Visual Studio

This video shows the steps described here:

Video fehlt: "WebService-API-Anbindung"

  1. Configuration in the configuration file "web.config" of the web service (alternatively via the application "SCCM Manager Web Config" on the server, open via the start menu):

    soap_header_setting_thumb_480_0.png
    The "AssemblyName" is freely selectable and will be displayed later in the web service log next to the calling user.

  2. Generation of a random GUID and extension of the "Tokens.xml" file in the "Resources" directory of the web service:

    soap_header_token_thumb_480_0.png
  3. Include the web service reference in Visual Studio:

    WebService-API-03_thumb_480_0.pngWebService-API-04_thumb_480_0.pngWebService-API-05_thumb_480_0.pngWebService-API-06_thumb_480_0.png
  4. Include the file "SCCMWebService.Token.dll" in Visual Studio:

    The SCCMWebService.Token.dll from Server installation path\Copy API to your own project directory, then reference it.
    overview-target.png


  5. Instantiation of the web service with the Soap header, the GUID passed corresponds to the one previously defined from the "Token.xml" file:

    			SCCMWebService.SCCMWebService sccmWebService = new SCCMWebService.SCCMWebService();
    			sccmWebService.Credentials = CredentialCache.DefaultCredentials;
    			sccmWebService.CookieContainer = new CookieContainer();
    
    			string sessionID = sccmWebService.GetSessionID();
    			string token = WebServiceToken.Create(sessionID, "7d9ac659-a113-4ad1-846f-da64ac42ca7f");
    
    			sccmWebService.SCCMSoapHeaderValue = new SCCMSoapHeader();
    			sccmWebService.SCCMSoapHeaderValue.Token = token;
    
    			//Test:
    			ServiceVersion version = sccmWebService.GetVersion();
  6. The web service can now be used.