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

  • Home
  • SEARCH
  • 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

Let's say that I have specified the following WCF REST Service at the address
I have a C# WCF REST Service which allows the addition of a bookmark,
While I'm making SOAP or REST invocations to WCF, I'd like to have the
I have a PHP-driven site that includes an XML stock feed, which is remotely
Is it possible (by using the stock c# TreeView) to have Multiline TreeNodes? Also,
Now I have a stack of free time on my hands, I wanna get
The rails books and web pages I've been following have all stuck to very
We have a .NET application which our customers consider too large for mass deployment
Is there a clean way to expose a WCF REST service that requires basic
I need to design a real-time product stock management engine (C# & WCF) but

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.