Muokkaa

Jaa


Using the ServiceModel Metadata Utility Tool with the BizTalk Adapter for Siebel eBusiness Applications

You can use the ServiceModel Metadata Utility Tool (svcutil.exe) to generate a WCF client class for operations that the Microsoft BizTalk Adapter for Siebel eBusiness Applications exposes. After you run svcutil.exe to generate a WCF client class, you can include the generated file in your code and create instances of the WCF client class to perform operations on the Siebel system.

Using svcutil.exe requires you to supply a connection URI that contains credentials. Because, by default, the Siebel adapter disables credentials in the connection URI, you must configure svcutil.exe to use a non-default binding for the Siebel adapter. You can also configure other binding properties in the non-default binding.

The following sections show you how to configure svcutil.exe and how to use svcutil.exe to generate WCF client code with the Siebel adapter.

Configure svcutil.exe for a non-default binding

To configure svcutil.exe to use a non-default binding, you must create a local copy of svcutil.exe and then create or modify a local copy of the svcutil.exe.config configuration file.

  1. Create a folder, and copy svcutil.exe into the new folder. You can typically find svcutil.exe at the Windows SDK installation location, specifically, C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin.

  2. Create a file named svcutil.exe.config in the new folder.

  3. Add a binding and a client endpoint to the svcutil.exe.config file. You must run svcutil.exe from the new folder to ensure that the correct configuration is used.

    Important

    The name attribute of the client endpoint must specify the scheme used in the connection URI. This value is case-sensitive.

    <configuration>
      <system.serviceModel>
        <client>
          <!-- the name should match the required scheme of the Metadata Exchange endpoint
          and the contract should be "IMetadataExchange" -->
          <endpoint name="siebel"
            binding="siebelBinding"
            bindingConfiguration="SiebelBinding"
            contract="IMetadataExchange" />
        </client>
        <bindings>
          <siebelBinding>
            <binding name="SiebelBinding" acceptCredentialsInUri="true" />
          </siebelBinding>
        </bindings>
    
      </system.serviceModel>
    
    </configuration>
    
    

Note

You can set any of the binding properties of the Siebel adapter in the binding configuration.

For more information about configuring a non-default binding for svcutil.exe, see the "Custom Secure Metadata Endpoint" topic in the WCF documentation at https://go.microsoft.com/fwlink/?LinkId=96077.

Creating a WCF Client Class with svcutil.exe

To use svcutil.exe to generate WCF client code for the Siebel adapter, you must supply a connection URI that specifies an IMetadataExchange (mex) endpoint and the operation or operations for which you want svcutil.exe to generate code. You must also specify connection credentials for the Siebel system in the connection URI.

Note

Before you can use svcutil.exe with the Siebel adapter, you must configure it to use a non-default binding; for information about how to do this, see Configuring svcutil.exe for the Siebel Adapter.

You specify a mex endpoint and target operations in the Siebel adapter connection URI in the following manner:

  • You must include the "wsdl" parameter in the query_string. If it is the first parameter in the query_string, it is specified just after the question mark (?). If it is not the first parameter, it should be preceded with an ampersand (&).

  • You must follow the "wsdl" parameter by one or more "op" parameters. Each "op" parameter is preceded by an ampersand (&) and specifies the node ID of a target operation.

    The following two examples show how to target various operations by using svcutil.exe. The following note applies to both examples.

    Caution

    This example or guidance references sensitive information, such as a connection string or a username and password. Never hardcode these values in your code, and make sure that you protect confidential data by using the most secure authentication available. For more information, see the following documentation:

    This example creates a WCF client class for an insert operation on the ACCOUNT\ACCOUNT Business Object.

    .\svcutil "siebel://Username=YourUserName;Password=YourPassword@Siebel_server:1234?SiebelEnterpriseServer=ent_server&SiebelObjectManager=obj_mgr&Language=enu&wsdl&op=http://Microsoft.LobServices.Siebel/2007/03/BusinessObjects/Account/Account/Insert"

    This example creates a WCF client class for both an insert operation and a delete operation on the ACCOUNT\ACCOUNT Business Object.

    .\svcutil " siebel://Username=YourUserName;Password=YourPassword@Siebel_server:1234?SiebelEnterpriseServer=ent_server&SiebelObjectManager=obj_mgr&Language=enu&wsdl&op=http://Microsoft.LobServices.Siebel/2007/03/BusinessObjects/Account/Account/Insert&op=http://Microsoft.LobServices.Siebel/2007/03/BusinessObjects/Account/Account/Delete"

Important

You must place the connection URI in quotation marks on the command line. Otherwise, svcutil.exe attempts to retrieve metadata for operations that the Siebel adapter does not support. The results of such an attempt are undefined.

By default, svcutil.exe places the generated code in the output.cs file; however, you can change the name of the output file and many other options that svcutil.exe uses by setting command-line switches.

Svcutil.exe does not provide the capability to search for operations (for example, by using wildcard characters). You must explicitly specify node IDs for the specific operations you want to target. You cannot specify node IDs that refer only to categories. For more information about the node IDs that the Siebel adapter surfaces, see Metadata Node IDs.

The Add Adapter Service Reference Visual Studio Plug-in provides advanced browse and search capabilities that can greatly simplify generating a WCF client class. For more information about the Add Adapter Service Reference Plug-in, see Generate a WCF client or a WCF service contract for Siebel solution artifacts.