c# - How to change wcf response type based on parameter? -
my wcf service request looks below:
- ../myservice.svc/search?q=keywords&op=xml
- ../myservice.svc/search?q=keywords&op=json
so based on param op, response type should change. how accomplish this?
here have complex article setting response in different formats. if using wcf 4 think setting automaticformatselectionenabled="true" in webhttpbehavior
. automatically choose response format (xml or json) based on client's http accept header.
Comments
Post a Comment