locked
Unable to connect to webservice in the server RRS feed

  • Question

  • User-1015186476 posted

    Hi All,

    My webservice has been hosted in my server. I am able to access it from my local machine by giving the link in internet explorer.

    But when i tried to acces the webservice from the application, i am getting the following error:

    The underlying connection was closed: An unexpected error occurred on a send.

    Authentication failed because the remote party has closed the transport stream.

    at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) at System.Net.TlsStream.CallProcessAuthentication(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result) at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.ConnectStream.WriteHeaders(Boolean async)

    Any help Guys?

    Wednesday, November 6, 2013 11:04 AM

Answers

  • User1563932795 posted

    Did you try setting the ServicePointManager like this?:

    ServicePointManager.Expect100Continue = true;
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 6, 2013 2:13 PM
  • User1563932795 posted

    mrajadinesh

    Hi Darren,

    Where can i find the ServicePointManager?

    It's in the System.Net namespace, add this to the top of your code:

    using System.Net;


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 7, 2013 11:40 AM

All replies

  • User1563932795 posted

    Did you try setting the ServicePointManager like this?:

    ServicePointManager.Expect100Continue = true;
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 6, 2013 2:13 PM
  • User-1015186476 posted

    Hi Darren,

    Where can i find the ServicePointManager?

    Thursday, November 7, 2013 1:38 AM
  • User-745611520 posted

    Hi,

         Try this below link 

                        http://forums.asp.net/t/1622470.aspx

    Thanks,

    Selvakumar.S

    Thursday, November 7, 2013 2:01 AM
  • User-1011300357 posted

    hi,

    i think this post will help you.

    Thanks

    abivenkat

    mark as answer if my post was helpful

    Thursday, November 7, 2013 2:02 AM
  • User1563932795 posted

    mrajadinesh

    Hi Darren,

    Where can i find the ServicePointManager?

    It's in the System.Net namespace, add this to the top of your code:

    using System.Net;


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 7, 2013 11:40 AM