Best practices
Best practices with web services are a bit difficult. While the protocols and formats are pretty simple, there are endless variations in implementations. Also, to be honest, implementing a good web service is pretty difficult, as it typically needs to deal with all the internal issues and implementation details of the underlying system.
As if that wasn't enough, there's a whole world in between. Slow networks, dropped VPN connections, and errors in all sorts of network components. But, some practices make life a bit easier.
Validate incoming data
Do never trust incoming data!
When receiving data, make sure that any data, text, or number is within the agreed boundaries: the text is not too long, a birthdate is in the future, or the amount of an invoice is negative. Anything that could be wrong, will be wrong!
Create an expression rule that takes the data, validates each field, and returns a map like this:
a!map( valid: false, &...