Wcf Facility using net.tcp
I'm trying to configure my WCF services to use net.tcp or netnamedpipes.
here is my container config (I've commented out the existing http binding):
var metadata = new ServiceMetadataBehavior
{
HttpGetEnabled = true
};
var debug = new ServiceDebugBehavior
{
IncludeExceptionDetailInFaults = true
};
container.AddFacility<WcfFacility>(f => f.Services.AspNetCompatibility =
AspNetCompatibilityRequirementsMode.Required)
.Install(Configuration.FromAppConfig())
.Register(
Component.For<IS开发者_StackOverflowerviceBehavior>().Instance(metadata),
Component.For<IServiceBehavior>().Instance(debug),
Component
.For<IAccountService>()
.ImplementedBy<AccountService>()
.Named("SomeCompany.Services.Account.AccountService")
.LifeStyle.Transient
.ActAs(new DefaultServiceModel().Hosted().AddEndpoints(
//WcfEndpoint.BoundTo(new BasicHttpBinding { MaxReceivedMessageSize = int.MaxValue }),
//WcfEndpoint.BoundTo(new WSHttpBinding(SecurityMode.None) { MaxReceivedMessageSize = int.MaxValue }).At("ws"),
WcfEndpoint.BoundTo(new NetTcpBinding()).At("net.tcp://localhost/Account")
)),
Component
.For<IAccountNetworkService>()
.ImplementedBy<AccountNetworkService>()
.Named("SomeCompany.Services.Account.AccountNetworkService")
.LifeStyle.Transient
.ActAs(new DefaultServiceModel().Hosted()
.AddEndpoints(
WcfEndpoint.BoundTo(new BasicHttpBinding { MaxReceivedMessageSize = int.MaxValue }),
WcfEndpoint.BoundTo(new WSHttpBinding(SecurityMode.None) { MaxReceivedMessageSize = int.MaxValue }).At("ws")
))
);
My client has the following:
<endpoint address="net.tcp://localhost/Account" binding="netTcpBinding" contract="SomeCompany.Services.Account.Contracts.IAccountService" name="accountServiceClient"></endpoint>
When I try to access the service I get the following:
No connection could be made because the target machine actively refused it 127.0.0.1:808
I have also tried the suggestion placed at the bottom of this wiki:
http://docs.castleproject.org/(S(hv034j45ln0cgt2zkpl1nce5))/Windsor.WCF-Facility-Registration.ashx
Am I missing something blatant here?
Hi that look like a firewall problem something similar happened to me when the windows firewall prompt me for permission for my app and I click cancel instead of OK. Please try to disable windows firewall and check if the error still happen.
the other possible problem is the kind of security you are using for your binding. try to add the following node within your binding configuration in both server and client.
精彩评论