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"
- 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):
The "AssemblyName" is freely selectable and will be displayed later in the web service log next to the calling user. - Generation of a random GUID and extension of the "Tokens.xml" file in the "Resources" directory of the web service:
- Include the web service reference in Visual Studio:
- 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.
- 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();
- The web service can now be used.