Results 1 to 3 of 3

Thread: [RESOLVED] WCF duplex service and Sharepoint

  1. #1

    Thread Starter
    Fanatic Member stlaural's Avatar
    Join Date
    Sep 2007
    Location
    Quebec, Canada
    Posts
    683

    Resolved [RESOLVED] WCF duplex service and Sharepoint

    Wondering if anyone has experience with Sharepoint developing and WCF services because I'm having a hard time with this one

    We have a client application that connects to a sharepoint server and it needs to retrieve some data from that server (We also have an application server-side to do that work). The data is quite big and it take a lot of time to prepare it before sending it to the client so we want to use WCF service in order to stream that data from the server to the client. This part is quite simple as it is only a "Request/Response" WCF service.

    The problem I have is the fact that preparing the data on the server takes some time. We want to be able to inform the client about the different stages (progress) we are going through before sending the data. In order to do that I though I could use a duplex wcf service (Callbacks) in order to let the client know what the server is currently doing, but it seems that Sharepoint cannot host Duplex WCF services.

    If anyone has any idea on how I could achieve that pls let me know. Any help would be greatly appreciated.

    I'll let you know if I find something in the mean time.

    Thanks
    Alex
    .NET developer
    "No. Not even in the face of Armageddon. Never compromise." (Walter Kovacs/Rorschach)

    Things to consider before posting.
    Don't forget to rate the posts if they helped and mark thread as resolved when they are.


    .Net Regex Syntax (Scripting) | .Net Regex Language Element | .Net Regex Class | DateTime format | Framework 4.0: what's new
    My fresh new blog : writingthecode, even if I don't post much.

    System: Intel i7 920, Kingston SSDNow V100 64gig, HDD WD Caviar Black 1TB, External WD "My Book" 500GB, XFX Radeon 4890 XT 1GB, 12 GBs Tri-Channel RAM, 1x27" and 1x23" LCDs, Windows 10 x64, ]VS2015, Framework 3.5 and 4.0

  2. #2

    Thread Starter
    Fanatic Member stlaural's Avatar
    Join Date
    Sep 2007
    Location
    Quebec, Canada
    Posts
    683

    Re: WCF duplex service and Sharepoint

    One way I though about doing it would be to have the client to send a GUID with its request and maintaining lets say a dictionary in wich I would add an entry for each client that requested the data and while the data is prepared update that entry with the step/progress that is currently going on for its request. Then the client, while he has not received its data yet can poll another service, again passing its GUID, that will check the dictionary and send back the current state/progress of the original client's request.

    Not sure that is a good or efficient way to do it though :S
    Alex
    .NET developer
    "No. Not even in the face of Armageddon. Never compromise." (Walter Kovacs/Rorschach)

    Things to consider before posting.
    Don't forget to rate the posts if they helped and mark thread as resolved when they are.


    .Net Regex Syntax (Scripting) | .Net Regex Language Element | .Net Regex Class | DateTime format | Framework 4.0: what's new
    My fresh new blog : writingthecode, even if I don't post much.

    System: Intel i7 920, Kingston SSDNow V100 64gig, HDD WD Caviar Black 1TB, External WD "My Book" 500GB, XFX Radeon 4890 XT 1GB, 12 GBs Tri-Channel RAM, 1x27" and 1x23" LCDs, Windows 10 x64, ]VS2015, Framework 3.5 and 4.0

  3. #3

    Thread Starter
    Fanatic Member stlaural's Avatar
    Join Date
    Sep 2007
    Location
    Quebec, Canada
    Posts
    683

    Re: WCF duplex service and Sharepoint

    I managed to build a prototype using 2 WCF services, both using BasicHttpBinding and a static class that uses a static Dictionary<Guid, string> which will contain the current progress/step of the request identified by the Guid.

    When I Request a large amount of data that needs a lot of steps performed (processing) before being sent, from Service1, each time a new step is performed, the entry is updated in the Dictionary. During that time, I have a second Thread that regularly request the current step from the Service2, which returns the value from the dictionary. This way I don't have to use Duplex communications (CallBacks) which I liked more but cannot be hosted in Sharepoint. This way the client is informed about what is currently happening before we start streaming the data.

    It seems to work pretty fine for now. I'll have to make more tests and make sure that everything runs perfectly though as I use some backgroundworkers. Then I'll have to check if it all works fine in Sharepoint :P
    Last edited by stlaural; Jan 12th, 2012 at 05:10 PM.
    Alex
    .NET developer
    "No. Not even in the face of Armageddon. Never compromise." (Walter Kovacs/Rorschach)

    Things to consider before posting.
    Don't forget to rate the posts if they helped and mark thread as resolved when they are.


    .Net Regex Syntax (Scripting) | .Net Regex Language Element | .Net Regex Class | DateTime format | Framework 4.0: what's new
    My fresh new blog : writingthecode, even if I don't post much.

    System: Intel i7 920, Kingston SSDNow V100 64gig, HDD WD Caviar Black 1TB, External WD "My Book" 500GB, XFX Radeon 4890 XT 1GB, 12 GBs Tri-Channel RAM, 1x27" and 1x23" LCDs, Windows 10 x64, ]VS2015, Framework 3.5 and 4.0

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width