none
HTTP could not register URL http://+:80/Temporary_Listen_Addresses/<guid>/ because TCP port 80 is being used by another applicat

    Question

  • I have a wcf service using wsDualHttpBinding. I have verified the config files and they are correctly using wsDualHttpBinding entries. When am runing the client I am getting the following exception.

    I have verified the config file at the clien and it does has client callback endpoint as follows

     

    Can someone help me understand whats missig here?

     

    <client>

    <endpoint address="http://localhost:4251/WCF_DualHttp/Service.svc"

    binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IPingService"

    contract="IPingService" name="WSDualHttpBinding_IPingService">

    </endpoint>

    </client>

     

    HTTP could not register URL http://+:80/Temporary_Listen_Addresses/c269764e-808e-4284-ad7f-4e0eb88ee951/ because TCP port 80 is being used by another application.

    Saturday, February 02, 2008 5:23 AM

Answers

  • IIS uses port 80 and by default the clientBaseAddress too uses the same port. You should set the ClientBaseAddress to a different port on WsdualHttpBinding at service.

    Saturday, February 02, 2008 6:22 AM
    Moderator

All replies

  • IIS uses port 80 and by default the clientBaseAddress too uses the same port. You should set the ClientBaseAddress to a different port on WsdualHttpBinding at service.

    Saturday, February 02, 2008 6:22 AM
    Moderator
  • Dinesh,

     

    Can you suggest me the resolution for this please?

     

    Also my Service is running under ASP.NET Developement server integrated with VS 2005 at localhost:4251

    How do I set ClientBaseAddress to a different port am generating a client proxy using svcutil.exe.

     

     

     

    Saturday, February 02, 2008 1:11 PM
  • You can set in service config as below

     

    <wsDualHttpBinding>
            clientBaseAddress="URI"
    </wsDualHttpBinding>

    In code,

     

    WsDualHttpBinding.ClientBaseAddress = new Uri("http://locahost:8010/Tempuri");

    Saturday, February 02, 2008 5:27 PM
    Moderator
  •  

    I changed the app.config of the client as follows but am getting the followng exception

     

    "Client is unable to finish the security negotiation within the configured timeout (00:00:00).  The current negotiation leg is 1 (00:00:00)."

     

    <configuration>

    <system.serviceModel>

    <bindings>

    <wsDualHttpBinding>

    <binding clientBaseAddress="http://locahost:6666/" name="WSDualHttpBinding_IPingService" 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">

    <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:4251/WCF_DualHttp/Service.svc"

    binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IPingService"

    contract="IPingService" name="WSDualHttpBinding_IPingService">

    </endpoint>

    </client>

    </system.serviceModel>

    </configuration>

     

     

    Sunday, February 03, 2008 4:24 AM
  • What should I do if I don't know client base address? And client is running IIS and tries to use my ClientApplication which uses wsDualHttpBinding.
    Friday, August 01, 2008 8:12 PM
  • dnl.nitro - Even my query is not yet resolved.

    I was hoping that Dinesh will reply me further to elaborate on help but unfortunately no response...

     

    Saturday, August 02, 2008 8:26 AM
  •  
    Radenb,

        I was testing today an example of duplex pattern on WCF and i used wsDualHttpBinding, i made this at work and everything worked fine. When i tried to move this example and test it on my notebook i got exacle ur same problem.  I turned of IIS and the client worked, i turned it on the client stoped working, so i tried Dinesh's solution.

    The solution of Dinesh is partially correct, I mean, I added the new ClientBaseAdress at server .config, and refreshed the client proxy, but it didnt work and i got the same error, the client trying to use port 80. So i said... why is it still trying to use that port? well i bet it didnt know another port. Then i checked the client configuration and I realized that when i refresh the client proxy it doesnt add the new config parameter "ClientBaseAdress". So i figure it must have some sort of bug and i decided to manually add this parameter with the same value than the server and it worked!!!.

    This is my Server .config:

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

    <configuration>

    <system.serviceModel>

    <bindings>

    <wsDualHttpBinding>

    <binding name="ServicioBinding" clientBaseAddress="http://localhost:10002/TempUri"

    messageEncoding="Mtom" />

    </wsDualHttpBinding>

    <mexHttpBinding>

    <binding name="MetadataBinding" />

    </mexHttpBinding>

    </bindings>

    <services>

    <service behaviorConfiguration="ComportamientoServicio" name="CalculadoraSvc.Calculadora">

    <endpoint address="CalculadoraSvc" behaviorConfiguration="" binding="wsDualHttpBinding"

    bindingConfiguration="ServicioBinding" name="ServicioEndpoint"

    contract="CalculadoraSvc.ICalculadora">

    <identity>

    <dns value="localhost" />

    </identity>

    </endpoint>

    <endpoint address="CalculadoraSvc/Mex" binding="mexHttpBinding"

    bindingConfiguration="MetadataBinding" name="MetadataEndpoint"

    contract="IMetadataExchange" />

    <host>

    <baseAddresses>

    <add baseAddress="http://localhost:10000" />

    </baseAddresses>

    </host>

    </service>

    </services>

    <behaviors>

    <serviceBehaviors>

    <behavior name="ComportamientoServicio">

    <serviceMetadata httpGetEnabled="false" />

    <serviceDebug includeExceptionDetailInFaults="true" />

    </behavior>

    </serviceBehaviors>

    </behaviors>

    </system.serviceModel>

    </configuration>


    This is my Client . config:

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

    <configuration>

    <system.serviceModel>

    <bindings>

    <wsDualHttpBinding>

    <binding name="ServicioEndpoint" 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" clientBaseAddress="http://localhost:10002/TempUri"

     

    messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true">

    <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:10000/CalculadoraSvc" binding="wsDualHttpBinding"

     

    bindingConfiguration="ServicioEndpoint" contract="Calculadora.ICalculadora"

     

    name="ServicioEndpoint">

    <identity>

    <dns value="localhost" />

    </identity>

    </endpoint>

    </client>

    </system.serviceModel>

    </configuration>


    PD: So i dont know if this is a bug and should report it, anyway i recomend you to use WebServiceAsync callbacks, just enable them from the advanced proxy configuration on the client.



    I hope this help, regards.

    • Proposed as answer by EngineByte Wednesday, September 09, 2009 2:29 PM
    Sunday, December 14, 2008 8:28 PM
  • Maybe there is a better solution:
    Don't set clientBaseAddress in server's web.config (it's not practical since you can't predict all your clients' URL's), but just update client's autogenerated App.Config binding definition explicit clientBaseAddress  :

    <bindings>
          <wsDualHttpBinding>
            <binding name="DuplexBinding" clientBaseAddress="http://localhost:8001/myClient/" />
            <binding name="WSDualHttpBinding_ICalculatorDuplex" clientBaseAddress="http://localhost:666/myClient/" 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">
              <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>

     

    • Proposed as answer by HarisM Friday, June 05, 2009 5:38 AM
    Monday, May 18, 2009 4:54 PM
  • I am new to WCF. Spent a lot of time in searching answer. Michael Bleterman 's solution works.

    To make life simple try this.

    Create WCF service as usual.
    On your client add reference to service.
    Open App.config on your client.
    Find <wsDualHttpBinding>.
    Add clientBaseAddress="http://localhost:8001/DemoWebHost/DemoWCFService.svc".

    Find <client> <endpoint address="http://localhost/DemoWebHost/DemoWCFService.svc"

    The only difference in these two lines is clientBaseAddress is listening on 8001, while endpoint address is set on 80.

    Khurram Tanwir
  • I am new to WCF. Spent a lot of time in searching answer. Michael Bleterman 's solution works.

    To make life simple try this.

    Create WCF service as usual.
    On your client add reference to service.
    Open App.config on your client.
    Find <wsDualHttpBinding>.
    Add clientBaseAddress="http://localhost:8001/DemoWebHost/DemoWCFService.svc".

    Find <client> <endpoint address="http://localhost/DemoWebHost/DemoWCFService.svc"

    The only difference in these two lines is clientBaseAddress is listening on 8001, while endpoint address is set on 80.

    Khurram Tanwir
  • I am new to WCF. Spent a lot of time in searching answer. Michael Bleterman 's solution works.

    To make life simple try this.

    Create WCF service as usual.
    On your client add reference to service.
    Open App.config on your client.
    Find <wsDualHttpBinding>.
    Add clientBaseAddress="http://localhost:8001/DemoWebHost/DemoWCFService.svc".

    Find <client> <endpoint address="http://localhost/DemoWebHost/DemoWCFService.svc"

    The only difference in these two lines is clientBaseAddress is listening on 8001, while endpoint address is set on 80.

    Khurram Tanwir
  • Maybe there is a better solution:
    Don't set clientBaseAddress in server's web.config (it's not practical since you can't predict all your clients' URL's), but just update client's autogenerated App.Config binding definition explicit clientBaseAddress   :

    <bindings>
          <wsDualHttpBinding>
            <binding name="DuplexBinding" clientBaseAddress="http://localhost:8001/myClient/" />
            <binding name="WSDualHttpBinding_ICalculatorDuplex" clientBaseAddress="http://localhost:666/myClient/" 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">
              <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>

     

    I am new to WCF. Spent a lot of time in searching answer. Michael Bleterman 's solution works.

    To make life simple try this.

    Create WCF service as usual.
    On your client add reference to service.
    Open App.config on your client.
    Find <wsDualHttpBinding>.
    Add clientBaseAddress="http://localhost:8001/DemoWebHost/DemoWCFService.svc".

    Find <client> <endpoint address="http://localhost/DemoWebHost/DemoWCFService.svc"

    The only difference in these two lines is clientBaseAddress is listening on 8001, while endpoint address is set on 80.
    Khurram Tanwir
    Wednesday, September 09, 2009 2:30 PM
  • Khurram..ur option seems really simple  and one can understand it very well..But my problem is still not solved.I have added a clientBaseAddress tag in my client app.config,under <wsDualHttpBinding>...but still i get same error..what else can solve this.

     

    this error ws nt when i used BasicHttpBinding but in wsDualHttp it gives this error when i run client..i need to change it to wsDualHttp bcoz the new feature to be added  in the application requires callback..Searched many forums but no appropriate answer..!!

     

    waiting for a solution aas fast as possible...

     

     

    Thanks

    Mumtaz


    Mumtaz Surani
    Friday, August 27, 2010 6:10 AM
  • I think it's better to use netTcpBinding,because  TCP is not a one way connection and there is no need to open a new connection for callback,the same port will be used for callack in TCP.
    Monday, October 04, 2010 9:26 AM
  • I ran into this problem while trying to work through sample WCF code (How to create a basic wcf web http service ).  I didn't realize that the example applied server and client code in the same console application.  I created the sample WCF service as a web site and ran it.  I then attempted to create a WebServiceHost object in my console app using the same URL as my development server.  The exception was correctly thrown because I was trying to open two web service hosts on the same port/URL.

    When I deleted my sample WCF web site and included the service class and interface in my console project, everything worked correctly.  If you are attempting to run this sample code and got this exception, odds are good that you made the same mistake I did.  


    C# Developer
    Tuesday, October 19, 2010 7:50 PM