Handling Faults

If a sender requests a response, then one will be sent regardless of whether the operation was successful or not. Therefore, whenever an operation includes a response port, you should include the World Wide Web Consortium (W3C) SOAP fault body with the port set for that message. For example, the fault body is included in this Get operation, which was included in Service Tutorial 2:

public Get(Microsoft.Dss.ServiceModel.Dssp.GetRequestType body,
         Microsoft.Ccr.Core.PortSet<ServiceTutorial2State,W3C.Soap.Fault>
         responsePort) : base(body, responsePort)
{
}

DSSP provides a set of fault codes (see Table 2-6 for a list of DSSP fault codes) that can be used to check for specific conditions. For example, when performing an insert, you could ...

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.