Communicating with Other Services

Through the use of partnerships, a service can call a method from another service and return the state from that service. One service (e.g. DssService2) can use the Partner attribute to establish a relationship with another service (e.g. DssService1). In order to do so, a reference needs to be added to the DssService2 project.

When adding a reference to another service, you need to browse to the location of the proxy assembly and not the actual service assembly (see Figure 2-5). You may then add a .NET namespace alias to the DssService2 implementation class. For example, the following code is used to define an alias for DssService1:

using svc1 = Robotics.DssService1.Proxy;

Figure 2-5. The Add Reference dialog box ...

Get Programming Microsoft® Robotics Studio now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.