wcf net.tcp binding throwing error The URI prefix is not recognized, http binding works -
i have simple wcf service hosted in iis 7 on local computer running windows7, nettcp binding trying access using winform, keep getting same error no matter try. can access service via http though.
at point have spent whole day trying figure reason , have gone through of post on topic on stack overflow. @ point feel missing basic , feedback experts highly appreciated.
even if guide me how debug or exact cause lot not seeing useful in event log or failed request tracing :(
steps have taken
- set new website on localhost net.tcp enabled (without spaces)!
- made sure 3 services net.tcp running
- disabled security in webconfig (none instead of windows).
my service details
namespace wcfservice1 { public class service1 : iservice1 { public string echo(string msg) { return datetime.now.tostring(); } } }
web config
<?xml version="1.0"?> <configuration> <appsettings> <add key="aspnet:usetaskfriendlysynchronizationcontext" value="true" /> </appsettings> <system.web> <compilation debug="true" targetframework="4.5" /> <httpruntime targetframework="4.5"/> </system.web> <system.servicemodel> <services> <service name="wcfservice1.service1"> <endpoint address="" binding="nettcpbinding" bindingconfiguration="tcpbinding" contract="wcfservice1.iservice1" > <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="" binding="mexhttpbinding" bindingconfiguration="" contract="imetadataexchange" /> <host> <baseaddresses> <add baseaddress="net.tcp://localhost:820/service1.svc"/> </baseaddresses> </host> </service> </services> <bindings> <nettcpbinding> <binding name="tcpbinding" portsharingenabled="true"> <security mode="none"></security> </binding> </nettcpbinding> </bindings> <behaviors> <servicebehaviors> <behavior> <!-- avoid disclosing metadata information, set values below false before deployment --> <servicemetadata httpgetenabled="true"/> <!-- receive exception details in faults debugging purposes, set value below true. set false before deployment avoid disclosing exception information --> <servicedebug includeexceptiondetailinfaults="false"/> </behavior> </servicebehaviors> </behaviors> <!--<protocolmapping> <add binding="basichttpsbinding" scheme="https" /> </protocolmapping>--> <servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true" /> </system.servicemodel> <system.webserver> <modules runallmanagedmodulesforallrequests="true"/> <!-- browse web app root directory during debugging, set value below true. set false before deployment avoid disclosing web app folder information. --> <directorybrowse enabled="true"/> </system.webserver> </configuration>
full error details
the uri prefix not recognized. metadata contains reference cannot resolved: 'net.tcp://localhost:820/service1.svc'. requested service, 'net.tcp://localhost:820/service1.svc' not activated. see server's diagnostic trace logs more information. if service defined in current solution, try building solution , adding service reference again.
are adding reference through references --> service reference? used web configuration file , able run , consume wcf service console application.
Comments
Post a Comment