Class ClientSyncWebService
Windows Update Server implementation. Provides updates to Windows PCs
Inheritance
Namespace: Microsoft.UpdateServices.ClientSync.Server
Assembly: client-server-sync-lib.dll
Syntax
public class ClientSyncWebService : IClientSyncWebService
Examples
Attach this service to your ASP.NET service using SoapCore:
public void ConfigureServices(IServiceCollection services)
{
// Enable SoapCore; this middleware provides translation services from WCF/SOAP to Asp.net
services.AddSoapCore();
//
// Initialization data
var localMetadataSource = CompressedMetadataStore.Open(sourcePath);
var updateServiceConfiguration = Newtonsoft.Json.JsonConvert.DeserializeObject<Config>(
File.OpenText(serviceConfigPath).ReadToEnd());
//
// Attach the service using the initialization parameters
services.TryAddSingleton<ClientSyncWebService>(
new Server.ClientSyncWebService(
localMetadataSource,
updateServiceConfiguration,
// address of this server; becomes the root for update content URLs
// Windows clients connect to content URLs to download update content
// If this server is not serving content, this parameter can be null
serverAddress));
...
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
app.UseSoapEndpoint<ClientSyncWebService<(
"/ClientWebService/client.asmx",
new BasicHttpBinding(),
SoapSerializer.XmlSerializer);
}
Constructors
ClientSyncWebService(Config, String)
Instantiates a Windows Update server instance.
Declaration
public ClientSyncWebService(Config updateServiceConfiguration, string contentRoot)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.WebServices.ClientSync.Config | updateServiceConfiguration | Update service configuration. Sent to clients when requested with GetConfig and GetConfig2 |
| System.String | contentRoot | The content root to use when setting the download URL in updates metadata |
Properties
MetadataSource
The local repository from where updates are served.
Declaration
public IMetadataSource MetadataSource { get; }
Property Value
| Type | Description |
|---|---|
| Microsoft.UpdateServices.Storage.IMetadataSource |
Methods
AddApprovedDriverUpdate(Identity)
Adds an update identities to the list of approved driver updates. Approved updates are made available to clients connecting to this service.
Declaration
public void AddApprovedDriverUpdate(Identity approvedUpdate)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.Metadata.Identity | approvedUpdate | Approved driver update |
AddApprovedDriverUpdates(IEnumerable<Identity>)
Adds a list of update identities to the list of approved driver updates. Approved updates are made available to clients connecting to this service.
Declaration
public void AddApprovedDriverUpdates(IEnumerable<Identity> approvedUpdates)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<Microsoft.UpdateServices.Metadata.Identity> | approvedUpdates |
AddApprovedSoftwareUpdate(Identity)
Adds an update identity to the list of approved software updates. Approved updates are made available to clients connecting to this service.
Declaration
public void AddApprovedSoftwareUpdate(Identity approvedUpdate)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.Metadata.Identity | approvedUpdate | Approved update |
AddApprovedSoftwareUpdates(IEnumerable<Identity>)
Adds a list of update identities to the list of approved software updates. Approved updates are made available to clients connecting to this service.
Declaration
public void AddApprovedSoftwareUpdates(IEnumerable<Identity> approvedUpdates)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<Microsoft.UpdateServices.Metadata.Identity> | approvedUpdates | List of approved updates |
ClearApprovedDriverUpdates()
Clears the list of approved driver updates. Un-approved updates are not made available to connecting clients.
Declaration
public void ClearApprovedDriverUpdates()
ClearApprovedSoftwareUpdates()
Clears the list of approved software updates. Un-approved updates are not made available to connecting clients.
Declaration
public void ClearApprovedSoftwareUpdates()
GetConfig2Async(ClientConfiguration)
Handle get configuration requests from clients
Declaration
public Task<Config> GetConfig2Async(ClientConfiguration clientConfiguration)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.WebServices.ClientSync.ClientConfiguration | clientConfiguration | The client configuration as received from a Windows client |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.UpdateServices.WebServices.ClientSync.Config> | The server configuration to be sent to a Windows client |
GetConfigAsync(String)
Handle get configuration requests from clients
Declaration
public Task<Config> GetConfigAsync(string protocolVersion)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | protocolVersion | The version of the Windows client connecting to this server |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.UpdateServices.WebServices.ClientSync.Config> | The server configuration to be sent to a Windows client |
GetCookieAsync(AuthorizationCookie[], Cookie, DateTime, DateTime, String)
Handle get cookie requests. All requests are all granted access and a cookie is issued.
Declaration
public Task<Cookie> GetCookieAsync(AuthorizationCookie[] authCookies, Cookie oldCookie, DateTime lastChange, DateTime currentTime, string protocolVersion)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.WebServices.ClientSync.AuthorizationCookie[] | authCookies | Authorization cookies received from the client |
| Microsoft.UpdateServices.WebServices.ClientSync.Cookie | oldCookie | Old cookie from client |
| System.DateTime | lastChange | |
| System.DateTime | currentTime | |
| System.String | protocolVersion | Client supported protocol version |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.UpdateServices.WebServices.ClientSync.Cookie> | A new cookie |
GetExtendedUpdateInfo2Async(Cookie, UpdateIdentity[], XmlUpdateFragmentType[], String[], String)
Not implemented.
Declaration
public Task<ExtendedUpdateInfo2> GetExtendedUpdateInfo2Async(Cookie cookie, UpdateIdentity[] updateIDs, XmlUpdateFragmentType[] infoTypes, string[] locales, string deviceAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.WebServices.ClientSync.Cookie | cookie | Not implemented |
| Microsoft.UpdateServices.WebServices.ClientSync.UpdateIdentity[] | updateIDs | Not implemented |
| Microsoft.UpdateServices.WebServices.ClientSync.XmlUpdateFragmentType[] | infoTypes | Not implemented |
| System.String[] | locales | Not implemented |
| System.String | deviceAttributes | Not implemented |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.UpdateServices.WebServices.ClientSync.ExtendedUpdateInfo2> | Not implemented |
GetExtendedUpdateInfoAsync(Cookie, Int32[], XmlUpdateFragmentType[], String[], String)
Handle requests for extended update information. The extended information is extracted from update metadata. Extended information also includes file URLs
Declaration
public Task<ExtendedUpdateInfo> GetExtendedUpdateInfoAsync(Cookie cookie, int[] revisionIDs, XmlUpdateFragmentType[] infoTypes, string[] locales, string deviceAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.WebServices.ClientSync.Cookie | cookie | Access cookie |
| System.Int32[] | revisionIDs | Revision Ids for which to get extended information |
| Microsoft.UpdateServices.WebServices.ClientSync.XmlUpdateFragmentType[] | infoTypes | The type of extended information requested |
| System.String[] | locales | The language to use when getting language dependent extended information |
| System.String | deviceAttributes | Device attributes; unused |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.UpdateServices.WebServices.ClientSync.ExtendedUpdateInfo> | Extended update information response. |
GetFileLocationsAsync(Cookie, Byte[][])
Not implemented
Declaration
public Task<GetFileLocationsResults> GetFileLocationsAsync(Cookie cookie, byte[][] fileDigests)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.WebServices.ClientSync.Cookie | cookie | |
| System.Byte[][] | fileDigests |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.UpdateServices.WebServices.ClientSync.GetFileLocationsResults> | Not implemented |
GetTimestampsAsync(GetTimestampsRequest)
Not implemented
Declaration
public Task<GetTimestampsResponse> GetTimestampsAsync(GetTimestampsRequest request)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.WebServices.ClientSync.GetTimestampsRequest | request |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.UpdateServices.WebServices.ClientSync.GetTimestampsResponse> | Not implemented |
RefreshCacheAsync(Cookie, UpdateIdentity[], String)
Not implemented
Declaration
public Task<RefreshCacheResult[]> RefreshCacheAsync(Cookie cookie, UpdateIdentity[] globalIDs, string deviceAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.WebServices.ClientSync.Cookie | cookie | |
| Microsoft.UpdateServices.WebServices.ClientSync.UpdateIdentity[] | globalIDs | |
| System.String | deviceAttributes |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.UpdateServices.WebServices.ClientSync.RefreshCacheResult[]> | Not implemented |
RegisterComputerAsync(Cookie, ComputerInfo)
Not implemented
Declaration
public Task RegisterComputerAsync(Cookie cookie, ComputerInfo computerInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.WebServices.ClientSync.Cookie | cookie | |
| Microsoft.UpdateServices.WebServices.ClientSync.ComputerInfo | computerInfo |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | Not implemented |
RemoveApprovedDriverUpdate(Identity)
Removes an approved software update from the list of approved software updates. The software update will not be given to connecting clients anymore.
Declaration
public void RemoveApprovedDriverUpdate(Identity updateIdentity)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.Metadata.Identity | updateIdentity | Identity of update to un-approve |
RemoveApprovedSoftwareUpdate(Identity)
Removes an approved software update from the list of approved software updates. The software update will not be given to connecting clients anymore.
Declaration
public void RemoveApprovedSoftwareUpdate(Identity updateIdentity)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.Metadata.Identity | updateIdentity | Identity of update to un-approve |
SetMetadataSource(IMetadataSource)
Sets the source of update metadata
Declaration
public void SetMetadataSource(IMetadataSource metadataSource)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.Storage.IMetadataSource | metadataSource | The source for updates metadata |
StartCategoryScanAsync(StartCategoryScanRequest)
Not implemented
Declaration
public Task<StartCategoryScanResponse> StartCategoryScanAsync(StartCategoryScanRequest request)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.WebServices.ClientSync.StartCategoryScanRequest | request |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.UpdateServices.WebServices.ClientSync.StartCategoryScanResponse> | Not implemented |
SyncPrinterCatalogAsync(Cookie, Int32[], Int32[], String)
Not implemented
Declaration
public Task<SyncInfo> SyncPrinterCatalogAsync(Cookie cookie, int[] installedNonLeafUpdateIDs, int[] printerUpdateIDs, string deviceAttributes)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.WebServices.ClientSync.Cookie | cookie | |
| System.Int32[] | installedNonLeafUpdateIDs | |
| System.Int32[] | printerUpdateIDs | |
| System.String | deviceAttributes |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.UpdateServices.WebServices.ClientSync.SyncInfo> | Not implemented |
SyncUpdatesAsync(Cookie, SyncUpdateParameters)
Handle requests to sync updates. A client presents the list of installed updates and detectoids and the server replies with a list of more applicable updates, if any.
Declaration
public Task<SyncInfo> SyncUpdatesAsync(Cookie cookie, SyncUpdateParameters parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.UpdateServices.WebServices.ClientSync.Cookie | cookie | Access cookie |
| Microsoft.UpdateServices.WebServices.ClientSync.SyncUpdateParameters | parameters | Request parameters: list of installed updates, list of known updates, etc. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Microsoft.UpdateServices.WebServices.ClientSync.SyncInfo> | SyncInfo containing updates applicable to the caller. |
Events
OnUnApprovedDriverUpdatesRequested
Event raised when driver updates are applicable to a client but are not approved for distribution
Declaration
public event ClientSyncWebService.UnApprovedUpdatesRequestedDelegate OnUnApprovedDriverUpdatesRequested
Event Type
| Type | Description |
|---|---|
| ClientSyncWebService.UnApprovedUpdatesRequestedDelegate |
OnUnApprovedSoftwareUpdatesRequested
Event raised when software updates are applicable to a client but are not approved for distribution
Declaration
public event ClientSyncWebService.UnApprovedUpdatesRequestedDelegate OnUnApprovedSoftwareUpdatesRequested
Event Type
| Type | Description |
|---|---|
| ClientSyncWebService.UnApprovedUpdatesRequestedDelegate |