locked
partnerships with services implementing generic contracts RRS feed

  • Question

  • Hi,

    I have the following service partner declaration in my code for service Foo:

     [Partner("Camera", Contract = webcam.Contract.Identifier,
             CreationPolicy = PartnerCreationPolicy.UsePartnerListEntry)]
            webcam.WebCamOperations _camPort = new webcam.WebCamOperations();

    Here, webcam is the generic webcam contract in Microsoft.Robotics.Services.WebCam.Proxy.

    I have another service, Bar, that implements the generic webcam as an alternate contract.  My question is, how do I  write the Foo/Bar partnership into my manifest?  The following manifest returns 'partner enumeration failed' when creating Foo:

    Code Snippet

    <?xml version="1.0" ?>
    <Manifest
        xmlns="http://schemas.microsoft.com/xw/2004/10/manifest.html"
        xmlns:dssp="http://schemas.microsoft.com/xw/2004/10/dssp.html"
        >
        <CreateServiceList>
    <ServiceRecordType>     
          <dssp:Contract>http://www.volts-iq.com/2007/06/Bar.html</dssp:Contract>
          <dssp:Service>http://localhost/bar</dssp:Service> 
        <Name>ImplementsWebCam</Name>   
        </ServiceRecordType>
            <ServiceRecordType>
                <dssp:Contract>http://www.volts-iq.com/2007/06/Foo.html</dssp:Contract>
    <dssp:PartnerList>
    <dssp:Partner>
    <dssp:Name>ImplementsWebCam</dssp:Name>
    </dssp:Partner>
    </dssp:PartnerList>   
            </ServiceRecordType>
        </CreateServiceList>
    </Manifest>



    Foo is looking for something that implements the webcam contract and it doesn't seem to figure out that Bar provides this contract as an alternate.

    Bonus points if you can also explain how I can do this programmatically (ie, how do I define the PartnerType that I'd pass to CreateService.

    thanks,
    R
    Thursday, August 23, 2007 8:31 PM

Answers

  • In terms of creating a manifest: Please use our new graphical Manifest Editor! The drag and drop the services you need to start, and add them as partners. The editor "guides" you so the right thing happens. Load any of our existing manifests in samples\config with the editor, to see examples of services dependening on generic contracts.

     

    Programmatically:

     

    Its the same as using the manifest editor (which is just vpl /m ). Once you have a manifest that works, you can send that manifest to the manifest loader service to start your services.

     

    In general we definately support what you are trying to. For example all those manifests with services that depend on generic differential drives, work just fine, since at runtime, the runtime searchs for that contract in the directory and will find all services that implement it as an alternate.

     

    Things to check, after using the manifest editor:

     

    1) make sure your service shows up with both it smain URI, and alternate URIs in the directory. This means BAR implemented the alternate properly

    2) Make sure the names you use to name the partner entry AND the service record fully match up AND they match up to the full name you supply in your partner attribute! Remember, a partne rname is a a full Xml qualified name. We allow people to supply simple names in their code, only if the dont plan to use manifests. But in general use "strong", fully qualified names.

     

    The manifest editor will take care of the name situation btw since it detects the name your code uses, so i strongly recommend you use it.

     

    thanx

    g

     

     

    Friday, August 24, 2007 5:08 PM

All replies

  • In terms of creating a manifest: Please use our new graphical Manifest Editor! The drag and drop the services you need to start, and add them as partners. The editor "guides" you so the right thing happens. Load any of our existing manifests in samples\config with the editor, to see examples of services dependening on generic contracts.

     

    Programmatically:

     

    Its the same as using the manifest editor (which is just vpl /m ). Once you have a manifest that works, you can send that manifest to the manifest loader service to start your services.

     

    In general we definately support what you are trying to. For example all those manifests with services that depend on generic differential drives, work just fine, since at runtime, the runtime searchs for that contract in the directory and will find all services that implement it as an alternate.

     

    Things to check, after using the manifest editor:

     

    1) make sure your service shows up with both it smain URI, and alternate URIs in the directory. This means BAR implemented the alternate properly

    2) Make sure the names you use to name the partner entry AND the service record fully match up AND they match up to the full name you supply in your partner attribute! Remember, a partne rname is a a full Xml qualified name. We allow people to supply simple names in their code, only if the dont plan to use manifests. But in general use "strong", fully qualified names.

     

    The manifest editor will take care of the name situation btw since it detects the name your code uses, so i strongly recommend you use it.

     

    thanx

    g

     

     

    Friday, August 24, 2007 5:08 PM
  • Old habits die hard.  I used the manifest editor and then duplicated the entries in my programmatic partnership.  I suspect it was a namespace mismatch.

    thanks!

    Friday, August 24, 2007 6:16 PM
  • i am so happy our new visual manifest editor solves these issues

    Friday, August 24, 2007 8:35 PM