Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4589560
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:05:41+00:00 2026-05-21T22:05:41+00:00

I have a stock WCF Rest application (default Web.config, Web Routing). I am unable

  • 0

I have a stock WCF Rest application (default Web.config, Web Routing). I am unable to get the WCF framework to auto de-serialize the request stream into typed objects. I have a service with a method sig in the form…

[WebInvoke(Method = "POST", 
            UriTemplate = "", 
            BodyStyle = WebMessageBodyStyle.WrappedRequest, 
            ResponseFormat = WebMessageFormat.Json)]
MethodA(FirstParam first, SecondParam second)

If I initiate a request from fiddler or jQuery using $.ajax I get a 400 Bad Request error. I’ve done plenty of searching and found that changing the method sig to use a System.IO.Stream allows the method to be executed, however it also adds the overhead of de-serializing the objects.

The raw request body is as follows

{
    "first":"{\"p1\":\"p1 value\",\"p2\":\"p2 value\",\"p3\":100\"p4\":null}",
    "second":"{\"p1\":\"p1 value\"}"
}

Yeh the application doesn’t even break into the service itself unless the method has either a Stream, or no arguments. There is only 1 post method in this service, the other is a GET method which is working correctly.

I’ve used http://www.codeproject.com/KB/ajax/jQueryWCFRest.aspx as a reference implementation, but have been unable to get it to work on this solution.

Is there something that I’m missing here that hopefully someone else can see?

Leon

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T22:05:43+00:00Added an answer on May 21, 2026 at 10:05 pm

    Bleh… the problem turned out to be the way the request was serializing values!

    {
        "first":"{\"p1\":\"p1 value\",\"p2\":\"p2 value\",\"p3\":100\"p4\":null}",
        "second":"{\"p1\":\"p1 value\"}"
    }
    

    Should have been without the escaped quotes….

    {
        "first":"{"p1":"p1 value","p2":"p2 value","p3":100"p4":null}",
        "second":"{"p1":"p1 value"}"
    }
    

    The reason this was happening was JSON.stringify was being called not only on the wrapped request parameters, but on each parameter as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a REStful WCF web service (using a substantially modified WCF Rest Starter
I have a WCF Web Service that accepts a JSON-Formatted request. I have a
I have a company name and i want to get the stock symbol of
I have developed a sample WCF REST service that accepts that creates an Order
Let's say that I have specified the following WCF REST Service at the address
While I'm making SOAP or REST invocations to WCF, I'd like to have the
We're in the process of developing a WCF REST web service which just receives
I have a problem when sending Entity Framework-generated entities with navigation properties over WCF.
I have developed a small WCF service which handles HTTP request. I want to
I am developing a large-ish application in WPF/WCF/NHibernate/etc. and have implemented the MVP pattern

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.