Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8037551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:57:46+00:00 2026-06-05T02:57:46+00:00

When I call the restful service with the following code, I am getting the

  • 0

When I call the restful service with the following code, I am getting the error

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

Code:

    Const url As String = "http://localhost:8003/Tracker/Tracker.svc/GetTrackerDetails"

        ServicePointManager.MaxServicePointIdleTime = 500
        ServicePointManager.UseNagleAlgorithm = True
        ServicePointManager.Expect100Continue = True
        ServicePointManager.CheckCertificateRevocationList = True
        ServicePointManager.DefaultConnectionLimit = ServicePointManager.DefaultPersistentConnectionLimit

        req = DirectCast(WebRequest.Create(url), HttpWebRequest)
        req.Method = "POST"
        req.ContentType = "application/xml; charset=utf-8"
        req.Timeout = 300000
        req.KeepAlive = False
        req.Headers.Add("SOAPAction", url)


        Dim xmlDoc = New XmlDocument With {.XmlResolver = Nothing}

        xmlDoc.Load(Server.MapPath("Request.xml"))
        Dim sXml As String = xmlDoc.InnerXml
        req.ContentLength = sXml.Length
        Dim sw = New StreamWriter(req.GetRequestStream())
        sw.Write(sXml)
        sw.Close()

        res = DirectCast(req.GetResponse(), HttpWebResponse)
        Dim responseStream As Stream = res.GetResponseStream()
        Dim streamReader = New StreamReader(responseStream)

        'Read the response into an xml document
        Dim soapResonseXmlDocument = New XmlDocument()
        soapResonseXmlDocument.LoadXml(streamReader.ReadToEnd())


        TextBox1.Text = Server.HtmlDecode(soapResonseXmlDocument.InnerXml)
        soapResonseXmlDocument.LoadXml(TextBox1.Text)

I am facing this error for the past few days. What is wrong with my calling code. Please help me out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:57:47+00:00Added an answer on June 5, 2026 at 2:57 am

    You should install some logging on the connection, in this case I would guess the request or response is to big for the client or server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to call a WCF RESTful service from jQuery. I am using
I'm making a RESTful web service call in my JavaScript page and get the
When I call a particular restful service method, which is built using CXF ,
I'm trying to do an ajax (restful service) call using $.get. It works perfectly
I am having a RESTful service with the following method: [WebInvoke] string GetDataFromStringAsString(string xmlString);
I'm trying to call a RESTful web service from an Android application using the
I am attempting to call a RESTful service using an HttpWebRequest object via POST.
I'm building a web service with a RESTful interface (lets call it MY_API ).
I'm building a web service with a RESTful interface (lets call it MY_API ).
When I make a standard Get Request call to a restful wcf service it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.