Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

What exactly do I need to do to host a WCF service in IIS 7.0 using netTcpBinding?

Posted on 2009-07-09
6
Medium Priority
?
1,371 Views
Last Modified: 2012-05-07
Hello Everyone:

I've been trying for more than a week without any success at all, to host a very simple HelloWorld-like wcf service using netTcpBinding.

With http, everything is ok. I can access my service even from a remote machine. But with tcp problems arise.

I have performed all the steps I'm supposed to, in order to host my service in WAS:

* .Net 3.0 Features are enabled, including http and non-http Activation

* I have granted 'Network Service' and 'IIS_IUSRS' the following permissions to the folder containing the site:

   - Read & Execute
   - List Folder Contents
   - Read

* Opened de ports 8100 and 8086 in the firewall.

* At IIS Manager/ Actions / Bindings the following bindings are set up:
  - http 8100:*  
  - net.tcp 8086:*

* At IIS Manager/ Manage Web Site / Advanced Settings, both, http and net.tcp protocols are enabled.

The original problem I had was that I was able to reach the service via http but when trying with tcp I got the following error:

"The message could not be dispatched because the service at the endpoint addres 'net.tcp://myDomain/HelloWorld.Hello.svc' is unavailable for the protocol address."

I found a post in this site whose author had the same problem and It was solved by reinstalling .net 3.0 features. So I tryed that. I also tryed to reinstall IIS 7.0 just in case.
Now, the situation is worse than it was at the begining. If I configure an endpoint with tcpBinding in my Web.Config I can't even reach my service at it's http address using IE!! I get the following message:

Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].

The Web.Config file is as follows:


<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 
   <system.web>    
     <compilation debug="true" />
  </system.web>
  <system.serviceModel>
     <services>
        <service behaviorConfiguration="HelloWorld.HelloBehavior"
                 
           name="HelloWorld.Hello">
           <host>
              <baseAddresses>
                 <add baseAddress="http://myDomain:8100/HelloWorld/" />
             <add baseAddress="net.tcp://myDomain:8086/HelloWorld/" />
              </baseAddresses>
           </host>          
         
           <endpoint address=""
                     binding="wsHttpBinding"
                     contract="HelloWorld.IHello"
                     bindingConfiguration="httpInseguro">
           </endpoint>

           <endpoint address=""
                     binding="netTcpBinding"
                     contract="HelloWorld.IHello"
                     bindingConfiguration="netTcpInseguro">
           </endpoint>
     
         
           <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

        </service>
     </services>
   
    <bindings>

      <wsHttpBinding>
        <binding name ="httpInseguro">
          <security mode ="None" />
        </binding>        
      </wsHttpBinding>
     
      <netTcpBinding>
        <binding name ="netTcpInseguro">
          <security mode ="None" />
        </binding>        
      </netTcpBinding>

    </bindings>

and the .svc file is like this:

<% @ServiceHost Service="HelloWorld.Hello" %>


Could anyone please give me a clue about what's going on? I really don't know what else to do. This is being a real headacke becasuse using http binding is not an option.
Thanks in advance.








0
Comment
Question by:david-shm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 25

Accepted Solution

by:
apeter earned 2000 total points
ID: 24822113
Check below points.

1. You should have a MEX for tcp also. add this. <endpoint address="mextcp" binding="mexTcpBinding" contract="IMetadataExchange"/>
2. there is no port information available in your request.
3. Why you are having 2 base addresses for your service ? Are hosting your tcp service to the proper address as mentioned in the config file and also your client requesting the to the same URL ?

Same sample is tried by some one else also..check this link.
http://www.experts-exchange.com/Programming/Languages/.NET/Web_Services/Q_24045114.html
0
 

Author Comment

by:david-shm
ID: 24822331
Hello apeter,

I didn't know about the need to have the mex. I'll try that.
The port information is provided at both sides and it's correct. I've also hosted the service inside a console app. and everithing is Ok even with netTcpBinding. The problem is with IIS + netTcpBinding.
I have 2 base addresses because is easier to check if the service is up using http.
Thank you.
Best wishes.

David
0
 

Author Comment

by:david-shm
ID: 24823724
Hello apeter,

I don't know how to thank you!! If I only discoverd this web before It would have saved me 2 weeks of work.

The problem was the missing endpoint:

<endpoint address="mextcp" binding="mexTcpBinding" contract="IMetadataExchange"/>

Thank you very much.

Best wishes,

David
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

Author Comment

by:david-shm
ID: 24823754
Hi apeter,

I'd like to award the points to you, but the blue button doesn't apear under your response. Only under mines. How do I must proceed?
0
 

Author Closing Comment

by:david-shm
ID: 31601770
This was the solution:

You should have a MEX for tcp also. add this.
0
 
LVL 25

Expert Comment

by:apeter
ID: 24825952
Glad i could help.
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
Introduction: Sometimes when I receive a call from my users to solve their problems it is very difficult for me to found their computer IP address. Even finding their computer Host to provide remote support can be a problem.  So I resorted to Goo…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

719 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