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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:39:06+00:00 2026-05-20T10:39:06+00:00

I wrote some service that have method that get image ( byte[] ) as

  • 0

I wrote some service that have method that get image ( byte[] ) as parameter ( return void ).

I also wrote some client (client & server run on same machien – different sulotion – using IIS )that send the bitmap ( as byte[] ) to the service – and each time i try to send i get the exception:

An error occurred while receiving the HTTP response to http://localhost/WebService/Service.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down)

I added one more method that get void and return int – and i can call this method with no problem.

What can be wrong ? Do i need to define something speciel in the client service reference ?

The service method

[ServiceContract]
**public interface IService**
{
    [OperationContract]
    void GetPic( byte[] pic );
}

**public class Service : IService**
{
    public void GetPic( byte[] pic )
    {
          ...   
    }
 }

Web.config file:

 <system.serviceModel>
<services>
  <service behaviorConfiguration="ServiceBehavior" name="ServiceProxy.Service">

    <endpoint 
      name="basicHttp"
      address="" 
      binding="basicHttpBinding" 
      bindingConfiguration=""
      contract="Contracts.IService">
    </endpoint>

    <endpoint 
      address="mex" 
      binding="mexHttpBinding" 
      contract="IMetadataExchange" >
    </endpoint>

    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8731/ServiceProxy/" />
      </baseAddresses>
    </host>

  </service>
</services>

<behaviors>
  <serviceBehaviors>
    <behavior name="ServiceBehavior">
      <serviceMetadata httpGetEnabled="True"/>       
      <serviceDebug includeExceptionDetailInFaults="False" />
    </behavior>
  </serviceBehaviors>
</behaviors>

  • 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-20T10:39:07+00:00Added an answer on May 20, 2026 at 10:39 am

    You must configure your binding on server to accept large messages. By default it accepts only messages up to 65KB and arrays with 16k elements = in your case bitmap which has size less then 16KB.

    Use this in your web.config (server side):

    <bindings>
      <basicHttpBinding>
        <binding name="myBinding" maxReceivedMessageSize="1000000">
          <readerQuotas maxArrayLength="1000000" />
        </binding>
      </basicHttpBinding>
    </bindings>
    

    In your endpoint configuration reference this binding in bindingConfiguration attribute by setting it to myBinding.

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

Sidebar

Related Questions

I wrote a windows service using VB that read some legacy data from Visual
I have a Windows Forms application that I wrote that does some monitoring of
I wrote some code with a lot of recursion, that takes quite a bit
So I wrote some perl that would parse results returned from the Amazon Web
I recently wrote some javascript code that filled a drop down list based on
We wrote a small Windows class library that implements extension methods for some standard
We have some SQL server reporting services reports. I didn't write then but I
I wrote some CSS in my HTML code to create rollover buttons. Then i
Right now I'm developing mostly in C/C++, but I wrote some small utilities in
Some time ago I wrote a little piece of code to ask about on

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.