title: ASP.NET Web API, Complex Parameters, Calling from .NET
body: <p>I am trying to port some existing WCF code to Web API. The code acts as an interface for <a href="http://technet.microsoft.com/en-us/library/bb725998%28v=SQL.105%29.aspx" rel="nofollow">ADO.NET Sync Services</a> and consists of the following method signatures...</p>
  
  <pre><code>[OperationContract]
  SyncContext ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession);
  
  [OperationContract]
  SyncContext GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession);
  
  [OperationContract]
  SyncSchema GetSchema(string[] tableNames, SyncSession syncSession);
  
  [OperationContract]
  SyncServerInfo GetServerInfo(SyncSession syncSession);
  </code></pre>
  
  <p>I then want to be able to call these methods from other .NET client applications, some of which will be on Compact Framework!</p>
  
  <p>I have seen lots of suggestions and examples around the web as to the use of JObject, custom model bindings (with an encapsulating object) and even FormDataCollection - but all of these examples have JavaScript clients and I cannot then see how I might code a .NET client in such a way as to be able to pass all of the parameters correctly and also get back the results I am looking for (for example, are these PUT/POST as I am passing parameters as input, or GET as I am expecting content in the result)?</p>
  
  <p>Can anybody offer any assistance here? </p>
  
  <p>I have yet to determine how I name the methods in such a way as they can be called (I have found the ActionName attribute and the Http* attributes along with a custom routing example that allows the action name to be passed as a part of the URL but again I cannot really see how these map correctly to the HttpClient Get/Put/Post/Delete methods and of course the HttpClient is not - as far as I know - available on Compact Framework).</p>