Generate sample data for WCF REST services?

justJad

New Member
Is there some way to generate sample XML/JSON based on a WCF REST interface? Most of the time the devices that consume our web services deserialize the message into it's relevant object. However some times that is not possible and as such I need to send developers the actual XML/JSON that they need to give to the services and what the output looks like. Is there an easy way to generate this information, even if it it uses the datatypes default values?An example of a webservice interface:\[code\] [OperationContract] [WebGet(UriTemplate = "Test", ResponseFormat = WebMessageFormat.Xml)] ResultOfAction Test(); // used to login [OperationContract] [WebInvoke(UriTemplate = "Login?", Method = "POST", ResponseFormat = WebMessageFormat.Xml, RequestFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare)] ResultOfAction Login(LoginRequest request); // register a client + forgot password [OperationContract] [WebInvoke(UriTemplate = "RequestOTP?", Method = "POST", ResponseFormat = WebMessageFormat.Xml, RequestFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare)] ResultOfAction RequestOTP(RequestOneTimePIN requestOneTimePin);\[/code\]In the example above, I would need to see the ResultOfAction, LoginRequest and RequestOneTimePIN serialzed XML. Is there a simple way of generating such info?
 
Back
Top