简体   繁体   中英

What are the best practices on processing HTTP responds from WCF RESTful service?

I am wondering how to process responds from WCF RESTful service in a right way. For example, service could throw new WebFaultException(HttpStatusCode.Unauthorized); . But how can I get a particular reason of this respond and process it on client? I know that I could use WebFaultException<T> and extend exception with some data describing details. But what if client is written in native C++ or php... The whole idea is to interact with the service from console application (could be written using a huge set of languages) via HTTP/HTTPS and query some data.

The output is available in two forms JSON and XML, and handling error would depend on how it is being structred in the response.

you make like to have a look at this .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM