Client constructors
To use the eConnect Integration Service, you first initialize one or more of the following eConnect client classes:
- DocumentNumberRollbackClient
- eConnectClient
- TransactionRecordIdsClient
Each class includes one or more constructors you can use to initialize a client object. Typically, you use the default constructor. The default constructor uses the endpoint specified in Microsoft.Dynamics.GP.eConnect.Service.exe.config file. When you install eConnect, the configuration file is added to the folder:
c:\Program Files\Microsoft Dynamics\eConnect 12.0\Service\
The following C# code example use the default constructor to initialize an eConnectClient object:
// Initialize a new instance of the eConnectClient eConnectClient eConnectObject = new eConnectClient();
However, you can use other constructor methods to specify the eConnect Integration Service endpoint you want to use. All of the client classes inherit from the System.ServiceModel.ClientBase class. The ClientBase class includes overloaded constructors that you can use to specify endpoint information.
For example, the following table lists all the constructor methods for the eConnectClient class
Hint: The DocumentNumberRollbackClient and TransactionRecordIdsClient include overloaded constructors with the same parameters as the eConnectClient class.
You use one of these constructors when you want to target a different endpoint then the default endpoint..
Name |
Description |
---|---|
eConnectClient() |
Initializes a new instance of the eConnectClient class using the default target endpoint. |
eConnectClient(string endpointConfigurationName) |
Initializes a new instance of the eConnectClient class using the specified endpoint configuration. You have to add the endpoint configuration information to the configuration file of your application. |
eConnectClient(string endpointConfigurationName, string remoteAddress) |
Initializes a new instance of the eConnectClient class using the specified endpoint configuration. You have to add the endpoint configuration information to the configuration file of your application. You also specify the service address you want to use. |
eConnectClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) |
Initializes a new instance of the eConnectClient class using the specified endpoint configuration. You have to add the endpoint configuration information to the configuration file of your application. You also specify the service address you want to use. |
eConnectClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) |
Initializes a new instance of the eConnectClient class using the specified binding and endpoint address. |
The constructors use the following parameters.
Name |
Type |
Description |
---|---|---|
binding |
System.ServiceModel.Channels.Binding |
Specifies the binding to use to make calls to the service. |
endpointConfiguationName |
string |
Specifies the name of the endpoint in the application configuration file. |
remoteAddress |
string |
Specifies the address of the eConnect Integration Service. |
remoteAddress |
System.ServiceModel.EndpointAddress |
Specifies the address of the eConnect Integration Service. |