Abstracting and enforcing web service protocols