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 9200647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:48:51+00:00 2026-06-17T22:48:51+00:00

I’m currently using WCF Data Services (well, ADO.Net Data Services) with Entity Framework and

  • 0

I’m currently using WCF Data Services (well, ADO.Net Data Services) with Entity Framework and am getting the following error when performing a POST (omitted / changed some irrelevant info):

<?xml version="1.0" encoding="utf-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code /><m:message xml:lang="en-GB">The URI 'http://localhost:56568/MyWcfDataServices.svc/EntitySetName(pk_id)' is not valid for POST operation. For POST operations, the URI must refer to a service operation or an entity set.</m:message></m:error>

Having a look around online, I can’t seem to find much information about this message so debugging it is a little difficult. It’s likely happening because one of the attributes I’m posting is a large base64 string (it works fine if I don’t post this). I’ve tried setting the maxRequestLength to the following:

<httpRuntime maxRequestLength="102400" />

But it doesn’t seem to have helped. While I’ll continue working through this, I thought I’d make a quick post on here to see if anyone knows something that may help.

My WCF Data Service class looks like this:

public class MyWcfDataServices: DataService<ContextName>
{
    public static void InitializeService(DataServiceConfiguration config)
    {
        // set entity access rules etc
    }
}

Thanks

EDIT: I don’t seem to be getting anywhere with this. Here’s what I’ve tried so far.

On the server side I’ve set the following bindings:

<system.serviceModel>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true" 
                             minFreeMemoryPercentageToActivateService="0" />
  <services>
    <service name="MyWcfDataServices" 
             behaviorConfiguration="myBehaviorConfig">
      <endpoint address=""
                binding="webHttpBinding"
                bindingConfiguration=""
                contract="System.Data.Services.IRequestHandler" />
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="myBehaviorConfig">
        <serviceMetadata httpGetEnabled="true"/>
        <serviceDebug includeExceptionDetailInFaults="true"/>
        <dataContractSerializer maxItemsInObjectGraph="2147483647" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>

Hoping that the maxItemsInObjectGraph attribute would be the solution. Do these bindings look correct? Am I missing some attribute that will let me POST more data to the server? Do I need to configure this service behavior on the client as well?

  • 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-06-17T22:48:52+00:00Added an answer on June 17, 2026 at 10:48 pm

    OK, here’s what I did to fix the problem. First I enabled tracing on the server by adding the following to my web.config:

    <system.diagnostics>
      <sources>
        <source name="System.ServiceModel"
                switchValue="Information, ActivityTracing"
                propagateActivity="true">
          <listeners>
            <add name="traceListener"
                type="System.Diagnostics.XmlWriterTraceListener"
                initializeData="c:\logs\Traces.svclog"  />
          </listeners>
        </source>
      </sources>
    </system.diagnostics>
    

    This gave me a lot more information about the issues, specifically in my case the max request length was still 65536, which indicated my bindings weren’t being picked up. This was down to two things, first the name part of my service configuration wasn’t correct – it needed to include the namespace information. I ended up with this (I had to put this in the client’s web.config too):

    <services>
      <service name="Solution.Project.MyWcfDataServices">
        <endpoint address=""
                  binding="webHttpBinding"
                  bindingConfiguration="webHttpConfig"
                  contract="System.Data.Services.IRequestHandler" />
      </service>
    </services>
    <bindings>
      <webHttpBinding>
        <binding name="webHttpConfig" 
                  allowCookies="true"
                  maxReceivedMessageSize="20000000"
                  maxBufferSize="20000000"
                  maxBufferPoolSize="20000000">
          <readerQuotas maxDepth="32"
                        maxArrayLength="200000000"
                        maxStringContentLength="200000000" />
        </binding>
      </webHttpBinding>
    </bindings>
    

    Finally, I had to change factory in the markup of my .svc file from the template generated System.Data.Services assembly to Microsoft’s ODATA assembly (which contains System.Data.Services namespaces too) System.Data.Services.DataServiceHostFactory, Microsoft.Data.Services, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.

    I’ve less hair now than when I started, but that’s the price you pay I suppose.

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

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am using jsonparser to parse data and images obtained from json response. When
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am using JSon response to parse title,date content and thumbnail images and place
I want use html5's new tag to play a wav file (currently only supported
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.