Processor 'JsonNetProcessor' expected '0' argument values but received '1' values

Topics: Web Api
Feb 15, 2011 at 8:10 AM

Hi ,

I have created  method with this signature and attribute:

[WebInvoke(Method = "POST", UriTemplate = "groups/{groupID}/users/{userID}")]
        public void AssignUserToGroup(string groupID, string userID)

when I call this method I get an exception:

Processor 'JsonNetProcessor' expected '0' argument values but received '1' values.

on this line:

 Debug.Assert(outArgCount == output.Length, "SetProcessorOutput -- array length does not match output value count");

in this class: PipelineContext

I am also get the same exception on this method signature.

All the other mehods works fine!

Can someone tell me what am I doing wrong?


Thanks in advanced ,



Feb 15, 2011 at 3:41 PM

Hi Alon,

I have tested this on the WCF HTTP Contrib project using the JsonNetProcessor, and making a request with text/json, and it worked just fine. Here's my test using the WCF HTTP Contrib project:

        [WebGet(UriTemplate = "{id}/{name}")]
        public void Get(string id, string name, HttpResponseMessage response)
            var contact = this.repository.Get(int.Parse(id, CultureInfo.InvariantCulture));
            if (contact == null)
                response.StatusCode = HttpStatusCode.NotFound;
                response.Content = new StringContent("Contact not found");

            //return contact;

What other Processors do you have?

Feb 20, 2011 at 6:50 AM

Thanks for your response machadogj,

Test it on "POST" method,It works fine on "GET".