supermatchgame
Programmer
I am designing a 'connector' as an interface between the user and a database. The connector is a web service with a series of operations based on solicit / response.
Some of the operations return data in XML format - i.e. one of them can be passed a series of integers to produce reports from the database. The XML output will subscribe to a common schema.
I'm wondering how best to handle errors in my operations. These errors could either be user generated - they haven't sent a valid input parameter - or system generated (i.e. lost connection to database). I like the idea of being able to return a series of messages that tell the person who is consuming the web service exactly what is going on. But this message will be based on a different schema to the data that is returned.
So my question is: what's the best way to design this. Should I expect that the consumer will be OK with potentially receiving two different message types depending on how the operation went? Should I build the message into an attribute of the data schema so I can just return an empty XML document with a header attribute set to 'Error - invalid input parameter' or something like that. Or should I just force the consumer to handle a SOAP error message and not give them any help? After all if I have documented the operations and clearly stated that 9 is not a valid input then it's not my fault, right?
Does anyone with industry experience have any insights? I'd be really grateful for some input because I'm tying myself in knots here.
Some of the operations return data in XML format - i.e. one of them can be passed a series of integers to produce reports from the database. The XML output will subscribe to a common schema.
I'm wondering how best to handle errors in my operations. These errors could either be user generated - they haven't sent a valid input parameter - or system generated (i.e. lost connection to database). I like the idea of being able to return a series of messages that tell the person who is consuming the web service exactly what is going on. But this message will be based on a different schema to the data that is returned.
So my question is: what's the best way to design this. Should I expect that the consumer will be OK with potentially receiving two different message types depending on how the operation went? Should I build the message into an attribute of the data schema so I can just return an empty XML document with a header attribute set to 'Error - invalid input parameter' or something like that. Or should I just force the consumer to handle a SOAP error message and not give them any help? After all if I have documented the operations and clearly stated that 9 is not a valid input then it's not my fault, right?
Does anyone with industry experience have any insights? I'd be really grateful for some input because I'm tying myself in knots here.