WCF, непонятные ошибки при вызове методов
От: Alexey.Velichko  
Дата: 22.07.10 20:40
Оценка:
Всем доброй ночи!
На одном из клиентских компьютеров ни в какую не хотят вызываться методы WCF-сервиса.
Имеется простенький сервис такого вида:

 //Интерфейс:
 [ServiceContract(Namespace="http://XYZ/Config")]
    public interface IService
    {
        [OperationContract]
        string GetVersionPublic();
               
        [OperationContract]
        Stream GetFilePublic();
        
        // и еще несколько схожих методов
    }

//Реализация:
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Multiple, IncludeExceptionDetailInFaults = true)]    
    public class ServiceImpl : IService
    {        
        public ServiceImpl()
        {
        }
           
        #region IService Members

        public string GetVersionPublic()
        {
            return "some text";
        }

       
        public System.IO.Stream GetFilePublic()
        {
            System.IO.FileStream stream = new FileStream("path...", FileMode.Open, FileAccess.Read, FileShare.Read);
            return stream; 
        }       

        // + реализация оставшихся методов

        #endregion
    }

Хостится внутри win-службы. Конфиг сервера такой:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>        
        <services>
            <service name="ServerLogic.ServiceImpl" behaviorConfiguration="myServiceBehavior">
                <!-- Service Endpoints -->
                <host>
                    <baseAddresses>
                        <add baseAddress="http://localhost:19311/ABC/MyService/"/>
                    </baseAddresses>
                </host>
                <endpoint address=""  binding="basicHttpBinding" contract="ServiceInterface.IService">                    
                </endpoint>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>                
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="myServiceBehavior">
                    <serviceMetadata httpGetEnabled="True"/>                    
                </behavior>
            </serviceBehaviors>
        </behaviors>
    </system.serviceModel>
</configuration>

Клиентский:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"
                    openTimeout="00:02:00" receiveTimeout="00:10:00" sendTimeout="00:01:30"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="67108864" maxBufferPoolSize="67108864" maxReceivedMessageSize="67108864"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Streamed"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://myserver.mydomain.ru:19311/ABC/MyService/"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
                contract="ServiceReference1.IService" name="BasicHttpBinding_IService" />
        </client>
    </system.serviceModel>
</configuration>

Есть проблемная машина (не в нашем домене), на которой вызов любого(!) метода приводит к исключениям
System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (501) Not Implemented. ---> System.Net.WebException: The remote server returned an error: (501) Not Implemented.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)

или
System.Net.ProtocolViolationException: Chunked encoding upload is not supported on the HTTP/1.0 protocol.
Server stack trace:
at System.Net.HttpWebRequest.CheckProtocol(Boolean onRequestStream)
at System.Net.HttpWebRequest.GetRequestStream()
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at SLConfigPartners.ServiceReference1.IService.GetPasswordPublic()


Причем у всех остальных (а это почти 20 пользователей) все работает с абсолютно идентичными настройками и никаких исключений не кидает! Подскажите хотя бы куда копать...
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.