How to write a web service c