locked
InvalidOperationException when calling web service RRS feed

  • Question

  • Hi All,

    I have a windows application (actually an Outlook addin) that calls an asmx web service to get some data. The return value is a DataTable. I am calling the web service by adding is as a web service reference.

    This has been working correctly for all clients, but recently one client reported an issue where calling the web service throws the following errors (on two separate calls):

    -------------------------------------------------------------------------------------------------------------------
    Exception Type: InvalidOperationException
    Exception Message: There is an error in XML document (23, 93530).
    Inner Ex Type: IOException
    Inner Ex Message: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
    StackTrace:   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)   at 
    -------------------------------------------------------------------------------------------------------------------

    -------------------------------------------------------------------------------------------------------------------
    Exception Type: InvalidOperationException
    Exception Message: There is an error in XML document (4426, 32).
    Inner Ex Type: IOException
    Inner Ex Message: The operation has timed out.
    StackTrace:   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)   at 
    -------------------------------------------------------------------------------------------------------------------

    I am able to rule out that my application is generating the timeout as I am setting the web service class' TimeOut property to 2hrs before the call, and the next request has come through to the server in about 20-30 minutes.

    Going through the IIS log, all the requests that have failed for the client have a http status of 200, but also a win32-status of 995.

    I have been trying to replicate this error and get the reason why it is occurring without any success for the better part of the last 3 days (I need to find the exact reason - company policy :( :P). I need to know why this occurs and what is the solution or best work-around for this issue.

    Can anyone help me with this? Any help is greatly appreciated. Thanks!

    Cheers!

    Wednesday, March 19, 2014 4:56 AM

Answers

All replies

  • Hi,

    First please try to refer to the following article about tracing the web service to get more information:
    #Enabling Tracing in ASP.NET Web Services:
    http://msdn.microsoft.com/en-us/library/vstudio/bb885203(v=vs.100).aspx .

    Also it will better to use the fiddler to know what is the actual response and request between the server and client.

    #Download Filddler:
    http://www.telerik.com/fiddler .

    Then if the above can not help, please try to post your question to the asmx web service forum.

    #ASMX Web Service Forum:
    http://forums.asp.net/28.aspx/1?WCF+ASMX+and+other+Web+Services .

    Best Regards,
    Amy Peng



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, March 20, 2014 6:05 AM
  • Hi Amy,

    Thank you for the response. I will follow your advice on checking the actual request and response.

    In the meantime, I have also re-posted this question on the asmx forum as you suggested. Thank you very much for pointing it out to me.

    Cheers!

    Friday, March 21, 2014 3:13 AM