BDC-App for Web Service with paging

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

Because not so many people blog about BDC somehow I feel responsible to post a bit about this MOSS feature. Today I will describe how to implement the web service which should be enabled for MOSS search crawler.
Interesting in this scenario is not how to create Lob system based on the web service. More over, the question is how to do this by using of service which retrieve millions of records.

Such service has to provide in general at least two BDC methods: IdEnumerator and FindSpecific. If you do not know what this mean I would recommend to read more about BDC.

Here is the code snippet which shows how to implement the operation GetCustomerPaged (of type IdEnumerator). This operation receives the ID of the last retrieved record and the size of the page which MOSS crawler will supply. After collecting of the data (implementation not described in this post) the operation returns the page of data which contains the list of identifiers in the page and corresponding timestamp. The timestamp information is required because of incremental crawling and not because of paging.

Here is the code:

GetCustomerIdsPagedResult
GetCustomerIdsPaged(GetCustomerIdsPagedRequest request); 

[MessageContract]
public class GetCustomerIdsPagedRequest
{

       [MessageBodyMember]
       public int PageSize;

        [MessageBodyMember]
        public string Id;

}

[MessageContract]
public class GetCustomerIdsPagedResult
{
 
[MessageBodyMember]
 
public CustomerId[] Ids;
}


[DataContract]
public class CustomerId
{
   public CustomerId(string id, DateTime lastModified)
  
{

     Id = id;
    
LastModified = lastModified;
  
}

  
[DataMember]
  
public string Id;

  
[DataMember]
  
public DateTime LastModified;
}

 

Creating method
In the BDC editor we need to create the method of type IdEnumerator.

clip_image002

After the method is created it should look like shown at the next picture:

clip_image004

 

Create Identifier

Now we need to create the identifier. This is one of properties which service returns in the list of elements of type CustomerId . In this case this is property Id.

clip_image006

 

Creating Filter

Now we have to create the filter type descriptor of type LastIdFilter and with the name LastIdSeen.

clip_image008

 

Creating Parameters

Next picture shows all automatically created parameters. We have to bind now the parameter Id to the filter LastIdSeen. All other parameters remain as they are.

clip_image010

 

Returning parameter
The returning parameter Id has to be mapped to the property Id. This is because the crawler has to know which returning property is identifier.

clip_image012

 

Testing the method

This is all you have to do. Now you can test the method without of deploying the XML described LobSystem. Select method instance GetPaged and press „Collection“ button.
To do that first set
Testing Arguments and then execute the method.

clip_image014

 

Goto execute and press next.

 

Execute

clip_image016

 


Posted Jan 08 2008, 12:27 AM by Damir Dobric

Comments

Damir Dobric Posts wrote Indexing and filtering files with IFilter and .NET (C#)
on 01-19-2008 16:30

Indexing of files based on IFilter interface is pretty old Windows technology, which is today still important

kfybasvbp wrote re: BDC-App for Web Service with paging
on 06-26-2009 16:36

sKu0f2  <a href="ekonjzpgtgbz.com/.../a>, [url=http://cpjpkwvkdrtu.com/]cpjpkwvkdrtu[/url], [link=http://kqksuojqifyr.com/]kqksuojqifyr[/link], http://iityoswvvlee.com/

developers.de is a .Net Community Blog powered by daenet GmbH.