In WCF, The remote server returned an unexpected response: (400) Bad Request is displayed.

Source: Internet
Author: User

Server Configuration

<Bindings>

<WsDualHttpBinding>
<Binding name = "SubscribeBindingConfig" receiveTimeout = "23:59:59" messageEncoding = "Text"
BypassProxyOnLocal = "true" usedefawebwebproxy = "false" maxBufferPoolSize = "4000000" maxcompute edmessagesize = "4000000">
<ReliableSession inactivityTimeout = "23:59:59"/>
<ReaderQuotas maxDepth = "64" maxStringContentLength = "16384" maxArrayLength = "16384"
MaxBytesPerRead = "8192" maxNameTableCharCount = "16384"/>
</Binding>
</WsDualHttpBinding>

</Bindings>

 

Client Configuration:

<Bindings>
<BasicHttpBinding>
<Binding name = "BasicHttpBinding_IPublishService" closeTimeout = "00:01:00"
OpenTimeout = "00:01:00" receiveTimeout = "00:10:00" sendTimeout = "00:01:00"
AllowCookies = "false" bypassProxyOnLocal = "true" usedefawebwebproxy = "false" hostNameComparisonMode = "StrongWildcard"
MaxBufferSize = "171072" maxBufferPoolSize = "1524288" maxcompute edmessagesize = "171072"
MessageEncoding = "Text" textEncoding = "UTF-8" transferMode = "Buffered">
<ReaderQuotas maxDepth = "64" maxStringContentLength = "16384" maxArrayLength = "16384"
MaxBytesPerRead = "8192" 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: 8734/Design_Time_Addresses/MessageBroker. Framework/PublishService /"
Binding = "basicHttpBinding" bindingConfiguration = "BasicHttpBinding_IPublishService"
Contract = "IPublishService" name = "BasicHttpBinding_IPublishService"/>

</Client>

 

Client code:

PublishServiceClient client = new PublishServiceClient ();

MessageDoc doc = new MessageDoc ();
Doc. SendSubject = TxSubject. Text. Trim ();
Doc. Add ("MachineName", Environment. MachineName );
..............

Client. Send (doc );

 

If The added data volume is large, Send reports The remote server returned an unexpected response: (400) Bad Request.

I don't know why, and the various binding parameters have been changed, it doesn't help.

Please help!

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.