c# - Can't access a Console hosted WCF service from a remote client on LAN -
for days now, i'm trying access wcf service computer on lan , can't access it.
locally works fine though.
majority of similar questions find using iis host service.
i tried shut down firewall couldn't effect.
here config files, please ask if need more :
client's app.config :
<?xml version="1.0" encoding="utf-8"?> <configuration> <startup> <supportedruntime version="v4.0" sku=".netframework,version=v4.5"/> </startup> <system.servicemodel> <client> <endpoint name="default" address="http://myhostip:3100/" binding="basichttpbinding" contract="serviceinterface.iservice"/> </client> </system.servicemodel> </configuration>
here host app.config :
<?xml version="1.0" encoding="utf-8"?> <configuration> <startup> <supportedruntime version="v4.0" sku=".netframework,version=v4.5"/> </startup> <system.servicemodel> <services> <service name="servicetest.service"> <endpoint address="http://0.0.0.0:3100" contract="serviceinterface.iservice" binding="basichttpbinding"/> </service> </services> </system.servicemodel> </configuration>
if guys got ideas... couldn't find informations
edit :
i'm using console application host service
telnet connection local , remote hosts working
edit 2 :
i seen made mistake copying app.config file. binding type should wsdualhttpbinding
instead of basichttpbinding
i error message :
first 1 "caller couldn't identicate wcf service"
i tried set security none (for troubleshooting purposes) , got timeout exception
edit 3 :
in console app :
static void main(string[] args) { servicehost host = new servicehost(typeof(servicetest.service)); host.open(); console.writeline("server started"); console.readline(); }
edit 4:
the complete solution available here https://github.com/sidewinder94/smallchatsolution
here solution issue.
client's app config
<?xml version="1.0" encoding="utf-8"?> <configuration> <startup> <supportedruntime version="v4.0" sku=".netframework,version=v4.5"/> </startup> <system.servicemodel> <client> <endpoint name="default" contract="chatdllcontracts.iservice" binding="nettcpbinding" address="net.tcp://myhostip:3100/" bindingconfiguration="mynet"/> </client> <bindings> <nettcpbinding> <binding name="mynet" sendtimeout="00:00:05" portsharingenabled="true"> <security mode="none" /> </binding> </nettcpbinding> </bindings> </system.servicemodel> </configuration>
chatserver's app.config
<?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedruntime version="v4.0" sku=".netframework,version=v4.5"/> </startup> <system.servicemodel> <services> <service name="chatdll.service"> <endpoint contract="chatdllcontracts.iservice" binding="nettcpbinding" address="net.tcp://localhost:3100" bindingconfiguration="mynet"/> </service> </services> <bindings> <nettcpbinding> <binding name="mynet" sendtimeout="00:00:05" portsharingenabled="true"> <security mode="none" /> </binding> </nettcpbinding> </bindings> </system.servicemodel> </configuration>
please keep in mind need enable net.tcp port sharing service (on server & client side) in order working.
Comments
Post a Comment