Table of Contents

Class ServiceConnection

Namespace
DocuWare.Platform.ServerClient
Assembly
DocuWare.Platform.ServerClient.dll

Encapsulates a connection to the platform.

public class ServiceConnection
Inheritance
ServiceConnection
Inherited Members
Extension Methods

Properties

HttpClient

Gets the HTTP client.

public HttpClient HttpClient { get; }

Property Value

TypeDescription
HttpClient

The HTTP client.

Organizations

Gets the organizations.

public Organization[] Organizations { get; }

Property Value

TypeDescription
Organization[]

The organizations.

OrganizationsAsync

Gets the organizations asynchronously.

public Task<Organization[]> OrganizationsAsync { get; }

Property Value

TypeDescription
Task<Organization[]>

The organizations.

Proxy

Gets the proxy.

public HttpClientProxy Proxy { get; }

Property Value

TypeDescription
HttpClientProxy

The proxy.

ServiceDescription

Gets the service description.

public ServiceDescription ServiceDescription { get; }

Property Value

TypeDescription
ServiceDescription

The service description.

Methods

Create(Uri, ServiceConnectionTransportData)

Creates a connection for the specified service URI without a log in.

public static ServiceConnection Create(Uri serviceUri, ServiceConnectionTransportData serviceConnectionTransportData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

ServiceConnectionTransportDataserviceConnectionTransportData

The service connection transport data.

Returns

TypeDescription
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.

public static ServiceConnection Create(Uri serviceUri, HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

HttpMessageHandlerhttpClientHandler

The HTTP message handler.

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 null then the process name and version of you application is used as user agent string. If you do not want to submit any user agent, you must set this parameter to an empty array.

Returns

TypeDescription
ServiceConnection

A proxy which handles further requests.

Create(Uri, string, ServiceConnectionTokenLoginData)

Creates a connection for the specified service URI.

public static ServiceConnection Create(Uri serviceUri, string token, ServiceConnectionTokenLoginData serviceConnectionTokenLoginData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringtoken

The login token.

ServiceConnectionTokenLoginDataserviceConnectionTokenLoginData

The service connection token login data.

Returns

TypeDescription
ServiceConnection

A task which is creating a proxy which handles further requests.

Create(Uri, string, DWProductTypes?, HttpMessageHandler, ProductInfoHeaderValue[])

Creates a connection for the specified service URI.

public static ServiceConnection Create(Uri serviceUri, string token, DWProductTypes? licenseType = null, HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringtoken

The login token.

DWProductTypes?licenseType

Type of the license.

HttpMessageHandlerhttpClientHandler

The HTTP message handler.

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 null then the process name and version of you application is used as user agent string. If you do not want to submit any user agent, you must set this parameter to an empty array.

Returns

TypeDescription
ServiceConnection

A proxy which handles further requests.

Create(Uri, string, string, ServiceConnectionLoginData)

Creates a connection for the specified service URI.

public static ServiceConnection Create(Uri serviceUri, string userName, string password, ServiceConnectionLoginData serviceConnectionData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringuserName

Name of the user.

stringpassword

The password.

ServiceConnectionLoginDataserviceConnectionData

The service connection data.

Returns

TypeDescription
ServiceConnection

A task which is creating a proxy which handles further requests.

Create(Uri, string, string, string, DWProductTypes?, HttpMessageHandler, ProductInfoHeaderValue[])

Creates a connection for the specified service URI.

public static ServiceConnection Create(Uri serviceUri, string userName, string password, string organization = null, DWProductTypes? licenseType = null, HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringuserName

Name of the user.

stringpassword

The password.

stringorganization

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.

DWProductTypes?licenseType

Type of the license.

HttpMessageHandlerhttpClientHandler

The HTTP message handler.

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 null then the process name and version of you application is used as user agent string. If you do not want to submit any user agent, you must set this parameter to an empty array.

Returns

TypeDescription
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.

public static Task<ServiceConnection> CreateAsync(Uri serviceUri, ServiceConnectionTransportData serviceConnectionTransportData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

ServiceConnectionTransportDataserviceConnectionTransportData

The service connection transport data.

Returns

TypeDescription
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.

public static Task<ServiceConnection> CreateAsync(Uri serviceUri, HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

HttpMessageHandlerhttpClientHandler

The HTTP message handler.

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 null then the process name and version of you application is used as user agent string. If you do not want to submit any user agent, you must set this parameter to an empty array.

Returns

TypeDescription
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.

public static Task<ServiceConnection> CreateAsync(Uri serviceUri, string token, ServiceConnectionTokenLoginData serviceConnectionTokenLoginData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringtoken

The login token.

ServiceConnectionTokenLoginDataserviceConnectionTokenLoginData

The service connection token login data.

Returns

TypeDescription
Task<ServiceConnection>

A task which is creating a proxy which handles further requests.

CreateAsync(Uri, string, DWProductTypes?, HttpMessageHandler, ProductInfoHeaderValue[])

Creates a connection for the specified service URI asynchronously.

public static Task<ServiceConnection> CreateAsync(Uri serviceUri, string token, DWProductTypes? licenseType = null, HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringtoken

The login token.

DWProductTypes?licenseType

Type of the license.

HttpMessageHandlerhttpClientHandler

The HTTP message handler.

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 null then the process name and version of you application is used as user agent string. If you do not want to submit any user agent, you must set this parameter to an empty array.

Returns

TypeDescription
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.

public static Task<ServiceConnection> CreateAsync(Uri serviceUri, string userName, string password, ServiceConnectionLoginData serviceConnectionData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringuserName

Name of the user.

stringpassword

The password.

ServiceConnectionLoginDataserviceConnectionData

The service connection data.

Returns

TypeDescription
Task<ServiceConnection>

A task which is creating a proxy which handles further requests.

CreateAsync(Uri, string, string, string, DWProductTypes?, HttpMessageHandler, ProductInfoHeaderValue[])

Creates a connection for the specified service URI asynchronously.

public static Task<ServiceConnection> CreateAsync(Uri serviceUri, string userName, string password, string organization = null, DWProductTypes? licenseType = null, HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringuserName

Name of the user.

stringpassword

The password.

stringorganization

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.

DWProductTypes?licenseType

Type of the license.

HttpMessageHandlerhttpClientHandler

The HTTP message handler.

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 null then the process name and version of you application is used as user agent string. If you do not want to submit any user agent, you must set this parameter to an empty array.

Returns

TypeDescription
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.

public static ServiceConnection CreateTrusted(Uri serviceUri, string impersonatedUser, string trustedUser, string password, ServiceConnectionLoginData serviceConnectionData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringimpersonatedUser

Name of the DW user.

stringtrustedUser

Name of a trusted user.

stringpassword

The password.

ServiceConnectionLoginDataserviceConnectionData

The service connection data.

Returns

TypeDescription
ServiceConnection

A task which is creating a proxy which handles further requests.

CreateTrusted(Uri, string, string, string, string, DWProductTypes?, HttpMessageHandler, ProductInfoHeaderValue[])

Creates a connection for the specified service URI.

public static ServiceConnection CreateTrusted(Uri serviceUri, string impersonatedUser, string trustedUser, string password, string organization = null, DWProductTypes? licenseType = null, HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringimpersonatedUser

Name of the impersonated(DW) user.

stringtrustedUser

Name of a trusted user.

stringpassword

The password.

stringorganization

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.

DWProductTypes?licenseType

Type of the license.

HttpMessageHandlerhttpClientHandler

The HTTP message handler.

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 null then the process name and version of you application is used as user agent string. If you do not want to submit any user agent, you must set this parameter to an empty array.

Returns

TypeDescription
ServiceConnection

A proxy which handles further requests.

CreateTrustedAsync(Uri, string, string, string, ServiceConnectionLoginData)

Creates a connection for the specified service URI asynchronously.

public static Task<ServiceConnection> CreateTrustedAsync(Uri serviceUri, string impersonatedUser, string trustedUser, string password, ServiceConnectionLoginData serviceConnectionData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringimpersonatedUser

Name of the DW user.

stringtrustedUser

Name of a trusted user.

stringpassword

The password.

ServiceConnectionLoginDataserviceConnectionData

The service connection data.

Returns

TypeDescription
Task<ServiceConnection>

A task which is creating a proxy which handles further requests.

CreateTrustedAsync(Uri, string, string, string, string, DWProductTypes?, HttpMessageHandler, ProductInfoHeaderValue[])

Creates a connection for the specified service URI asynchronously.

public static Task<ServiceConnection> CreateTrustedAsync(Uri serviceUri, string impersonatedUser, string trustedUser, string password, string organization = null, DWProductTypes? licenseType = null, HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringimpersonatedUser

Name of the DW user.

stringtrustedUser

Name of a trusted user.

stringpassword

The password.

stringorganization

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.

DWProductTypes?licenseType

Type of the license.

HttpMessageHandlerhttpClientHandler

The HTTP message handler.

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 null then the process name and version of you application is used as user agent string. If you do not want to submit any user agent, you must set this parameter to an empty array.

Returns

TypeDescription
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.

public static Task<ServiceConnection> CreateWithJwtAsync(Uri serviceUri, string accessToken, ServiceConnectionTokenLoginData serviceConnectionTokenLoginData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringaccessToken

The access jwt.

ServiceConnectionTokenLoginDataserviceConnectionTokenLoginData

The service connection token login data.

Returns

TypeDescription
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.

public static Task<ServiceConnection> CreateWithJwtAsync(Uri serviceUri, string accessToken, ServiceConnectionTokenLoginData serviceConnectionTokenLoginData, Func<Task<string>> refreshTokenCallback)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringaccessToken

The access jwt.

ServiceConnectionTokenLoginDataserviceConnectionTokenLoginData

The service connection token login data.

Func<Task<string>>refreshTokenCallback

Delegate for refreshing the token.

Returns

TypeDescription
Task<ServiceConnection>

A task which is creating a proxy which handles further requests.

CreateWithJwtAsync(Uri, string, Func<Task<string>>, DWProductTypes?, HttpMessageHandler, ProductInfoHeaderValue[])

Creates a connection for the specified service URI asynchronously.

public static Task<ServiceConnection> CreateWithJwtAsync(Uri serviceUri, string accessToken, Func<Task<string>> refreshTokenCallback, DWProductTypes? licenseType = null, HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringaccessToken

The access jwt.

Func<Task<string>>refreshTokenCallback

Delegate for refreshing the token.

DWProductTypes?licenseType

Type of the license.

HttpMessageHandlerhttpClientHandler

The HTTP message handler.

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 null then the process name and version of you application is used as user agent string. If you do not want to submit any user agent, you must set this parameter to an empty array.

Returns

TypeDescription
Task<ServiceConnection>

A task which is creating a proxy which handles further requests.

CreateWithJwtAsync(Uri, string, DWProductTypes?, HttpMessageHandler, ProductInfoHeaderValue[])

Creates a connection for the specified service URI asynchronously.

public static Task<ServiceConnection> CreateWithJwtAsync(Uri serviceUri, string accessToken, DWProductTypes? licenseType = null, HttpMessageHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringaccessToken

The access jwt.

DWProductTypes?licenseType

Type of the license.

HttpMessageHandlerhttpClientHandler

The HTTP message handler.

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 null then the process name and version of you application is used as user agent string. If you do not want to submit any user agent, you must set this parameter to an empty array.

Returns

TypeDescription
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.

public static ServiceConnection CreateWithWindowsAuthentication(Uri serviceUri, ICredentials credentials, ServiceConnectionLoginData serviceConnectionLoginData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

ICredentialscredentials

The credentials. This should be some credentials which can be used in the NTLM authentication protocol.

ServiceConnectionLoginDataserviceConnectionLoginData

The service connection login data.

Returns

TypeDescription
ServiceConnection

A task which is creating a proxy which handles further requests.

CreateWithWindowsAuthentication(Uri, ICredentials, string, DWProductTypes?, HttpClientHandler, ProductInfoHeaderValue[])

Creates a connection for the specified service URI using windows authentication.

public static ServiceConnection CreateWithWindowsAuthentication(Uri serviceUri, ICredentials credentials, string organization = null, DWProductTypes? licenseType = null, HttpClientHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

ICredentialscredentials

The credentials.

stringorganization

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.

DWProductTypes?licenseType

Type of the license to lock.

HttpClientHandlerhttpClientHandler

The HTTP client handler.

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 null then the process name and version of you application is used as user agent string. If you do not want to submit any user agent, you must set this parameter to an empty array.

Returns

TypeDescription
ServiceConnection

A proxy which handles further requests.

CreateWithWindowsAuthentication(Uri, string, string, ServiceConnectionLoginData)

Creates a connection for the specified service URI using NTLM authentication.

public static ServiceConnection CreateWithWindowsAuthentication(Uri serviceUri, string userName, string password, ServiceConnectionLoginData serviceConnectionLoginData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringuserName

Name of the user.

stringpassword

The password.

ServiceConnectionLoginDataserviceConnectionLoginData

The service connection login data.

Returns

TypeDescription
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.

public static ServiceConnection CreateWithWindowsAuthentication(Uri serviceUri, string userName, string password, string domain, ServiceConnectionLoginData serviceConnectionLoginData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringuserName

Name of the user.

stringpassword

The password.

stringdomain

The domain.

ServiceConnectionLoginDataserviceConnectionLoginData

The service connection login data.

Returns

TypeDescription
ServiceConnection

A task which is creating a proxy which handles further requests.

CreateWithWindowsAuthentication(Uri, string, string, string, string, DWProductTypes?, HttpClientHandler, ProductInfoHeaderValue[])

Creates a connection for the specified service URI using windows authentication.

public static ServiceConnection CreateWithWindowsAuthentication(Uri serviceUri, string userName, string password, string domain = null, string organization = null, DWProductTypes? licenseType = null, HttpClientHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringuserName

Name of the user.

stringpassword

The password.

stringdomain

The domain.

stringorganization

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.

DWProductTypes?licenseType

Type of the license to lock.

HttpClientHandlerhttpClientHandler

The HTTP client handler.

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 null then the process name and version of you application is used as user agent string. If you do not want to submit any user agent, you must set this parameter to an empty array.

Returns

TypeDescription
ServiceConnection

A proxy which handles further requests.

CreateWithWindowsAuthenticationAsync(Uri, ICredentials, ServiceConnectionLoginData)

Creates a connection for the specified service URI using NTLM authentication.

public static Task<ServiceConnection> CreateWithWindowsAuthenticationAsync(Uri serviceUri, ICredentials credentials, ServiceConnectionLoginData serviceConnectionLoginData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

ICredentialscredentials

The credentials. This should be some credentials which can be used in the NTLM authentication protocol.

ServiceConnectionLoginDataserviceConnectionLoginData

The service connection login data.

Returns

TypeDescription
Task<ServiceConnection>

A task which is creating a proxy which handles further requests.

CreateWithWindowsAuthenticationAsync(Uri, ICredentials, string, DWProductTypes?, HttpClientHandler, ProductInfoHeaderValue[])

Creates a connection for the specified service URI using NTLM authentication.

public static Task<ServiceConnection> CreateWithWindowsAuthenticationAsync(Uri serviceUri, ICredentials credentials, string organization = null, DWProductTypes? licenseType = null, HttpClientHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

ICredentialscredentials

The credentials. This should be some credentials which can be used in the NTLM authentication protocol.

stringorganization

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.

DWProductTypes?licenseType

Type of the license to lock.

HttpClientHandlerhttpClientHandler

The HTTP client handler.

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 null then the process name and version of you application is used as user agent string. If you do not want to submit any user agent, you must set this parameter to an empty array.

Returns

TypeDescription
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.

public static Task<ServiceConnection> CreateWithWindowsAuthenticationAsync(Uri serviceUri, string userName, string password, ServiceConnectionLoginData serviceConnectionLoginData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringuserName

Name of the user.

stringpassword

The password.

ServiceConnectionLoginDataserviceConnectionLoginData

The service connection login data.

Returns

TypeDescription
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.

public static Task<ServiceConnection> CreateWithWindowsAuthenticationAsync(Uri serviceUri, string userName, string password, string domain, ServiceConnectionLoginData serviceConnectionLoginData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringuserName

Name of the user.

stringpassword

The password.

stringdomain

The domain.

ServiceConnectionLoginDataserviceConnectionLoginData

The service connection login data.

Returns

TypeDescription
Task<ServiceConnection>

A task which is creating a proxy which handles further requests.

CreateWithWindowsAuthenticationAsync(Uri, string, string, string, string, DWProductTypes?, HttpClientHandler, ProductInfoHeaderValue[])

Creates a connection for the specified service URI using NTLM authentication.

public static Task<ServiceConnection> CreateWithWindowsAuthenticationAsync(Uri serviceUri, string userName, string password, string domain = null, string organization = null, DWProductTypes? licenseType = null, HttpClientHandler httpClientHandler = null, ProductInfoHeaderValue[] userAgent = null)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

stringuserName

Name of the user.

stringpassword

The password.

stringdomain

The domain.

stringorganization

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.

DWProductTypes?licenseType

Type of the license to lock.

HttpClientHandlerhttpClientHandler

The HTTP client handler.

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 null then the process name and version of you application is used as user agent string. If you do not want to submit any user agent, you must set this parameter to an empty array.

Returns

TypeDescription
Task<ServiceConnection>

A task which is creating a proxy which handles further requests.

Disconnect()

Disconnects this instance.

public void Disconnect()

DisconnectAsync()

Disconnects this instance.

public Task DisconnectAsync()

Returns

TypeDescription
Task

A task which disconnects the client.

DisconnectAsync(CancellationToken)

Disconnects this instance.

public Task DisconnectAsync(CancellationToken token)

Parameters

TypeNameDescription
CancellationTokentoken

Cancellation token.

Returns

TypeDescription
Task

A task which disconnects the client.

GetIdentityServiceInfoAsync(Uri, IdentityServiceInfoConnectionData)

Gets the identity service address.

public static Task<IdentityServiceInfo> GetIdentityServiceInfoAsync(Uri serviceUri, IdentityServiceInfoConnectionData serviceConnectionData)

Parameters

TypeNameDescription
UriserviceUri

The service URI.

IdentityServiceInfoConnectionDataserviceConnectionData

The service connection data.

Returns

TypeDescription
Task<IdentityServiceInfo>

GetOrganizationsAsync()

Gets the organizations asynchronous.

public Task<Organization[]> GetOrganizationsAsync()

Returns

TypeDescription
Task<Organization[]>

The list of available organizations.

GetXmlAsync<T>(string)

Gets the XML from the specified uri asynchronously.

public Task<DeserializedHttpResponse<T>> GetXmlAsync<T>(string uri) where T : class

Parameters

TypeNameDescription
stringuri

The URI.

Returns

TypeDescription
Task<DeserializedHttpResponse<T>>

The parsed data.

Type Parameters

NameDescription
T

The type of the response.

Exceptions

TypeCondition
HttpClientRequestException

Thrown, if the request failed. In this case, you can inspect Error.

GetXml<T>(string)

Gets the XML from the specified uri.

public T GetXml<T>(string uri) where T : class

Parameters

TypeNameDescription
stringuri

The URI.

Returns

TypeDescription
T

The parsed data.

Type Parameters

NameDescription
T

Exceptions

TypeCondition
HttpClientRequestException

Thrown, if the request failed. In this case, you can inspect Error.

ReplaceHttpClient(ServiceConnection)

Replaces the HTTP client.

public void ReplaceHttpClient(ServiceConnection otherServiceConnection)

Parameters

TypeNameDescription
ServiceConnectionotherServiceConnection

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.

public void ReplaceHttpClient(HttpClient httpClient)

Parameters

TypeNameDescription
HttpClienthttpClient

The HTTP client.

SetHostId(string)

Sets the identifier of the machine the .NET API client is running.

public static void SetHostId(string hostId)

Parameters

TypeNameDescription
stringhostId

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.