c# - How to change wcf response type based on parameter? -


my wcf service request looks below:

  1. ../myservice.svc/search?q=keywords&op=xml
  2. ../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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -