Class ServiceConnection
Encapsulates a connection to the platform.
Inheritance
Inherited Members
Namespace: DocuWare.Platform.ServerClient
Assembly: DocuWare.Platform.ServerClient.dll
Syntax
public class ServiceConnection
Properties
HttpClient
Gets the HTTP client.
Declaration
public HttpClient HttpClient { get; }
Property Value
| Type | Description |
|---|---|
| System.Net.Http.HttpClient | The HTTP client. |
Organizations
Gets the organizations.
Declaration
public Organization[] Organizations { get; }
Property Value
| Type | Description |
|---|---|
| Organization[] | The organizations. |
OrganizationsAsync
Gets the organizations asynchronously.
Declaration
public Task<Organization[]> OrganizationsAsync { get; }
Property Value
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Organization[]> | The organizations. |
Proxy
Gets the proxy.
Declaration
public HttpClientProxy Proxy { get; }
Property Value
| Type | Description |
|---|---|
| HttpClientProxy | The proxy. |
ServiceDescription
Gets the service description.
Declaration
public ServiceDescription ServiceDescription { get; }
Property Value
| Type | Description |
|---|---|
| ServiceDescription | The service description. |
Methods
Create(Uri, ServiceConnectionTransportData)
Creates a connection for the specified service URI without a log in.
Declaration
public static ServiceConnection Create(Uri serviceUri, ServiceConnectionTransportData serviceConnectionTransportData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| ServiceConnectionTransportData | serviceConnectionTransportData | The service connection transport data. |
Returns
| Type | Description |
|---|---|
| ServiceConnection | A task which is creating a proxy which handles further requests. |
Create(Uri, HttpMessageHandler, ProductInfoHeaderValue[])
Creates a connection for the specified service URI without a log in.
Declaration
public static ServiceConnection Create(Uri serviceUri, HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.Net.Http.HttpMessageHandler | httpClientHandler | The HTTP message handler. |
| System.Net.Http.Headers.ProductInfoHeaderValue[] | userAgent | The parts of the user agent header. You should specify these values in order to identify you application.
If this parameter is set to |
Returns
| Type | Description |
|---|---|
| ServiceConnection | A proxy which handles further requests. |
Create(Uri, String, ServiceConnectionTokenLoginData)
Creates a connection for the specified service URI.
Declaration
public static ServiceConnection Create(Uri serviceUri, string token, ServiceConnectionTokenLoginData serviceConnectionTokenLoginData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | token | The login token. |
| ServiceConnectionTokenLoginData | serviceConnectionTokenLoginData | The service connection token login data. |
Returns
| Type | Description |
|---|---|
| ServiceConnection | A task which is creating a proxy which handles further requests. |
Create(Uri, String, Nullable<DWProductTypes>, HttpMessageHandler, ProductInfoHeaderValue[])
Creates a connection for the specified service URI.
Declaration
public static ServiceConnection Create(Uri serviceUri, string token, DWProductTypes? licenseType = default(DWProductTypes? ), HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | token | The login token. |
| System.Nullable<DocuWare.Platform.ServerClient.DWProductTypes> | licenseType | Type of the license. |
| System.Net.Http.HttpMessageHandler | httpClientHandler | The HTTP message handler. |
| System.Net.Http.Headers.ProductInfoHeaderValue[] | userAgent | The parts of the user agent header. You should specify these values in order to identify you application.
If this parameter is set to |
Returns
| Type | Description |
|---|---|
| ServiceConnection | A proxy which handles further requests. |
Create(Uri, String, String, ServiceConnectionLoginData)
Creates a connection for the specified service URI.
Declaration
public static ServiceConnection Create(Uri serviceUri, string userName, string password, ServiceConnectionLoginData serviceConnectionData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | userName | Name of the user. |
| System.String | password | The password. |
| ServiceConnectionLoginData | serviceConnectionData | The service connection data. |
Returns
| Type | Description |
|---|---|
| ServiceConnection | A task which is creating a proxy which handles further requests. |
Create(Uri, String, String, String, Nullable<DWProductTypes>, HttpMessageHandler, ProductInfoHeaderValue[])
Creates a connection for the specified service URI.
Declaration
public static ServiceConnection Create(Uri serviceUri, string userName, string password, string organization = null, DWProductTypes? licenseType = default(DWProductTypes? ), HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | userName | Name of the user. |
| System.String | password | The password. |
| System.String | organization | The organization to connect. You do no need to specify this parameter in case there is only a single organization in the system you want to connect to. |
| System.Nullable<DocuWare.Platform.ServerClient.DWProductTypes> | licenseType | Type of the license. |
| System.Net.Http.HttpMessageHandler | httpClientHandler | The HTTP message handler. |
| System.Net.Http.Headers.ProductInfoHeaderValue[] | userAgent | The parts of the user agent header. You should specify these values in order to identify you application.
If this parameter is set to |
Returns
| Type | Description |
|---|---|
| ServiceConnection | A proxy which handles further requests. |
CreateAsync(Uri, ServiceConnectionTransportData)
Creates a connection for the specified service URI without a log in. The connection is created asynchronously.
Declaration
public static Task<ServiceConnection> CreateAsync(Uri serviceUri, ServiceConnectionTransportData serviceConnectionTransportData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| ServiceConnectionTransportData | serviceConnectionTransportData | The service connection transport data. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateAsync(Uri, HttpMessageHandler, ProductInfoHeaderValue[])
Creates a connection for the specified service URI without a log in. The connection is created asynchronously.
Declaration
public static Task<ServiceConnection> CreateAsync(Uri serviceUri, HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.Net.Http.HttpMessageHandler | httpClientHandler | The HTTP message handler. |
| System.Net.Http.Headers.ProductInfoHeaderValue[] | userAgent | The parts of the user agent header. You should specify these values in order to identify you application.
If this parameter is set to |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateAsync(Uri, String, ServiceConnectionTokenLoginData)
Creates a connection for the specified service URI asynchronously.
Declaration
public static Task<ServiceConnection> CreateAsync(Uri serviceUri, string token, ServiceConnectionTokenLoginData serviceConnectionTokenLoginData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | token | The login token. |
| ServiceConnectionTokenLoginData | serviceConnectionTokenLoginData | The service connection token login data. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateAsync(Uri, String, Nullable<DWProductTypes>, HttpMessageHandler, ProductInfoHeaderValue[])
Creates a connection for the specified service URI asynchronously.
Declaration
public static Task<ServiceConnection> CreateAsync(Uri serviceUri, string token, DWProductTypes? licenseType = default(DWProductTypes? ), HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | token | The login token. |
| System.Nullable<DocuWare.Platform.ServerClient.DWProductTypes> | licenseType | Type of the license. |
| System.Net.Http.HttpMessageHandler | httpClientHandler | The HTTP message handler. |
| System.Net.Http.Headers.ProductInfoHeaderValue[] | userAgent | The parts of the user agent header. You should specify these values in order to identify you application.
If this parameter is set to |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateAsync(Uri, String, String, ServiceConnectionLoginData)
Creates a connection for the specified service URI asynchronously.
Declaration
public static Task<ServiceConnection> CreateAsync(Uri serviceUri, string userName, string password, ServiceConnectionLoginData serviceConnectionData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | userName | Name of the user. |
| System.String | password | The password. |
| ServiceConnectionLoginData | serviceConnectionData | The service connection data. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateAsync(Uri, String, String, String, Nullable<DWProductTypes>, HttpMessageHandler, ProductInfoHeaderValue[])
Creates a connection for the specified service URI asynchronously.
Declaration
public static Task<ServiceConnection> CreateAsync(Uri serviceUri, string userName, string password, string organization = null, DWProductTypes? licenseType = default(DWProductTypes? ), HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | userName | Name of the user. |
| System.String | password | The password. |
| System.String | organization | The organization to connect. You do no need to specify this parameter in case there is only a single organization in the system you want to connect to. |
| System.Nullable<DocuWare.Platform.ServerClient.DWProductTypes> | licenseType | Type of the license. |
| System.Net.Http.HttpMessageHandler | httpClientHandler | The HTTP message handler. |
| System.Net.Http.Headers.ProductInfoHeaderValue[] | userAgent | The parts of the user agent header. You should specify these values in order to identify you application.
If this parameter is set to |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateTrusted(Uri, String, String, String, ServiceConnectionLoginData)
Creates a connection for the specified service URI.
Declaration
public static ServiceConnection CreateTrusted(Uri serviceUri, string impersonatedUser, string trustedUser, string password, ServiceConnectionLoginData serviceConnectionData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | impersonatedUser | Name of the DW user. |
| System.String | trustedUser | Name of a trusted user. |
| System.String | password | The password. |
| ServiceConnectionLoginData | serviceConnectionData | The service connection data. |
Returns
| Type | Description |
|---|---|
| ServiceConnection | A task which is creating a proxy which handles further requests. |
CreateTrusted(Uri, String, String, String, String, Nullable<DWProductTypes>, HttpMessageHandler, ProductInfoHeaderValue[])
Creates a connection for the specified service URI.
Declaration
public static ServiceConnection CreateTrusted(Uri serviceUri, string impersonatedUser, string trustedUser, string password, string organization = null, DWProductTypes? licenseType = default(DWProductTypes? ), HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | impersonatedUser | Name of the impersonated(DW) user. |
| System.String | trustedUser | Name of a trusted user. |
| System.String | password | The password. |
| System.String | organization | The organization to connect. You do no need to specify this parameter in case there is only a single organization in the system you want to connect to. |
| System.Nullable<DocuWare.Platform.ServerClient.DWProductTypes> | licenseType | Type of the license. |
| System.Net.Http.HttpMessageHandler | httpClientHandler | The HTTP message handler. |
| System.Net.Http.Headers.ProductInfoHeaderValue[] | userAgent | The parts of the user agent header. You should specify these values in order to identify you application.
If this parameter is set to |
Returns
| Type | Description |
|---|---|
| ServiceConnection | A proxy which handles further requests. |
CreateTrustedAsync(Uri, String, String, String, ServiceConnectionLoginData)
Creates a connection for the specified service URI asynchronously.
Declaration
public static Task<ServiceConnection> CreateTrustedAsync(Uri serviceUri, string impersonatedUser, string trustedUser, string password, ServiceConnectionLoginData serviceConnectionData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | impersonatedUser | Name of the DW user. |
| System.String | trustedUser | Name of a trusted user. |
| System.String | password | The password. |
| ServiceConnectionLoginData | serviceConnectionData | The service connection data. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateTrustedAsync(Uri, String, String, String, String, Nullable<DWProductTypes>, HttpMessageHandler, ProductInfoHeaderValue[])
Creates a connection for the specified service URI asynchronously.
Declaration
public static Task<ServiceConnection> CreateTrustedAsync(Uri serviceUri, string impersonatedUser, string trustedUser, string password, string organization = null, DWProductTypes? licenseType = default(DWProductTypes? ), HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | impersonatedUser | Name of the DW user. |
| System.String | trustedUser | Name of a trusted user. |
| System.String | password | The password. |
| System.String | organization | The organization to connect. You do no need to specify this parameter in case there is only a single organization in the system you want to connect to. |
| System.Nullable<DocuWare.Platform.ServerClient.DWProductTypes> | licenseType | Type of the license. |
| System.Net.Http.HttpMessageHandler | httpClientHandler | The HTTP message handler. |
| System.Net.Http.Headers.ProductInfoHeaderValue[] | userAgent | The parts of the user agent header. You should specify these values in order to identify you application.
If this parameter is set to |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateWithJwtAsync(Uri, String, ServiceConnectionTokenLoginData)
Creates a connection for the specified service URI asynchronously.
Declaration
public static Task<ServiceConnection> CreateWithJwtAsync(Uri serviceUri, string accessToken, ServiceConnectionTokenLoginData serviceConnectionTokenLoginData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | accessToken | The access jwt. |
| ServiceConnectionTokenLoginData | serviceConnectionTokenLoginData | The service connection token login data. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateWithJwtAsync(Uri, String, ServiceConnectionTokenLoginData, Func<Task<String>>)
Creates a connection for the specified service URI asynchronously.
Declaration
public static Task<ServiceConnection> CreateWithJwtAsync(Uri serviceUri, string accessToken, ServiceConnectionTokenLoginData serviceConnectionTokenLoginData, Func<Task<string>> refreshTokenCallback)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | accessToken | The access jwt. |
| ServiceConnectionTokenLoginData | serviceConnectionTokenLoginData | The service connection token login data. |
| System.Func<System.Threading.Tasks.Task<System.String>> | refreshTokenCallback | Delegate for refreshing the token. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateWithJwtAsync(Uri, String, Func<Task<String>>, Nullable<DWProductTypes>, HttpMessageHandler, ProductInfoHeaderValue[])
Creates a connection for the specified service URI asynchronously.
Declaration
public static Task<ServiceConnection> CreateWithJwtAsync(Uri serviceUri, string accessToken, Func<Task<string>> refreshTokenCallback, DWProductTypes? licenseType = default(DWProductTypes? ), HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | accessToken | The access jwt. |
| System.Func<System.Threading.Tasks.Task<System.String>> | refreshTokenCallback | Delegate for refreshing the token. |
| System.Nullable<DocuWare.Platform.ServerClient.DWProductTypes> | licenseType | Type of the license. |
| System.Net.Http.HttpMessageHandler | httpClientHandler | The HTTP message handler. |
| System.Net.Http.Headers.ProductInfoHeaderValue[] | userAgent | The parts of the user agent header. You should specify these values in order to identify you application.
If this parameter is set to |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateWithJwtAsync(Uri, String, Nullable<DWProductTypes>, HttpMessageHandler, ProductInfoHeaderValue[])
Creates a connection for the specified service URI asynchronously.
Declaration
public static Task<ServiceConnection> CreateWithJwtAsync(Uri serviceUri, string accessToken, DWProductTypes? licenseType = default(DWProductTypes? ), HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | accessToken | The access jwt. |
| System.Nullable<DocuWare.Platform.ServerClient.DWProductTypes> | licenseType | Type of the license. |
| System.Net.Http.HttpMessageHandler | httpClientHandler | The HTTP message handler. |
| System.Net.Http.Headers.ProductInfoHeaderValue[] | userAgent | The parts of the user agent header. You should specify these values in order to identify you application.
If this parameter is set to |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateWithWindowsAuthentication(Uri, ICredentials, ServiceConnectionLoginData)
Creates a connection for the specified service URI using NTLM authentication.
Declaration
public static ServiceConnection CreateWithWindowsAuthentication(Uri serviceUri, ICredentials credentials, ServiceConnectionLoginData serviceConnectionLoginData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.Net.ICredentials | credentials | The credentials. This should be some credentials which can be used in the NTLM authentication protocol. |
| ServiceConnectionLoginData | serviceConnectionLoginData | The service connection login data. |
Returns
| Type | Description |
|---|---|
| ServiceConnection | A task which is creating a proxy which handles further requests. |
CreateWithWindowsAuthentication(Uri, ICredentials, String, Nullable<DWProductTypes>, HttpClientHandler, ProductInfoHeaderValue[])
Creates a connection for the specified service URI using windows authentication.
Declaration
public static ServiceConnection CreateWithWindowsAuthentication(Uri serviceUri, ICredentials credentials, string organization = null, DWProductTypes? licenseType = default(DWProductTypes? ), HttpClientHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.Net.ICredentials | credentials | The credentials. |
| System.String | organization | The organization to connect. You do no need to specify this parameter in case there is only a single organization in the system you want to connect to. |
| System.Nullable<DocuWare.Platform.ServerClient.DWProductTypes> | licenseType | Type of the license to lock. |
| System.Net.Http.HttpClientHandler | httpClientHandler | The HTTP client handler. |
| System.Net.Http.Headers.ProductInfoHeaderValue[] | userAgent | The parts of the user agent header. You should specify these values in order to identify you application.
If this parameter is set to |
Returns
| Type | Description |
|---|---|
| ServiceConnection | A proxy which handles further requests. |
CreateWithWindowsAuthentication(Uri, String, String, ServiceConnectionLoginData)
Creates a connection for the specified service URI using NTLM authentication.
Declaration
public static ServiceConnection CreateWithWindowsAuthentication(Uri serviceUri, string userName, string password, ServiceConnectionLoginData serviceConnectionLoginData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | userName | Name of the user. |
| System.String | password | The password. |
| ServiceConnectionLoginData | serviceConnectionLoginData | The service connection login data. |
Returns
| Type | Description |
|---|---|
| ServiceConnection | A task which is creating a proxy which handles further requests. |
CreateWithWindowsAuthentication(Uri, String, String, String, ServiceConnectionLoginData)
Creates a connection for the specified service URI using NTLM authentication.
Declaration
public static ServiceConnection CreateWithWindowsAuthentication(Uri serviceUri, string userName, string password, string domain, ServiceConnectionLoginData serviceConnectionLoginData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | userName | Name of the user. |
| System.String | password | The password. |
| System.String | domain | The domain. |
| ServiceConnectionLoginData | serviceConnectionLoginData | The service connection login data. |
Returns
| Type | Description |
|---|---|
| ServiceConnection | A task which is creating a proxy which handles further requests. |
CreateWithWindowsAuthentication(Uri, String, String, String, String, Nullable<DWProductTypes>, HttpClientHandler, ProductInfoHeaderValue[])
Creates a connection for the specified service URI using windows authentication.
Declaration
public static ServiceConnection CreateWithWindowsAuthentication(Uri serviceUri, string userName, string password, string domain = null, string organization = null, DWProductTypes? licenseType = default(DWProductTypes? ), HttpClientHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | userName | Name of the user. |
| System.String | password | The password. |
| System.String | domain | The domain. |
| System.String | organization | The organization to connect. You do no need to specify this parameter in case there is only a single organization in the system you want to connect to. |
| System.Nullable<DocuWare.Platform.ServerClient.DWProductTypes> | licenseType | Type of the license to lock. |
| System.Net.Http.HttpClientHandler | httpClientHandler | The HTTP client handler. |
| System.Net.Http.Headers.ProductInfoHeaderValue[] | userAgent | The parts of the user agent header. You should specify these values in order to identify you application.
If this parameter is set to |
Returns
| Type | Description |
|---|---|
| ServiceConnection | A proxy which handles further requests. |
CreateWithWindowsAuthenticationAsync(Uri, ICredentials, ServiceConnectionLoginData)
Creates a connection for the specified service URI using NTLM authentication.
Declaration
public static Task<ServiceConnection> CreateWithWindowsAuthenticationAsync(Uri serviceUri, ICredentials credentials, ServiceConnectionLoginData serviceConnectionLoginData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.Net.ICredentials | credentials | The credentials. This should be some credentials which can be used in the NTLM authentication protocol. |
| ServiceConnectionLoginData | serviceConnectionLoginData | The service connection login data. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateWithWindowsAuthenticationAsync(Uri, ICredentials, String, Nullable<DWProductTypes>, HttpClientHandler, ProductInfoHeaderValue[])
Creates a connection for the specified service URI using NTLM authentication.
Declaration
public static Task<ServiceConnection> CreateWithWindowsAuthenticationAsync(Uri serviceUri, ICredentials credentials, string organization = null, DWProductTypes? licenseType = default(DWProductTypes? ), HttpClientHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.Net.ICredentials | credentials | The credentials. This should be some credentials which can be used in the NTLM authentication protocol. |
| System.String | organization | The organization to connect. You do no need to specify this parameter in case there is only a single organization in the system you want to connect to. |
| System.Nullable<DocuWare.Platform.ServerClient.DWProductTypes> | licenseType | Type of the license to lock. |
| System.Net.Http.HttpClientHandler | httpClientHandler | The HTTP client handler. |
| System.Net.Http.Headers.ProductInfoHeaderValue[] | userAgent | The parts of the user agent header. You should specify these values in order to identify you application.
If this parameter is set to |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateWithWindowsAuthenticationAsync(Uri, String, String, ServiceConnectionLoginData)
Creates a connection for the specified service URI using NTLM authentication.
Declaration
public static Task<ServiceConnection> CreateWithWindowsAuthenticationAsync(Uri serviceUri, string userName, string password, ServiceConnectionLoginData serviceConnectionLoginData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | userName | Name of the user. |
| System.String | password | The password. |
| ServiceConnectionLoginData | serviceConnectionLoginData | The service connection login data. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateWithWindowsAuthenticationAsync(Uri, String, String, String, ServiceConnectionLoginData)
Creates a connection for the specified service URI using NTLM authentication.
Declaration
public static Task<ServiceConnection> CreateWithWindowsAuthenticationAsync(Uri serviceUri, string userName, string password, string domain, ServiceConnectionLoginData serviceConnectionLoginData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | userName | Name of the user. |
| System.String | password | The password. |
| System.String | domain | The domain. |
| ServiceConnectionLoginData | serviceConnectionLoginData | The service connection login data. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
CreateWithWindowsAuthenticationAsync(Uri, String, String, String, String, Nullable<DWProductTypes>, HttpClientHandler, ProductInfoHeaderValue[])
Creates a connection for the specified service URI using NTLM authentication.
Declaration
public static Task<ServiceConnection> CreateWithWindowsAuthenticationAsync(Uri serviceUri, string userName, string password, string domain = null, string organization = null, DWProductTypes? licenseType = default(DWProductTypes? ), HttpClientHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| System.String | userName | Name of the user. |
| System.String | password | The password. |
| System.String | domain | The domain. |
| System.String | organization | The organization to connect. You do no need to specify this parameter in case there is only a single organization in the system you want to connect to. |
| System.Nullable<DocuWare.Platform.ServerClient.DWProductTypes> | licenseType | Type of the license to lock. |
| System.Net.Http.HttpClientHandler | httpClientHandler | The HTTP client handler. |
| System.Net.Http.Headers.ProductInfoHeaderValue[] | userAgent | The parts of the user agent header. You should specify these values in order to identify you application.
If this parameter is set to |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ServiceConnection> | A task which is creating a proxy which handles further requests. |
Disconnect()
Disconnects this instance.
Declaration
public void Disconnect()
DisconnectAsync()
Disconnects this instance.
Declaration
public async Task DisconnectAsync()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task which disconnects the client. |
DisconnectAsync(CancellationToken)
Disconnects this instance.
Declaration
public async Task DisconnectAsync(CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Threading.CancellationToken | token | Cancellation token. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task | A task which disconnects the client. |
GetIdentityServiceInfoAsync(Uri, IdentityServiceInfoConnectionData)
Gets the identity service address.
Declaration
public static async Task<IdentityServiceInfo> GetIdentityServiceInfoAsync(Uri serviceUri, IdentityServiceInfoConnectionData serviceConnectionData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | serviceUri | The service URI. |
| IdentityServiceInfoConnectionData | serviceConnectionData | The service connection data. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IdentityServiceInfo> |
GetOrganizationsAsync()
Gets the organizations asynchronous.
Declaration
public Task<Organization[]> GetOrganizationsAsync()
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Organization[]> | The list of available organizations. |
GetXml<T>(String)
Gets the XML from the specified uri.
Declaration
public T GetXml<T>(string uri)
where T : class
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | uri | The URI. |
Returns
| Type | Description |
|---|---|
| T | The parsed data. |
Type Parameters
| Name | Description |
|---|---|
| T |
GetXmlAsync<T>(String)
Gets the XML from the specified uri asynchronously.
Declaration
public Task<DeserializedHttpResponse<T>> GetXmlAsync<T>(string uri)
where T : class
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | uri | The URI. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<DeserializedHttpResponse<T>> | The parsed data. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the response. |
ReplaceHttpClient(ServiceConnection)
Replaces the HTTP client.
Declaration
public void ReplaceHttpClient(ServiceConnection otherServiceConnection)
Parameters
| Type | Name | Description |
|---|---|---|
| ServiceConnection | otherServiceConnection | The ServiceConnection instance whose HttpClient instance is used for further communucation. |
Remarks
After the function returns, all requests from all objects created by this ServiceConnection instance
are sent through the new HttpClient instance. Then both otherServiceConnection and this ServiceConnection instance
share the same HttpClient instance.
ReplaceHttpClient(HttpClient)
Replaces the HTTP client.
Declaration
public void ReplaceHttpClient(HttpClient httpClient)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Net.Http.HttpClient | httpClient | The HTTP client. |
SetHostId(String)
Sets the identifier of the machine the .NET API client is running.
Declaration
public static void SetHostId(string hostId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | hostId | The host identifier. |
Remarks
The host identifier is used by the license management to faster reuse licenses for users working on the same machine. In a .NET or Mono environment the host identifier is automatically set. If you are in a different environment, you should explicitely set the host identifier by calling this function during the initialization phase of your application.