<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic C# SDK exception : System.Net.WebException: The request was aborted: The request was canceled. in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/C-SDK-exception-System-Net-WebException-The-request-was-aborted/m-p/130622#M1856</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
I am trying to call a Saved search using C# SDK as below.&lt;/P&gt;

&lt;P&gt;SavedSearchCollection coll = service.GetSavedSearches();&lt;/P&gt;

&lt;P&gt;SavedSearch SplunkSearch = service.GetSavedSearches().Get("SavedSearchName");&lt;/P&gt;

&lt;P&gt;Job searchJob = SplunkSearch .Dispatch();&lt;/P&gt;

&lt;P&gt;while (!searchJob.IsDone)&lt;/P&gt;

&lt;P&gt;{&lt;/P&gt;

&lt;P&gt;try&lt;/P&gt;

&lt;P&gt;{&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Thread.Sleep(500);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;}&lt;BR /&gt;
   catch (Exception ex)&lt;BR /&gt;
   {&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;}&lt;/P&gt;

&lt;P&gt;I am getting the following exception while trying to execute &lt;STRONG&gt;while (!searchJob.IsDone)&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;System.Net.WebException: The request was aborted: The request was canceled.     at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)     at System.Xml.XmlTextReaderImpl.ReadData()     at System.Xml.XmlTextReaderImpl.ParseText(Int32&amp;amp; startPos, Int32&amp;amp; endPos, Int32&amp;amp; outOrChars)     at System.Xml.XmlTextReaderImpl.ParseText()     at System.Xml.XmlTextReaderImpl.ParseElementContent()     at System.Xml.XmlTextReaderImpl.Read()     at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)     at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)     at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)     at System.Xml.XmlDocument.Load(XmlReader reader)     at System.Xml.XmlDocument.Load(Stream inStream)     at Splunk.AtomEntry.Parse(Stream input)     at Splunk.Job.Refresh()     at Splunk.Job.get_IsDone()     at SplunkDataPull.FetchData.Fetchdata()&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Note:The issues is not occurring every time.Few runs are running without any issues few runs are throwing this exception.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Please help&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2014 08:58:25 GMT</pubDate>
    <dc:creator>ykmohank</dc:creator>
    <dc:date>2014-01-30T08:58:25Z</dc:date>
    <item>
      <title>C# SDK exception : System.Net.WebException: The request was aborted: The request was canceled.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/C-SDK-exception-System-Net-WebException-The-request-was-aborted/m-p/130622#M1856</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I am trying to call a Saved search using C# SDK as below.&lt;/P&gt;

&lt;P&gt;SavedSearchCollection coll = service.GetSavedSearches();&lt;/P&gt;

&lt;P&gt;SavedSearch SplunkSearch = service.GetSavedSearches().Get("SavedSearchName");&lt;/P&gt;

&lt;P&gt;Job searchJob = SplunkSearch .Dispatch();&lt;/P&gt;

&lt;P&gt;while (!searchJob.IsDone)&lt;/P&gt;

&lt;P&gt;{&lt;/P&gt;

&lt;P&gt;try&lt;/P&gt;

&lt;P&gt;{&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Thread.Sleep(500);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;}&lt;BR /&gt;
   catch (Exception ex)&lt;BR /&gt;
   {&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;}&lt;/P&gt;

&lt;P&gt;I am getting the following exception while trying to execute &lt;STRONG&gt;while (!searchJob.IsDone)&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;System.Net.WebException: The request was aborted: The request was canceled.     at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)     at System.Xml.XmlTextReaderImpl.ReadData()     at System.Xml.XmlTextReaderImpl.ParseText(Int32&amp;amp; startPos, Int32&amp;amp; endPos, Int32&amp;amp; outOrChars)     at System.Xml.XmlTextReaderImpl.ParseText()     at System.Xml.XmlTextReaderImpl.ParseElementContent()     at System.Xml.XmlTextReaderImpl.Read()     at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)     at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)     at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)     at System.Xml.XmlDocument.Load(XmlReader reader)     at System.Xml.XmlDocument.Load(Stream inStream)     at Splunk.AtomEntry.Parse(Stream input)     at Splunk.Job.Refresh()     at Splunk.Job.get_IsDone()     at SplunkDataPull.FetchData.Fetchdata()&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Note:The issues is not occurring every time.Few runs are running without any issues few runs are throwing this exception.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Please help&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2014 08:58:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/C-SDK-exception-System-Net-WebException-The-request-was-aborted/m-p/130622#M1856</guid>
      <dc:creator>ykmohank</dc:creator>
      <dc:date>2014-01-30T08:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: C# SDK exception : System.Net.WebException: The request was aborted: The request was canceled.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/C-SDK-exception-System-Net-WebException-The-request-was-aborted/m-p/130623#M1857</link>
      <description>&lt;P&gt;I had same problem. Solution was to repair .net 4.0 installation on server where application was installed.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2014 13:10:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/C-SDK-exception-System-Net-WebException-The-request-was-aborted/m-p/130623#M1857</guid>
      <dc:creator>MaverickT</dc:creator>
      <dc:date>2014-02-13T13:10:00Z</dc:date>
    </item>
  </channel>
</rss>

