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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:06:15+00:00 2026-06-04T08:06:15+00:00

I experience this issue: I have a WCF service, that exposes this operation contract:

  • 0

I experience this issue:

I have a WCF service, that exposes this operation contract:

[OperationContract]
void Index(int[] song, string fileName);

On my client, I have:

AudioDetectionServiceReference.AudioDetectionServiceClient client = new AudioDetectionServiceReference.AudioDetectionServiceClient();
client.Index(max.ToArray(), mp3Files[i]);

Where max is an array of 2000 int values, and mp3Files[i] is a string of 200 chars.

Web.config has this:

<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <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 app.config has:

    <configuration>
        <system.serviceModel>

            <bindings>
                <basicHttpBinding>
                    <binding name="BasicHttpBinding_IAudioDetectionService" closeTimeout="00:01:00"
                        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                        allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                        maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                        messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                        useDefaultWebProxy="true">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                        <security mode="None">
                            <transport clientCredentialType="None" proxyCredentialType="None"
                                realm="" />
                            <message clientCredentialType="UserName" algorithmSuite="Default" />
                        </security>
                    </binding>
                </basicHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://localhost:15863/AudioDetectionService.svc"
                    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAudioDetectionService"
                    contract="AudioDetectionServiceReference.IAudioDetectionService"
                    name="BasicHttpBinding_IAudioDetectionService" />
            </client>
        </system.serviceModel>
    <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

Now comes the tricky part:

When you right click on service reference, go to configure service reference, there is an option called Collection type. If I set the collection type to “Syste.Array” I get the error

The remote server returned an unexpected response: (400) Bad Request.

With the stack trace:

    Server stack trace: 
       at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding)
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at SqlTest.AudioDetectionServiceReference.IAudioDetectionService.Index(Int32[] song, String fileName)
       at SqlTest.AudioDetectionServiceReference.AudioDetectionServiceClient.Index(Int32[] song, String fileName) in blablabla\Service References\AudioDetectionServiceReference\Reference.cs:line 53
       at SqlTest.Program.Main(String[] args) in blablabla\Program.cs:line 46

When I change it to “System.Collection.Generic.List”, the error magically disappears.

My question is : WHY?

Second question:

Why does this work?

client.Index(max.Take(100).ToArray(), mp3Files[i]);

using the same context (app.config, web.config, and the same code as above, with the System.Array selected).

Thanks,
Andrei Neagu

PS: I post this because I spent 2 days on trying to change settings for bindings, change the message size, change values from readerQuotas and other stuff, when all I had to do what this stupid selection. So I am quite pissed and I wanna at least learn something from this.

  • 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-04T08:06:17+00:00Added an answer on June 4, 2026 at 8:06 am

    After some more digging, this is what I changed:

    app.config

    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_IAudioDetectionService" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                maxBufferSize="655360" maxBufferPoolSize="5242880" maxReceivedMessageSize="655360"
                messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                useDefaultWebProxy="true">
                <readerQuotas maxDepth="320" maxStringContentLength="81920" maxArrayLength="163840"
                    maxBytesPerRead="40960" maxNameTableCharCount="163840" />
                <security mode="None">
                    <transport clientCredentialType="None" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://localhost:15863/AudioDetectionService.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAudioDetectionService"
            contract="AudioDetectionServiceReference.IAudioDetectionService"
            name="BasicHttpBinding_IAudioDetectionService" />
    </client>
    

    and for the server, look at the fact that there is no name for the basicHttpBinding section. I think that if this section has a name, the default service generated by WCF will ignore it.

    <bindings>
      <basicHttpBinding>
        <binding closeTimeout="00:01:00"
            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
            allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
            maxBufferSize="655360" maxBufferPoolSize="5242880" maxReceivedMessageSize="655360"
            messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
            useDefaultWebProxy="true">
          <readerQuotas maxDepth="320" maxStringContentLength="81920" maxArrayLength="163840"
              maxBytesPerRead="40960" maxNameTableCharCount="163840" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
                realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    

    And for the other values, I added an 0 at the end (multiplied by 10). Increasing them I think will let you transfer event more. But the most important, the basicHttpBinding has no name. If it had a name, I think it was ignored.

    I will not set this as answered, because the question was why System.Array throws exception and System.Generic.List does not.

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

Sidebar

Related Questions

Not sure if anyone has experience this issue. I have a TextBox that I
We have a WCF service that uses Entity Framework to query a SQL database.
I would like to know if you have any experience on this issue.
Anyone have experience with this plugin? I have it installed but I have no
anyone have experience doing this? when i say imaginary i mean the square root
Does anyone have any experience with this sort of thing? I'm talking about applets
I have plenty of experience with this in PHP, but am fairly new to
Debugging experience http://www.dmhermitage.org/wtfborders.png This is making me want to kill myself. I have some
Do any have any experience how this cold be done, if you look at
NOTE: If you experience this issue as well, please upvote it on Apache JIRA:

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.