Skip to main content

Web Service API

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

Further information on using the interface can be found in the API reference at https://www.smcteam.de/help/sccmmanager/3/api-reference/.

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

Integration with Visual Studio

This video demonstrates the steps described here:

Video missing: “Web Service API Integration”

  1. Configuration in the web service’s “web.config” file (alternatively, via the “SCCM Manager Web Config” application on the server; open it from the Start menu):

    soap_header_setting_thumb_480_0.png
    The “AssemblyName” can be chosen freely and will later be displayed in the web service log next to the calling user.

  2. Generate a random GUID and append it to the “Tokens.xml” file in the “Resources” directory of the web service:

    soap_header_token_thumb_480_0.png
  3. Add 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. Add the “SCCMWebService.Token.dll” file in Visual Studio:

    Copy the SCCMWebService.Token.dll from Server installation path\API to your project directory, then reference it.
    soap-header-webservice-addreference-thumb-480-0.pngoverview-target.png


  5. Instantiate the web service with the SOAP header; the passed GUID corresponds to the one previously defined in 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 is now ready for use.