<p>I'm tryint to post to a ADO.NET Data Service but the parameters seems to get lost along the way.</p>

<p>I got something like:</p>

<pre><code>[WebInvoke(Method="POST")]
public int MyMethod(int foo, string bar) {...}
</code></pre>

<p>and I make an ajax-call using prototype.js as:</p>

<pre><code>var args = {foo: 4, bar: "'test'"};
new Ajax.Requst(baseurl + 'MyMethod',
  method: 'POST',
  parameters: args,
  onSuccess: jadda,
  onFailure: jidda
}
</code></pre>

<p>If I replace "method: 'POST'" with "method: 'GET'" and "WebInvoke(Method="POST")" with "WebGet" everything works but now (using post) all I get is:</p>

<blockquote>
  <p>Bad Request - Error in query syntax.</p>
</blockquote>

<p>from the service.</p>

<p>The only fix (that I don't want to use) is to send all parameters in the URL even when I perform a post. Any ideas are welcome. </p>

If you want to use POST, you need to specify the parameters to be wrapped in the request in WebInvoke attribute unless the parameters contains on object (e.g. message contract). This makes sense since there is no way to serialize the parameters without wrapped in either json or xml.
Unwrapped which is not XML indeed as missing root element
```
```
<foo>1</foo>
<bar>abc</bar>
```
```
Wrapped, valid XML
```
```
<Request>
   <foo>1</foo>
   <bar>abc</bar>
</Request>
```
```
This sample also applies to JSON