WCF faults with SOAP -
I'm in doubt about how I should return a customer using SOAP to return errors.
I have WCF service, but I am not sure whether the technology is using the customer, so I want to persist on SOAP specification.
As far as I've read, the error messages seem to be the best way to handle this.
I can see that my service has many different possible faults:
< Ul>Is It For Each One? It would be appropriate to create an object such as: Defect and throw such:
fault failure & lt; null & gt; (NF); FaultException & LT; InvalidDataFault> (IDF); FaultException & LT; ArguementFault> FaultException & LT; RangeFault & gt; (RF); Many objects with many objects in the client have practically every method (i.e .: customer, Order, etc.).
Is it a proper way to handle errors and send it back to the client?
It seems That method is to add each fault in the above characteristics. [FaultContract] [FaultContract (typeF (InvalidDataFault)]] [FaultContract (typeof (ArguementFault)] [] [/ s] FaultContract (typeof (RangeFault)] Zero CreateCustomer (customer client);
Besides, what about genericfault? How do you manage business rule errors? That is: the customer already exists, many line items do not ship in that area, payment method is not accepted, etc.?
Please tell me whether this method is appropriate or if there is any other approved solution and how you handle the 'business rules' situation
Returning a defect is the right way to do this in general, but you should also ask yourself what client program is going to mistake you with back information If the customer only needs to know that there is a mess If you have only one mistake That error message text that the customer can display the user.
Whether the customer needs to perform different actions on the basis of a NullFault or a RangeFault, then that's when you need different flaws. But if there is no difference between one and the other, then save yourself and the client program with some time and effort and define only one mistake.
Comments
Post a Comment