Handle a response received within a <call> element.
<call name="Call" target="MyApp.MyOperation" async="1"> <request type="MyApp.Request"> ... </request> <response type="MyApp.Response"> ... </response> </call>
|Attribute or Element||Description||Value|
|type attribute||Required. The name of the response message class.||A string of one or more characters.|
|name attribute||Optional. The name of the <response> element.||A string of 0 to 255 characters.|
|Other elements||Optional. <response> may contain zero or more of the following elements in any combination: <assign>, <empty>, <milestone>, or <trace>.|
A <response> element is an optional child element of <call>. Inside the <call> context, the <response> element specifies the type (class name) of the response to return from the call. The <response> element can also contain one or more <assign> elements. For example:
<call name="FindSalary" target="MyApp.PayrollApp" async="1"> <request type="MyApp.SalaryRequest"> <assign property="callrequest.Name" value="request.Name" /> <assign property="callrequest.SSN" value="request.SSN" /> </request> <response type="MyApp.SalaryResponse"> <assign property="context.Salary" value="callresponse.Salary" /> </response> </call>
When a call returns a response to the calling business process, any output parameters from the message type named in the <response> element become properties of the callresponse object in the business process execution context. Since callresponse only has meaning inside the <response> element, to preserve these values the <response> element must provide <assign> elements that assign callresponse values to properties of other, more permanent objects in the business process execution context, usually context or response.
While a <request> element is required inside every <call>, a <response> is not. If the <response> element is omitted from a <call> element, no response is returned from the <call>, even if the <request> type is designed to return a response. When the <request> is asynchronous, the <assign> elements within the body of the <response> element are executed only after the call response is received. There is no guarantee when this will occur, so a business process will typically use the <sync> element to wait for an asynchronous response.
If a response is not received within the timeout period specified by the <sync> element, then the assignments defined by the corresponding <response> block will not be executed. The response itself will be marked with a status of Discarded.