Working with the Response

After a successful request, you can then use the information returned in the web service response.

You can verify that the request was successful by checking for the ResponseStatus block in each response. If the response inclueds a ResponseStatus with Success in the Response element, the request succeeded. However, if instead of a ResponseStatus block an Error element is returned, it will also include an error message indicating why the request failed. You can start troubleshooting the error in the request by viewing the errors returned in the response.

Here's the code snippet from our example that does this.

Finally, we can add code to delete the message so that it is not retrieved again. Here's the code snippet from our example that does this.