WCFTestClient HTTP-запрос не авторизован с помощью схемы аутентификации клиента «Anonymous».
Я создал одну службу WCF и развернул ее на сервере. Когда я просматриваю этот сервис, он дает мне положительный ответ с? Wsdl URL. Сейчас я пытаюсь протестировать сервис через тестовый клиент WCF. Это показывает правильные метаданные. Но когда я пытаюсь вызвать какой-либо метод из сервиса, он показывает мне исключение ... вот подробности ошибки с трассировкой стека ...
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.
Трассировка стека сервера:
at
System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(HttpWebRequest
request, HttpWebResponse response,
WebException responseException,
HttpChannelFactory factory)
The HTTP request is unauthorized with client
authentication scheme 'Anonymous'. The
authentication header received from
the server was 'Negotiate,NTLM'.
Трассировка стека сервера:
at
System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(HttpWebRequest
request, HttpWebResponse response,
WebException responseException,
HttpChannelFactory factory)
Привязки клиента:
<code><bindings> <wsHttpBinding> <binding name="WSHttpBinding_IServiceMagicService" 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="None"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="true" /> </security> </binding> </wsHttpBinding> </bindings> </code>
Привязки к серверу:
<code><bindings> <wsHttpBinding> <binding name="WSHttpBinding_SEOService" closeTimeout="00:10:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="true" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="999524288" maxReceivedMessageSize="655360000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="32" maxStringContentLength="900000" maxArrayLength="900000" maxBytesPerRead="900000" maxNameTableCharCount="900000" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> <security mode="None"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="true" /> </security> </binding> <binding name="WSHttpServiceMagicBinding" closeTimeout="00:10:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="true" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="999524288" maxReceivedMessageSize="655360000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="32" maxStringContentLength="900000" maxArrayLength="900000" maxBytesPerRead="900000" maxNameTableCharCount="900000"/> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/> <security mode="None"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/> <message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="true"/> </security> </binding> </wsHttpBinding> </bindings> </code>
Клиентский раздел клиента:
<code><client> <endpoint address="http://hydwebd02.solutions.com/GeoService.Saveology.com/ServiceMagicService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IServiceMagicService" contract="IServiceMagicService" name="WSHttpBinding_IServiceMagicService" /> </client> </code>
Секция обслуживания сервера:
<code><services> <service behaviorConfiguration="GeoService.Saveology.com.CityStateServiceProviderBehavior" name="GeoService.Saveology.com.CityStateServiceProvider"> <endpoint binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_SEOService" contract="SEO.Common.ServiceContract.ICityStateService" /> <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="" contract="IMetadataExchange" /> </service> <service behaviorConfiguration="GeoService.Saveology.com.ServiceMagicServiceProviderBehavior" name="GeoService.Saveology.com.ServiceMagicServiceProvider"> <endpoint binding="wsHttpBinding" bindingConfiguration="WSHttpServiceMagicBinding" contract="SEO.Common.ServiceContract.IServiceMagicService"> </endpoint> <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="" contract="IMetadataExchange" /> </service> </services> </code>