Generating SOAP Faults
We discussed a few of the positive scenarios associated with the GuestManagementService
of our sample hotel reservation system. Our discussion on soapUI requests and responses cannot be concluded until we explore the failure scenarios related to the web service. What will happen if we try to add an existing guest to the system? We have implemented our service implementation class to handle these types of scenarios such that the service responds with a fault in case of a failure.
We will look into a possible failure case where an existing guest is going to be added to the system.
In a preceding example, where we added the guest called Saman, submit the same request again. As the guest has already been added to the system, the GuestManagementService
should respond back with a fault. (Look at how we handled the fault in the Web services fault handling section of Chapter 2, The Sample Project) Note that we implemented our sample service in a way so that it throws an error...