Bug 13702 - RESTful self-hosted json deserialize bug
Summary: RESTful self-hosted json deserialize bug
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies ()
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-08-02 03:07 UTC by AlexZ
Modified: 2013-08-02 03:07 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 13702 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description AlexZ 2013-08-02 03:07:42 UTC
I met 2 bugs while porting my tested programme from .NET to MONO, but it just showed up.

First one is, My service is using webHttpBinding and serialize/deserialize in json, when pass it multiple parameters, it throw below
Exception 'Element' is an invalid node type.  Line 1, position 54.   at System.Xml.XmlReader.ReadEndElement () [0x00000] in <filename unknown>:0 
  at System.ServiceModel.Dispatcher.WebMessageFormatter.DeserializeObject (System.Runtime.Serialization.XmlObjectSerializer serializer, System.ServiceModel.Channels.Message message, System.ServiceModel.Description.MessageDescription md, Boolean isWrapped, WebContentFormat fmt) [0x00000] in <filename unknown>:0 
Second is if try to post it invalid post format(say, missing Content-Type in request header, or invalid json format),
program will force shutdown instead of throw an exception.

Please help! THANK YOU!


Fiddler Post

User-Agent: Fiddler
Content-Length: 36
Content-Type: application/json


        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
        string Echo(string name, string say);

<?xml version="1.0"?>
      <service name="Contracts.MyService" behaviorConfiguration="MEXBehavior">
        <endpoint address="" binding="webHttpBinding" contract="Contracts.IMyService" behaviorConfiguration="MyRestBehavior" /> 
            <add baseAddress=""/>

        <behavior name="MyRestBehavior">
          <webHttp />
        <behavior name="MEXBehavior">
          <serviceDebug includeExceptionDetailInFaults="true"/>


    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup></configuration>