Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. WCF and WF
  4. wcf and (400) Bad Request

wcf and (400) Bad Request

Scheduled Pinned Locked Moved WCF and WF
wcfcsharpwpfsysadminhelp
7 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    students552 university
    wrote on last edited by
    #1

    hi When i sent a large mount of data using wcf i got the error " The remote server returned an unexpected response: (400) Bad Request " the configuration in server side is as follows: <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_Services" closeTimeout="00:01:00" openTimeout="00:01:00" maxBufferPoolSize="2147483647" sendTimeout="00:01:00" receiveTimeout="00:10:00" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" messageEncoding="Text"> </binding> </basicHttpBinding> </bindings> <services> <service behaviorConfiguration="Services.Service1Behavior" name="Services.Services"> <endpoint address="" binding="basicHttpBinding" contract="Services.IServices"> <identity> <dns value="" /> </identity> </endpoint> <endpoint address="mex" binding="basicHttpBinding" contract="IMetadataExchange" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name="Services.Service1Behavior"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> and the client side is as follows: <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IERPServices" closeTimeout="00:01:00" openTimeout="00:01:00" maxBufferPoolSize="2147483647" sendTimeout="00:01:00" receiveTimeout="00:10:00" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" messageEncoding="Text"> </binding> </basicHttpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="LargeQuotaBehavior"> </behavior> </endpointBehaviors> </behaviors> <client> <endpoint address=" http://localhost:3990/Services.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IServices" contract="ServiceReference1.IServices" name="BasicHttpBinding_IServices" /> </client> </system.serviceModel> i followed man

    RaviBeeR 1 Reply Last reply
    0
    • S students552 university

      hi When i sent a large mount of data using wcf i got the error " The remote server returned an unexpected response: (400) Bad Request " the configuration in server side is as follows: <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_Services" closeTimeout="00:01:00" openTimeout="00:01:00" maxBufferPoolSize="2147483647" sendTimeout="00:01:00" receiveTimeout="00:10:00" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" messageEncoding="Text"> </binding> </basicHttpBinding> </bindings> <services> <service behaviorConfiguration="Services.Service1Behavior" name="Services.Services"> <endpoint address="" binding="basicHttpBinding" contract="Services.IServices"> <identity> <dns value="" /> </identity> </endpoint> <endpoint address="mex" binding="basicHttpBinding" contract="IMetadataExchange" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name="Services.Service1Behavior"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> and the client side is as follows: <system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IERPServices" closeTimeout="00:01:00" openTimeout="00:01:00" maxBufferPoolSize="2147483647" sendTimeout="00:01:00" receiveTimeout="00:10:00" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" messageEncoding="Text"> </binding> </basicHttpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="LargeQuotaBehavior"> </behavior> </endpointBehaviors> </behaviors> <client> <endpoint address=" http://localhost:3990/Services.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IServices" contract="ServiceReference1.IServices" name="BasicHttpBinding_IServices" /> </client> </system.serviceModel> i followed man

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      Try adding this element to the basicHttpBinding element in the server's config:

      <readerQuotas maxArrayLength="2147483647"
      maxBytesPerRead="2147483647"
      maxStringContentLength="2147483647"/>

      You may also want to chunk your data rather than sending it across the wire in one swell foop. /ravi

      My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

      S 1 Reply Last reply
      0
      • RaviBeeR RaviBee

        Try adding this element to the basicHttpBinding element in the server's config:

        <readerQuotas maxArrayLength="2147483647"
        maxBytesPerRead="2147483647"
        maxStringContentLength="2147483647"/>

        You may also want to chunk your data rather than sending it across the wire in one swell foop. /ravi

        My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

        S Offline
        S Offline
        students552 university
        wrote on last edited by
        #3

        hi I found the solution : Change endopoints from: <endpoint address="" binding="basicHttpBinding" contract="Services.IServices"> to: <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Services" contract="Services.IServices">

        U P S 3 Replies Last reply
        0
        • S students552 university

          hi I found the solution : Change endopoints from: <endpoint address="" binding="basicHttpBinding" contract="Services.IServices"> to: <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Services" contract="Services.IServices">

          U Offline
          U Offline
          User 1544830
          wrote on last edited by
          #4

          This solution is working. Thank You

          M 1 Reply Last reply
          0
          • U User 1544830

            This solution is working. Thank You

            M Offline
            M Offline
            Member 2321293
            wrote on last edited by
            #5

            hi, i am facing a same problem can you send me a sample of ur server's config file and also the client's config file? i am using "basicHttp" is this course the problem? thank you

            1 Reply Last reply
            0
            • S students552 university

              hi I found the solution : Change endopoints from: <endpoint address="" binding="basicHttpBinding" contract="Services.IServices"> to: <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Services" contract="Services.IServices">

              P Offline
              P Offline
              priya_kandaswamy
              wrote on last edited by
              #6

              Thank you. This solution helped me a lot..

              1 Reply Last reply
              0
              • S students552 university

                hi I found the solution : Change endopoints from: <endpoint address="" binding="basicHttpBinding" contract="Services.IServices"> to: <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Services" contract="Services.IServices">

                S Offline
                S Offline
                sebichondo
                wrote on last edited by
                #7

                Thanks the bindingConfiguration section saved me hours of debugging!!

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups