Я совершенно новичок в этом и пытаюсь разместить простейший сервис WCF с привязкой net.tcp
У меня Windows 7 Professional и IIS7, и я активировал NON http активацию.
- Я запускаю новое приложение службы WCF
проект в vs2010 и скомпилировать его.
НИЧЕГО ЕЩЕ!
- Я удаляю все свои IIS
Сайты и добавить новый под названием WCFHost
- Я открываю WcfTestClient.exe и добавляю
http://localhost/Service1.svc приложение находит его
Web.config выглядит следующим образом (нетронутым)
<system.serviceModel>
<services>
<service name="WcfService2.Service1" behaviorConfiguration="WcfService2.Service1Behavior">
<endpoint address="" binding="wsHttpBinding" contract="WcfService2.IService1">
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
-->
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WcfService2.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Пока все хорошо. Но как насчет того связывания net.tcp. Я добавляю атрибут "enabledProtocols", чтобы мой applicationHost.config выглядел следующим образом
<site name="WCFHOST" id="3">
<application path="/" applicationPool="WCFHOST" enabledProtocols="http,net.tcp,net.pipe,net.msmq">
<virtualDirectory path="/" physicalPath="C:\Prosjekter\temp\TestService\TestService" />
</application>
<bindings>
<binding protocol="net.tcp" bindingInformation="808:*" />
<binding protocol="http" bindingInformation="*:80:" />
</bindings>
</site>
Затем я перехожу на веб-сайт IIS WCFHost и добавляю привязку net.tcp 808: *
А затем я изменяю свой web.config для службы WCF, чтобы она выглядела следующим образом. (только что изменили привязку на конечных точках)
<system.serviceModel>
<services>
<service name="WcfService2.Service1" behaviorConfiguration="WcfService2.Service1Behavior">
<!-- Service Endpoints -->
<endpoint address="" binding="netTcpBinding" contract="WcfService2.IService1">
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
-->
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WcfService2.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Когда я сейчас пытаюсь добавить службу net.tcp: // localhost: 808 / Service1.svc в мой WcfTestClient.exe, я получаю ошибку
Ошибка: невозможно получить метаданные из net.tcp: //localhost/Service1.svc
TCP-код ошибки 10061: не удалось установить соединение, поскольку целевая машина активно отказалась от него .... 127.0.0.1:808
Мой брандмауэр выключен.
Я видел одну вещь, хотя .. при использовании netstat -a порт 808 там не указан .. не так ли?
Может ли кто-нибудь помочь мне просто создать мой первый сервис WCF с привязкой nettcp?