Saturday, April 19, 2008

BDC WebService and valid Return Types

You can use basic data types int, string, ... or dataset as a valid return type of method in WebService to be used with BDC
This is sample of return type dataset in definition file of BDC:

<Parameter Direction="Return" Name="Customers">
<TypeDescriptor Name=""DataSet"" TypeName=""System.Data.DataSet, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"">
<TypeDescriptors>
<TypeDescriptor Name=""Tables"" TypeName=""System.Data.DataTableCollection, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"" IsCollection=""true"">
<TypeDescriptors>

<TypeDescriptor Name=""Table"" TypeName=""System.Data.DataTable, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"" >
<TypeDescriptors>
<TypeDescriptor Name=""Rows"" TypeName=""System.Data.DataRowCollection, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"" IsCollection=""true"">
<TypeDescriptors>

<TypeDescriptor Name=""DataRow"" TypeName=""System.Data.DataRow, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"">
<TypeDescriptors>
<TypeDescriptor Name=""field1"" TypeName=""System.String"" IdentifierName=""f1"" />
<TypeDescriptor Name=""field2"" TypeName=""System.String"" />
<TypeDescriptor Name=""field3"" TypeName=""System.String"" />
</TypeDescriptors>
</TypeDescriptor>
</TypeDescriptors>
</TypeDescriptor>
</TypeDescriptors>
</TypeDescriptor>
</TypeDescriptors>
</TypeDescriptor>
</TypeDescriptors>
</TypeDescriptor>
</Parameter>


Note: You can use same definition when you use typed DataSet

No comments: