About Me

My photo
Northglenn, Colorado, United States
I'm primarily a BI Developer on the Microsoft stack. I do sometimes touch upon other Microsoft stacks ( web development, application development, and sql server development).

Tuesday, March 04, 2008

WCF Error: HTTP could not register URL http://+:80/Temporary_Listen_Addresses// because TCP port 80 is being used by another application

So I was doing a dual http binding (WSDualHttpBinding) [page 53-54 in Essential Windows Communication Foundation For .Net Framework 3.5] when I got the error above. I doubled checked by running the svcutil and the wizard, but with no luck.

 

Found the solution at(http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2782499&SiteID=1)

 

Just need to include the clientBaseAddress attribute with a URI in the binding tag, since the default is using port 80.

 

<?xml version="1.0" encoding="utf-8"?>

<configuration>

   <system.serviceModel>

      <bindings>

         <wsDualHttpBinding>

               <binding   name="WSDualHttpBinding_IServerStock"

                        closeTimeout="00:01:00"

                        openTimeout="00:01:00"

                        receiveTimeout="00:10:00"

                        sendTimeout="00:01:00"

                        bypassProxyOnLocal="false"

                        transactionFlow="false"

                        hostNameComparisonMode="StrongWildcard"

                        maxBufferPoolSize="524288"

                        maxReceivedMessageSize="65536"

                        messageEncoding="Text"

                        textEncoding="utf-8"

                        useDefaultWebProxy="true"

                        clientBaseAddress="http://localhost:8001/WCFDuplexService">

               <readerQuotas   maxDepth="32"

                           maxStringContentLength="8192"

                           maxArrayLength="16384"

                           maxBytesPerRead="4096"

                           maxNameTableCharCount="16384" />

               <reliableSession   ordered="true"

                              inactivityTimeout="00:10:00" />

               <security   mode="Message">

                  <message   clientCredentialType="Windows"

                           negotiateServiceCredential="true"

                           algorithmSuite="Default" />

               </security>

            </binding>

         </wsDualHttpBinding>

      </bindings>

      <client>

         <endpoint   address="http://localhost:8000/WCFDuplexService"

                  binding="wsDualHttpBinding"

                  bindingConfiguration="WSDualHttpBinding_IServerStock"

                  contract="IServerStock"

                  name="WSDualHttpBinding_IServerStock">

            <identity>

               <userPrincipalName value="wandrus@mbsnav.com" />

            </identity>

         </endpoint>

      </client>

   </system.serviceModel>

</configuration>

6 comments:

Anonymous said...

Hi
It does not work when i used ur solution. got the following exception:

HTTP could not register URL http://+:8738/MainService/. Another application has already registered this URL with HTTP.SYS.

plzzz help

William Andrus said...

First thing is to check that port (8738) is not already being used.

Use in a command window:
netstat -an

This will list ports already in use.

Sukalyan said...

Thanks a ton Andrus.
I faced this issue and resolved it with your post.

foo said...

Thank a lot .. I also solved my error . with this post ..
need to be change port that not be the same port of svc host

Venkat Prasad M S said...

Andrus, Thank you very much. I have been a visitor to your site for many of WCF related things. This really worked.

Venkat Prasad M S said...

I created the host, changed the clientbaseaddress and installed the host as a windows service. I had to change a few things in the component,I had to uninstall and install the windows service. I got the same error. what am I doing wrong? do I need to clear the old mapping too when I uninstall and create a new mapping when I install?