none
A web service channel response is getting "lost". RRS feed

  • Question

  • Hi

    A web service channel response is getting "lost". No errors are being reported in any log file or the event log.


    The web service is defined as follows. It is hosted in IIS This works for small data sets. Once the stream contains 1000+ orders no response is returned. 


    The call to provider.UpdateOrders(orders); takes ~ 4 mins. This writes the orders to the database. This works. 
    The provdier returns the correct value to the resultVAr variable. This logged in a log file. However from there on I have no idea what happens.
    I have checked all log files. I have checked the HTTP sys log files. I have enabled tracing. No errors are being reported.
    I have upped all the timings on the IIS server, on the application pool and on the web application hosting the web service.


    Can anyone advise? 


    How would I go about tracing this through writing and attaching events in code?  Top re-iterate it works perfectly for smaller payloads. However the payload here is not great - it is the 3-4 minutes it takes
    to process the records that must be causing the issue. Only on client is currently connecting. Client will not call the web service once it is processing ( simple flag on client side)




    Interface :

    [ServiceContract]
    public interface ISyncService
    {
    
    
        [ServiceContract]
        public interface ISyncService
        {
            [OperationContract]
            [FaultContract(typeof(ServiceData))]
            string ProcessOrdersAsStream(Stream stream);
        }
    }
    

    Implementation :


    public class SyncService : ISyncService
    {
    
    
    
    
         public string ProcessOrdersAsStream(Stream stream)
            {
                try
                {
    
    
                    MemoryStream ms = new MemoryStream();
                    StreamWriter sw = new StreamWriter(ms);
                    sw.Write(stream);
                    sw.Flush();
    
    
                    DataContractSerializer testSerializer = new DataContractSerializer(typeof(List<Order>));
                    List<Order> orders = (List<Order>)testSerializer.ReadObject(stream);
    
    
                    ServerContext cnt = new ServerContext();
    
    
                    using (ServerProvider provider = new ServerProvider(cnt))
                    {
    
    
                        provider.UpdateOrders(orders);
    
    
                  var resultVar = provider.Outcome();
                   
                   //I have logged the resultVar here to a log file. But I do not know what happens from here on. Response gets lost
    
    
                        return result;      
                   
                        
                    }
    
    
                }
                catch (Exception ex)
                {
    
    
    
    
                    ServiceData data = new ServiceData();
                    data.ErrorMessage = ex.Message;
                    data.ErrorDetails = ex.StackTrace;
    
    
                    throw new FaultException<ServiceData>(data);
                }
             return string.Empty;
    
    
            }
    }
    

    Bindings are as follows


    Server  : 

     <system.serviceModel>
         <bindings>
          <basicHttpBinding>
            <binding name="BasicHttpBinding_ISyncService" closeTimeout="00:04:00"
               openTimeout="00:04:00" receiveTimeout="00:05:00" sendTimeout="00:05:00"  transferMode="StreamedRequest"
               maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
               messageEncoding="Mtom" >
              <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
            </binding>
          </basicHttpBinding>
        </bindings>
        <services>
          <service name="<server>SyncService">
            <endpoint address="<servcice address>"
                   binding="basicHttpBinding"
                        bindingConfiguration="BasicHttpBinding_ISyncService" name="BasicHttpBinding_ISyncService"
                   contract="MyService.ISyncService" />
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="">
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
              <serviceDebug includeExceptionDetailInFaults="true" />
              <serviceTimeouts transactionTimeout="00:10:00"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="false" />
      </system.serviceModel>  
    


    Client :

    <system.serviceModel>
        <client>
          <endpoint address="<server url>/service.svc" binding="basicHttpBinding"
                      bindingConfiguration="BasicHttpBinding_ISyncService" name="BasicHttpBinding_ISyncService"
                    contract="MyService.ISyncService"/>
        </client>
        <bindings>
          <basicHttpBinding>
            <binding name="BasicHttpBinding_ISyncService" closeTimeout="00:01:00"
               openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"  transferMode="Streamed"
               maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
               messageEncoding="Mtom" >
              <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="2147483647"


    This has brought a project to it's knees. Any help greatly appreciated.

    Thursday, December 4, 2014 9:56 PM

Answers