示例 BDC 模型:连接到 WCF 服务
上次修改时间: 2010年4月21日
适用范围: SharePoint Server 2010
下面的示例演示了如何使用一组 LobSystem 和 LobSystemInstance 属性配置使用元数据交换的 Windows Communication Foundation (WCF) 服务连接。MEX 终结点和 WCF 服务的服务终结点应在服务的 web.config 中定义。
示例
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Model Name="ExampleApplicationDefinition" xmlns="https://schemas.microsoft.com/windows/2007/BusinessDataCatalog">
<LobSystems>
<LobSystem Name="ExampleCRM" Type="Wcf">
<Properties>
<Property Name="WcfMexDiscoMode" Type="System.String">Disco</Property>
<Property Name="WcfMexDocumentUrl" Type="System.String">http://example.org/?wsdl</Property>
<Property Name="WcfProxyNamespace" Type="System.String">ExampleCrmNamespace</Property>
<Property Name="WsdlFetchAuthenticationMode" Type="System.String">PassThrough</Property>
</Properties>
<LobSystemInstances>
<LobSystemInstance Name="ExampleServer">
<Properties>
<Property Name="WcfAuthenticationMode" Type="System.String">PassThrough</Property>
<Property Name="WcfEndpointAddress" Type="System.String">http://example.org</Property>
</Properties>
</LobSystemInstance>
</LobSystemInstances>
<Entities>
<Entity Name="Customer" Namespace="example.com" Version="1.0.0.0">
<Identifiers>
<Identifier Name="CustomerIdentifier" TypeName="System.Int32" />
</Identifiers>
<Methods>
<Method Name="GetCustomers">
<Parameters>
<Parameter Name="CustomerId" Direction="In">
<TypeDescriptor Name="Id" TypeName="System.Int32" IdentifierName="CustomerIdentifier" />
</Parameter>
<Parameter Name="Customers" Direction="Return">
<TypeDescriptor Name="CustomerArray" TypeName="ExampleCrmNamespace.Customer[], ExampleCRM" IsCollection="true">
<TypeDescriptors>
<TypeDescriptor Name="Customer" TypeName="ExampleCrmNamespace.Customer, ExampleCRM">
<TypeDescriptors>
<TypeDescriptor Name="Id" TypeName="System.Int32" IdentifierName="CustomerIdentifier" />
<TypeDescriptor Name="FirstName" TypeName="System.String" />
<TypeDescriptor Name="LastName" TypeName="System.String" />
</TypeDescriptors>
</TypeDescriptor>
</TypeDescriptors>
</TypeDescriptor>
</Parameter>
</Parameters>
<MethodInstances>
<MethodInstance Name="GetCustomer" Type="SpecificFinder" ReturnParameterName="Customers" ReturnTypeDescriptorPath="CustomerArray[0]" />
</MethodInstances>
</Method>
</Methods>
</Entity>
</Entities>
</LobSystem>
</LobSystems>
</Model>