Click or drag to resize

BatchHubAccessService Method

Provides access to the BatchHub functionality and defines the access scope. Abstracts from the connection mode (Database, WebService) and establishes the connection to the data storage according to the configuration.

Namespace:  PDTec.IceNet.Domain.BatchHub
Assembly:  PDTec.IceNet.Domain.BatchHub (in PDTec.IceNet.Domain.BatchHub.dll) Version: 7.2.0.0 (7.2.7583.15464)
Syntax
C#
public static BatchHub AccessService()

Return Value

Type: BatchHub
The disposable BatchHub instance.
Remarks
The returned BatchHub object must be correctly disposed. See example.
Examples

This example shows how to use the BatchHub class to call IBatchHubService service methods.

C#
using (var batchHub = BatchHub.AccessService())
{
    string jobId;
    ServiceResult sr = batchHub.Service.BatchJobCreate(
        Arguments.QueueName,
        Arguments.Description,
        Arguments.Priority,
        Arguments.SubmittedBy,
        aProperties,
        null,
        false,
        out jobId);                        

    if (!sr.Success)                            
    {
        throw new ApplicationException("Service call failed: " + sr.ErrorMessage);
    }
}

To access the BatchHub service, one of the following configuration settings must be present:

XML
<configuration>
    <ice.net>
        <components>
            <batchhub mode="Database">
                <database service="SQLServer" connectionString="server=(local)\SQLEXPRESS;trusted_connection=yes;database=ice60q" encrypted="false"/>
            </batchhub>
        </components>
    </ice.net>
</configuration>
XML
<configuration>
    <ice.net>
        <components>
            <batchhub mode="WebService">
                <webService url="http://stuttgart.pdtec.lan/batchhub60/batchhub.asmx">
                    <authentication mode="AES" key="3A4DE34DF05B889E1C67121218854F8B3A4DE34DF05B889E1C67121218854F8B" />
                </webService>
            </batchhub>
        </components>
    </ice.net>
</configuration>
See Also