david-shm
asked on
What exactly do I need to do to host a WCF service in IIS 7.0 using netTcpBinding?
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/HelloW orld.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="Hel loWorld.He lloBehavio r"
name="HelloWorld.Hello">
<host>
<baseAddresses>
<add baseAddress="http://myDomain:8100/HelloWorld/" />
<add baseAddress="net.tcp://myD omain:8086 /HelloWorl d/" />
</baseAddresses>
</host>
<endpoint address=""
binding="wsHttpBinding"
contract="HelloWorld.IHell o"
bindingConfiguration="http Inseguro">
</endpoint>
<endpoint address=""
binding="netTcpBinding"
contract="HelloWorld.IHell o"
bindingConfiguration="netT cpInseguro ">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchang e" />
</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.
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/HelloW
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="Hel
name="HelloWorld.Hello">
<host>
<baseAddresses>
<add baseAddress="http://myDomain:8100/HelloWorld/" />
<add baseAddress="net.tcp://myD
</baseAddresses>
</host>
<endpoint address=""
binding="wsHttpBinding"
contract="HelloWorld.IHell
bindingConfiguration="http
</endpoint>
<endpoint address=""
binding="netTcpBinding"
contract="HelloWorld.IHell
bindingConfiguration="netT
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchang
</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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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="IMetadataExchang e"/>
Thank you very much.
Best wishes,
David
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="IMetadataExchang
Thank you very much.
Best wishes,
David
ASKER
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?
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?
ASKER
This was the solution:
You should have a MEX for tcp also. add this.
You should have a MEX for tcp also. add this.
Glad i could help.
ASKER
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