Всем фанам wсf-а привет! Итак, к делу, что мы имеем: - есть wcf-сервис, который разворачиваеться как windows-service или как консольное приложение(дял дебага) на сервере; - есть клиент, на клиентской машине.
Что мы наблюдаем: 1)если wcf-сервис захостить под консолью(т.е. запустить как консоль), и то все работает ок: т.е. клиент нормально коннектиться к сервису, вызывает методы, тянет данные и т.д. и т.п. 2)но если wcf-сервис захостить как windows-service(как службу), то вся идет не так гладко: клиент приконнектиться не может, получая при этом ошибку следующего содержания: "TCP error code 10061: No connection could be made because the target machine actively refused it."
Причем в обеих случаях конфиг-файлы, аккаунты, под которыми запускаються как сервис как и клиент, одинаковые. Че-то мне это не нравиться 
На всяк случай привожу конфиги: Сервис:
| Код | <?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionStrings> <add name="myConnectionString" providerName="System.Data.SqlClient" connectionString="Data Source=myServer;Initial Catalog=myDb;Integrated Security=True;Timeout=1000000;"/> </connectionStrings> <system.serviceModel>
<behaviors> <serviceBehaviors> <behavior name="mybehavior"> <serviceDebug includeExceptionDetailInFaults="true" /> <serviceMetadata />
<serviceAuthorization principalPermissionMode="UseWindowsGroups" /> </behavior> </serviceBehaviors> </behaviors> <bindings> <wsHttpBinding> <binding name="myBinding"> <security> <transport clientCredentialType="Windows" /> </security> </binding>
</wsHttpBinding> </bindings> <!--<client> <endpoint address="http://MyServer:1662/Service1" binding="wsHttpBinding" bindingConfiguration="myBinding" contract="WcfService1.IService1" name="wsHttpBinding_IService1"> <identity> <userPrincipalName value="myDomain\myUser"/> </identity> </endpoint> </client>--> <services> <service name="WcfService1.Service1" behaviorConfiguration="mybehavior"> <!-- Service Endpoints --> <endpoint address="http://MyServer:1662/Service1" binding="wsHttpBinding" bindingConfiguration="myBinding" contract="WcfService1.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"/> <host> <baseAddresses> <add baseAddress="http://myServer:1662/Service1"/> </baseAddresses> </host> </service> </services> </system.serviceModel> </configuration>
|
Клиент:
| Код | <?xml version="1.0" encoding="utf-8"?> <configuration> <system.serviceModel> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IService1" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> <security mode="Message"> <transport clientCredentialType="Windows" proxyCredentialType="Windows" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="http://myServer:1662/Service1" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService1" contract="IService1" name="WSHttpBinding_IService1"> <identity> <servicePrincipalName value="testService1/myServer"/> <!--<dns value="" />--> </identity>
</endpoint> </client> </system.serviceModel> </configuration>
|
Буду рад любому совету спасибо. |