WCF errors and handling records

Source: Internet
Author: User

1. error message: {"HTTP cannot register URL http: // +/Temporary_Listen_Addresses/a4db1461-55c6-4ce5-be25-f41b88877434/because another application is using TCP port 80. "}

Environment: When duplex protocols are used. Call the callback method of the client.

Solution: first, change the service of port 80 of the client to another port.

The second is to set the ClientBaseAddress in the client code,

The Code is as follows:

Code

DumplexService. IDuplexSampleCallback clent = new ClientCallback ();

DumplexService. DuplexSampleClient duplexClient = new WebTest. DumplexService. DuplexSampleClient (new System. ServiceModel. InstanceContext (clent ));

WSDualHttpBinding ws = (WSDualHttpBinding) duplexClient. Endpoint. Binding;
Ws. ClientBaseAddress = new Uri ("http: // localhost: 8212 /");

Third, set in the configuration file

Code

<WsDualHttpBinding>
<Binding name = "MyWCFStudy. MyDuplexSet" clientBaseAddress = http: // localhost: 8212/>
<Security mode = "Message"> </security>
</Binding>
</WsDualHttpBinding>

2. error message: this operation deadlocks because a reply cannot be received before the current email is processed. If you want to allow unordered message processing, you can specify multiple concurrencymodes on ServiceBehaviorAttribute.

Production Environment: Duplex protocol.

Solution: Specify the ConcurrencyMode of ServiceBehaviorAttribute as Multiple in the service-side implementation contract class.

Add [ServiceBehavior (ConcurrencyMode = ConcurrencyMode. Multiple)] to the class name.

 

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.