?
Solved

how to configure different port and service URL and clientBaseAddress ?

Posted on 2011-05-13
4
Medium Priority
?
1,333 Views
Last Modified: 2012-05-11
Hi,

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.
0
Comment
Question by:SanjaySutar
  • 2
  • 2
4 Comments
 
LVL 1

Expert Comment

by:Unflux
ID: 35758163
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:

<system.serviceModel>
	<services>
		<service name="MyNamespace.MyService">
			<clear />
			<endpoint
				address="dual"
				binding="WSDualHttpBinding"
				contract="MyNamespace.IMyService"
				/>
				<!-- 
					add other service endpoints with desired attributes as required
				-->
			<host>
				<baseAddresses>
					<add baseArress="http://pc1:8080/myservice" />
				</baseAddresses>
			</host>
		</service>
		<!--
			add other services as required
		-->
	</services>
</system.serviceModel>

Open in new window

0
 

Author Comment

by:SanjaySutar
ID: 35767124
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.

<bindings>
      <wsDualHttpBinding>
        <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" />
          </security>
         
        </binding>
        
      </wsDualHttpBinding>
    </bindings>

<client>
      <endpoint address="http://pc1/WSDualHttpBindingTest/Service1.svc" binding="wsDualHttpBinding"
          bindingConfiguration="ServerService"
          contract="ServiceReference1.ServerService" name="ServerService">
              </endpoint>
    </client>

Open in new window

0
 
LVL 1

Accepted Solution

by:
Unflux earned 2000 total points
ID: 35768403
I assume that you have provided a port number in your service host endpoint address such as:

http://localhost:8080/WSDualHttpBindingTest/Service.svc

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

  <client>
		<endpoint
			address="http://pc1:8080/WSDualHttpBindingTest/Service1.svc"
			binding="wsDualHttpBinding"
			contract="ServiceReference1.ServerService"
			bindingConfiguration="ServerService"
			name="ServerService" />
  </client> 

Open in new window

0
 

Author Comment

by:SanjaySutar
ID: 35768926
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

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

Open in new window


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

Open in new window



Still I am getting error as i have mentioned earlier.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here are the symptoms: You start receiving calls from users that one of your legacy web apps isn't coming up, so you log into your IIS 5 server to check it out.  When you pull up the services, you notice that the WWW Publishing service isn't runn…
Logparser is the smartest tool I have ever used in parsing IIS log files and there are many interesting things I wanted to share with everyone one of the  real-world  scenario from my current project. Let's get started with  scenario - How do w…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

850 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