1. The example below shows a client that talks to a service using WebHttpBinding. The service does not generate a meaninful WSDL for endpoints with WebHttpBinding (WSDL is for SOAP-based endpoints only), so the client needs to get the contract from the server in an out-of-band way.
As far as passing complex objects go, if you're using POST requests, they should just work. It's not possible (nor a good REST practice) to pass complex objects in GET operations (*). You should be able to receive complex objects in either GET or POST operations without problems
(*) If you use JSON you can pass complex objects as parameters to WebGet operations, but you indicated that you didn't want to use JSON.
//WebHttpBinding issues - WebHttpBinding client
2. You can use enums in the URL template, as long as they're not used in one of the segments of the URL (i.e., they can be used as query string values). The WebHttpBinding doesn't support the TypeConverter feature. The example below shows the usage of an enum value in the template:
//WebHttpBinding issues - enums on GET
本文探讨了使用WebHttpBinding进行复杂对象传递的方法,并演示了如何在GET和POST操作中使用它。此外,还介绍了如何在URL模板中使用枚举。
246

被折叠的 条评论
为什么被折叠?



