다음을 통해 공유


How to: Use SharePoint Designer to Create a BDC Model File for a Custom Connector

To create a SharePoint Server 2010 external content type that is based on a custom connector assembly, you use Microsoft SharePoint Designer 2010.

Applies to: SharePoint Server 2010

To do this, you deploy the custom connector assembly to the BDC Metadata Store and then use the External Content Type Designer in SharePoint Designer 2010 to create an external content type that connects to the custom connector assembly.

To deploy the custom connector assembly to the BDC Metadata Store

  1. The custom connector assembly must exist in an LobSystem object in the BDC Metadata Store. To add the assembly to the BDC Metadata Store, create an empty BDC model file by copying the following markup into a text file, and then save the text file as an XML file.

    <?xml version="1.0"?>
    <Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    Name="ScaterMultipleFields" xmlns="https://schemas.microsoft.com/windows/2007/BusinessDataCatalog">
        <LobSystems>
            <LobSystem Name="TestSystem" Type="DotNetAssembly">
                <Properties>
                    <Property Name="SystemUtilityTypeName" Type="System.String">
                             [Proxy class Type] 
                    </Property>
                    <Property Name="InputUriProcessor" Type="System.String">
                              [Type of class implementing ILobUri] 
                    </Property>
                    <Property Name="OutputUriProcessor" Type="System.String">
                              [Type of class implementing INamingContainer] 
                    </Property>
                </Properties>
                <LobSystemInstances>
                    <LobSystemInstance Name="TestInstance">
                        <Properties>
                            < Property Name="AuthenticationMode"
     Type="Microsoft.SharePoint.BusinessData.SystemSpecific.Db.DbAuthenticationMode">
                              PassThrough
                            </Property>
                        </Properties>
                    </LobSystemInstance>
                </LobSystemInstances>      
            </LobSystem>
        </LobSystems>
    </Model>
    
  2. Import the model by following the steps described in the "Import a BDC Model" section of Manage BDC Modelson Microsoft TechNet.

  3. Open the SharePoint Management Shell on the application server. For information about using this tool, see Administering Service Applications Using the SharePoint 2010 Management Shell.

  4. To get the LobSystem from the Administration metadata catalog, execute the following commands.

    C:\PS>$site=”http://YourSiteName”
    C:\PS>$LobSystemName = "TestSystem"
    C:\PS>$lobsys = Get-SPBusinessDataCatalogMetadataObject –BdcObjectType LobSystem –ServiceContext $site -Name $LobSystemName
    
  5. To import the assembly, execute the following SPBusinessDataCatalogDotNetAssemblyWindows PowerShell cmdlet.

    C:\PS>Import-SPBusinessDataCatalogDotNetAssembly -Path [Path to dll] -LobSystem $lobsys
    

To create an external content type for the custom connector by using SharePoint Designer 2010

  1. Open SharePoint Designer 2010 and create an external content type by following the steps described in How to: Create an External Content Type Based on a Web Service. Except for the procedure "To add a connection to the external system," the steps are exactly the same.

    To add a connection to a .NET Framework assembly, perform the following steps:

    1. Select Click here to discover external data sources and define operations.

    2. In the Add Connection dialog box, click .NET Type.

    3. In the .NET Type Selection dialog box, click the Browse button to specify the external system in the BDC Metadata Store that contains the reference to the .NET assembly you want to connect to. Select the system, and then click OK.

    You should now be able to see all the public .NET types defined in the assembly and the methods they contain.

  2. Select the type of the proxy class that contains all the external system methods.  Define the operations as you would for a web service, as described in How to: Create an External Content Type Based on a Web Service.

  3. Click Save to save the changes to the BDC Metadata Store.

  4. Go to the External Content Types view, and then select the external content type you created.

  5. Click Export BDC Model in the Server ribbon, and then save the model file.

  6. Open the model file you saved in the previous step in an XML editor, and make the following changes:

    • Delete the Proxy element.

    • Change the value of the Type attribute of the LobSystem element from DotNetAssembly to Custom.

    • Add any other properties that you want to use to the model file.

  7. Save the model file.

You can now use this model file for a custom connector.

See Also

Tasks

How to: Create an External Content Type Based on a Web Service

Other Resources

Administering Service Applications Using the SharePoint 2010 Management Shell

Manage BDC Models (SharePoint Server 2010)