none
Rx HOL .NET RRS feed

  • Question

  • I am working my way through the HOL and have been able to resolve issues resulting from chnages to Rx libraries, etc.  However, I am stuck in "Exercise 7 - Bridging the asynchronous method pattern with Rx".  It appears that the DictService provided by http://services.aonaware.com/DictService has changed and no longer provides public BeginMatchInDict or EndMatchInDict members:
    var svc = new DictServiceSoapClient("DictServiceSoap"); 
    var matchInDict = Observable.FromAsyncPattern<string, string, string, DictionaryWord[]> (svc.BeginMatchInDict, svc.EndMatchInDict);
    Any help or should I just wait for the updated HOL?

    • Edited by Hugh DeMann Friday, December 9, 2011 9:29 PM
    Friday, December 9, 2011 9:26 PM

All replies

  • Hi,

    The service still has MatchInDict:

    http://services.aonaware.com/DictService/DictService.asmx?op=MatchInDict

    It's possible that you generated a client that doesn't include asynchronous methods.  The lab provides instructions with screenshots on how to enable asynchronous operations.  See the second page after Exercise 7 begins.

    - Dave


    http://davesexton.com/blog
    Saturday, December 10, 2011 12:22 AM
  • Dave,

    Thanks for the reply

    I think my problem is that I am trying to use a Silverlight app instead of a Console app. When I try to select the “Generate asynchronous operations” option when creating the service reference in Silverlight the checkbox is already checked/disabled and I don't get everything I need. When I do the same in the Console version everthing works as expected.

    Monday, December 12, 2011 8:53 PM
  • Hi,

    Silverlight only supports asynchronous web requests, so presumably that's why you have no choice but to generate asynchronous operations; however, that's exactly what you need, so perhaps you're just not looking in the right place in your code.

    Can you post a complete list of the names of the methods that are generated in your client proxy class?

    For example, in the class that is generated for you by the Add Service Reference dialog, you should see BeginMatchInDict and EndMatchInDict methods, corresponding to the MatchInDict web service.  You may have to select Show All Files in Solution Explorer to see the generated file under the Service References folder.  Alternatively, you can try searching the entire project for the term "MatchInDict".

    - Dave


    http://davesexton.com/blog
    Monday, December 12, 2011 9:23 PM
  • The DictServiceSoapClient section in Reference.cs is very large (500+ lines) but I provided an image from the Object Viewer. Looks like BeginMatchInDict and EndMatchInDict methods get stuck in a private DictServiceSoap class.

     

    Monday, December 12, 2011 10:56 PM
  • I believe you can use MatchInDictAsync instead of the Begin/EndMatchInDict methods. I guess it returns a Task, which is convertible to an IObservable.
    Omer Mor
    Tuesday, December 13, 2011 6:04 PM
  • Hi,

    I agree with Omer, but I'm also not sure why the async pattern operations aren't public for you.

    Anyway, this question is outside of the scope of Rx.  You may want to try posting in the Silverlight or WCF forums for additional help.

    - Dave


    http://davesexton.com/blog
    Tuesday, December 13, 2011 10:09 PM
  • Thanks guys. I appreciate the help.

    -- HD

    Wednesday, December 14, 2011 2:32 PM
  • I guess you're using the developer preview of .NET 4.5. I read that in that version WCF now generates task-returning async methods instead of the begin/end ones.
    Omer Mor
    Wednesday, December 14, 2011 6:24 PM
  • Hi Omer,

    Actually Hugh wrote that he's using Silverlight.  I would assume that WCF doesn't generate Task-returning operations in SL4 or SL5, but perhaps it does?

    - Dave


    http://davesexton.com/blog
    Wednesday, December 14, 2011 6:59 PM