how to configure different port and service URL and clientBaseAddress ?

Posted on 2011-05-13
Last Modified: 2012-05-11

I have a WCF Service (using WSDualHttpBinding) hosted on a machine. I am try to consume service from a different machine.

In the app.config i have added endpoint address as http://pc1/ServiceTest/Service1.svc  and clientBaseAddress as http://pc1/ServiceTest/Service1.svc

I am getting error while consuming service as metioned below :

Message: HTTP could not register URL http://+:80/ServiceTest/Service1.svc/ because TCP port 80 is being used by another application.
Question by:SanjaySutar
    LVL 1

    Expert Comment

    You are receiving the provided message because you are attempting to register your server on port 80, which your local machine is currently using, and therefore has already registered, for use with web http requests.

    To resolve this error simply specify a port number within your base address, for example:

    		<service name="MyNamespace.MyService">
    			<clear />
    					add other service endpoints with desired attributes as required
    					<add baseArress="http://pc1:8080/myservice" />
    			add other services as required

    Open in new window


    Author Comment

    Hi Unflux, thanx for the reply.

    If WCF service and consuming application are on the same machine then adding port no. to clientBaseAddress is working.

    But in this case my WCF service is hosted on some different machine.

    So i am getting the error. Please take a look at the config file and correct me if am making any mistake.

    I also tried to use different ports in service URL available on WCF service host machine, but all in vain.

            <binding name="ServerService" closeTimeout="00:30:00"
                openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00"
                bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
                messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" clientBaseAddress="http://pc1:1123/WSDualHttpBindingTest/Service1.svc">
              <readerQuotas maxDepth="32" maxStringContentLength="131072000" maxArrayLength="16384"
                  maxBytesPerRead="51200" maxNameTableCharCount="16384" />
              <reliableSession ordered="true" inactivityTimeout="00:30:00" />
              <security mode="Message">
                <message clientCredentialType="Windows" negotiateServiceCredential="true"
                    algorithmSuite="Default" />
          <endpoint address="http://pc1/WSDualHttpBindingTest/Service1.svc" binding="wsDualHttpBinding"
              contract="ServiceReference1.ServerService" name="ServerService">

    Open in new window

    LVL 1

    Accepted Solution

    I assume that you have provided a port number in your service host endpoint address such as:


    Assuming this is the case you need to specifiy that exact address in your client endpoint address configuration:

    			name="ServerService" />

    Open in new window


    Author Comment

    I have that already in config files.

    Server Config

    <endpoint address="http://localhost:2660/Service1.svc" binding="wsDualHttpBinding" contract="WSDualHttpBindingTest.IServerService" />

    Open in new window

    Client Config

          <endpoint address="http://localhost:2660/Service1.svc" />

    Open in new window

            <binding name="ServerService" clientBaseAddress="http://localhost:8080/Service1.svc" />

    Open in new window

    Still I am getting error as i have mentioned earlier.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Suggested Solutions

    If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
    When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now