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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:21:50+00:00 2026-05-16T17:21:50+00:00

Hi i finally created a small upload wcf service. I can transfer small images

  • 0

Hi i finally created a small upload wcf service. I can transfer small images on my computer, but i tried transferring a mp3 song to have some larger data. It failede with a “400 bad request” exception. I have no clue as to what is going on. I am streaming the data and found alot of resources on the net, but none seem to work, this is what i have as the services web.config:

 <?xml version="1.0"?>
<configuration>

  <system.web>
    <httpRuntime maxRequestLength="67108864"/>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transferMode="Streamed" messageEncoding="Mtom" maxBufferSize="65536" maxReceivedMessageSize="67108864">
          <readerQuotas maxDepth="2000000" maxStringContentLength="2000000" maxArrayLength="2000000" maxBytesPerRead="2000000" maxNameTableCharCount="2000000" />
        </binding>
        <!--<binding name="ExampleBinding" transferMode="Streamed" messageEncoding="Mtom" />-->
      </basicHttpBinding>

    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>

And this is my clients app.config.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IMediaServer" closeTimeout="00:10:00"
                    openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Streamed"
                    useDefaultWebProxy="true">
                  <readerQuotas maxDepth="2000000" maxStringContentLength="2000000" maxArrayLength="2000000" maxBytesPerRead="2000000" maxNameTableCharCount="2000000" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:49689/MediaServer.svc" binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_IMediaServer" contract="mediaServer.IMediaServer"
                name="BasicHttpBinding_IMediaServer" />
        </client>
    </system.serviceModel>
</configuration>

As far as i can see i should be able to receive at least 64Mb of data, and the data i try to transfer is around 4Mb. Can anyone point me in the right direction as to what the error is in my configuration (at least i suspect that the error is in my configuration)

EDIT
These are my contracts:

[ServiceContract]
    public interface IMediaServer
    {

        [OperationContract]
        void UploadData(UploadFile data);
    }

[MessageContract]
    public class UploadFile
    {
        public UploadFile() { }

        [MessageHeader]
        public string FileName { get; set; }

        [MessageHeader]
        public string Type { get; set; }

        [MessageHeader]
        public string AccountName { get; set; }

        [MessageBodyMember]
        public Stream data { get; set; }
    }
  • 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-16T17:21:51+00:00Added an answer on May 16, 2026 at 5:21 pm

    Your client is not configured to use Streaming. Change transfer mode in client configuration to Streamed. Also in your service configuration try to delete binding name. At the moment you are using default endpoint endpoint which uses default binding configuration = configuration without name.

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

Sidebar

Related Questions

I created a very small web app. I want to use clean urls but
I have created a simple WCF service to prototype file uploading. The service: [ServiceContract]
Finally i tried to draw a line using OpenGL ES framework in XCode 4.2
Finally deployed my ruby on rails 3.2 app but when trying to open it
Finally figured it out thanks to One Mad Monkey, but forgot quotes on my
I finally figured out how to implement pg_search's multisearch feature. But I'm having trouble
I'm developing a small IDE, and I'm wondering where I can find a set
I am working on a small project and I have created a helper function
i create a small wcf apps when i am testing this apps in my
Very weird problem, I finally managed to distill it into a small piece of

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.