locked
QueryServiceContract examples? RRS feed

  • Question

  • Hi--

    I believe I have a need to use QueryServiceContract (the query sent to the ContractDirectory).  I've come across a couple posts in the forum from George C. indicating that there are examples demonstrating the use of
    QueryServiceContract in the forum, but when I search all I find is posts saying there are examples in other posts, but no examples.

    Could someone point me to further documentation and examples of how to use
    QueryServiceContract?  I've looked in the places I'm aware of and haven't found much documentation.

    Thanks in advance,
    --Andrew
    Wednesday, July 9, 2008 10:10 PM

Answers

  • CTP2 is out, please  give it a try (look at the new operation types the ContractDirectory supports). Also the physics engine issue you point to, is fixed in CTP2.

     

    In CTP2, here is how you query by contract:

     

                cd.ContractResults results = null;
                var body = new cd.QueryByContractRequest();
                body.Contract = Contract.Identifier;
                cd.QueryByContract query = new cd.QueryByContract(body);
                query.TimeSpan = DsspOperation.DefaultLongTimeSpan;
                _contractDir.Post(query);

                yield return Arbiter.Choice(
                    query.ResponsePort,
                    delegate (cd.ContractResults res) {results = res;},
                    delegate (Fault f) {start.ResultPort.Post(new Exception("fault"));}
                );

    Then look in results.ServiceSummaries list for your service metadata information

    Tuesday, July 22, 2008 4:45 AM

All replies

  • I just found this one, but it's not answering all my questions.  Please let me know if there are more.
    Wednesday, July 9, 2008 10:58 PM
  • Hi, we are actually drastically simplifying this API (and massively speeding up contract loading, dssproxy reflection etc) in the upcoming CTP (will be out *very* shortly) . The changes to this api will be breaking.

     

    But for examples, you can look in the samples that ship with MSRDS. The Sumo package (seperate download for 1.5) for example uses this.

     

     

     

    Thursday, July 10, 2008 5:57 PM
  •  George Chrysanthakopoulos wrote:

    Hi, we are actually drastically simplifying this API (and massively speeding up contract loading, dssproxy reflection etc) in the upcoming CTP (will be out *very* shortly) . The changes to this api will be breaking.


    I don't suppose you can give any more detail about timeframe?


     George Chrysanthakopoulos wrote:

    But for examples, you can look in the samples that ship with MSRDS. The Sumo package (seperate download for 1.5) for example uses this.



    I took a look at the sumo competition package, but it looks to me like the part I need to look at the source for -- the bit in the referee that checks the directory for sumoplayer services, presents them in a drop-down, and then loads the selected one -- is in the simulatedsumoreferee service, and I don't seem to have the source code for that, just the dll.

    Also, I can't actually run the simulation (on my home machine) due to this bug...
    Wednesday, July 16, 2008 7:51 PM
  • CTP2 is out, please  give it a try (look at the new operation types the ContractDirectory supports). Also the physics engine issue you point to, is fixed in CTP2.

     

    In CTP2, here is how you query by contract:

     

                cd.ContractResults results = null;
                var body = new cd.QueryByContractRequest();
                body.Contract = Contract.Identifier;
                cd.QueryByContract query = new cd.QueryByContract(body);
                query.TimeSpan = DsspOperation.DefaultLongTimeSpan;
                _contractDir.Post(query);

                yield return Arbiter.Choice(
                    query.ResponsePort,
                    delegate (cd.ContractResults res) {results = res;},
                    delegate (Fault f) {start.ResultPort.Post(new Exception("fault"));}
                );

    Then look in results.ServiceSummaries list for your service metadata information

    Tuesday, July 22, 2008 4:45 AM
  • In CTP2, isn't QueryByContract marked internal? How does this work for the rest of us?

    [I am interested in QueryByCategories which is also internal].

    Thanks
    Nick.
    Monday, August 25, 2008 1:54 PM
  • Nick, use the Dssruntime.Proxy types, everything is available there.

     

    Wednesday, August 27, 2008 12:24 AM
  • Oops. Of course. Thanks George.

    Nick.
    Wednesday, August 27, 2008 1:13 AM