<?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 Re: NullReferenceException when using Transaction Details API via C# in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/NullReferenceException-when-using-Transaction-Details-API-via-C/m-p/13906#M8250</link>
    <description>&lt;P&gt;I am see this same problem - I am getting a null reference error everytime I call GetTransactionList.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the trace:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;System.NullReferenceException: Object reference not set to an instance of an object.&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at AuthorizeNet.Batch.NewFromResponse(getSettledBatchListResponse batches)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at AuthorizeNet.ReportingGateway.GetSettledBatchList(DateTime from, DateTime to, Boolean includeStats)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at AuthorizeNet.ReportingGateway.GetTransactionList(DateTime from, DateTime to)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My system is not in test mode and the transaction detail API is on.&amp;nbsp; There is only one transaction, unseltted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is kind of a shower stopper.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2011 23:47:51 GMT</pubDate>
    <dc:creator>nhustak</dc:creator>
    <dc:date>2011-06-22T23:47:51Z</dc:date>
    <item>
      <title>NullReferenceException when using Transaction Details API via C#</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/NullReferenceException-when-using-Transaction-Details-API-via-C/m-p/11604#M7233</link>
      <description>&lt;P&gt;Code to reproduce the exception (built against the latest version of the C# SDK):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var reportingGateway = new ReportingGateway("-- your api login id --", "-- your transaction key --", ServiceMode.Live);
var batches = reportingGateway.GetSettledBatchList();&lt;/PRE&gt;&lt;P&gt;I rebuilt the SDK from the provided source code, and figured out that the problem is in one two places.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first possible fix is In &lt;FONT face="'courier new', courier"&gt;ReportingGateway::GetSettledBatchList&lt;/FONT&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        public List GetSettledBatchList(DateTime from, DateTime to) {
            var req = new getSettledBatchListRequest();
            req.firstSettlementDate = from;
            req.lastSettlementDate = to;
            req.includeStatistics = true;
            var response = (getSettledBatchListResponse)_gateway.Send(req);

            return Batch.NewFromResponse(response);
        }&lt;/PRE&gt;&lt;P&gt;This method is missing assignments to the &lt;FONT face="'courier new', courier"&gt;*Specified&lt;/FONT&gt; properties that exist on &lt;FONT face="'courier new', courier"&gt;getSettledBatchRequest &lt;/FONT&gt;(see&amp;nbsp;&lt;A rel="nofollow" href="http://msdn.microsoft.com/en-us/library/bb402199.aspx" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/bb402199.aspx&lt;/A&gt;). Modifying this method to set each of the &lt;FONT face="'courier new', courier"&gt;*Specified&lt;/FONT&gt; properties to true fixes the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The other possible fix is to remove the &lt;FONT face="'courier new', courier"&gt;*Specified&lt;/FONT&gt; properties from&amp;nbsp;&lt;FONT face="'courier new', courier"&gt;getSettledBatchRequest&lt;/FONT&gt;. The code for that class is currently:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    /// 
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "AnetApi/xml/v1/schema/AnetApiSchema.xsd")]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "AnetApi/xml/v1/schema/AnetApiSchema.xsd", IsNullable = false)]
    public partial class getSettledBatchListRequest : ANetApiRequest {

        private bool includeStatisticsField;

        private bool includeStatisticsFieldSpecified;

        private System.DateTime firstSettlementDateField;

        private bool firstSettlementDateFieldSpecified;

        private System.DateTime lastSettlementDateField;

        private bool lastSettlementDateFieldSpecified;

        /// 
        public bool includeStatistics {
            get {
                return this.includeStatisticsField;
            }
            set {
                this.includeStatisticsField = value;
            }
        }

        /// 
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool &lt;U&gt;&lt;STRONG&gt;includeStatisticsSpecified &lt;/STRONG&gt;&lt;/U&gt;{
            get {
                return this.includeStatisticsFieldSpecified;
            }
            set {
                this.includeStatisticsFieldSpecified = value;
            }
        }

        /// 
        public System.DateTime firstSettlementDate {
            get {
                return this.firstSettlementDateField;
            }
            set {
                this.firstSettlementDateField = value;
            }
        }

        /// 
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool &lt;STRONG&gt;&lt;U&gt;firstSettlementDateSpecified &lt;/U&gt;&lt;/STRONG&gt;{
            get {
                return this.firstSettlementDateFieldSpecified;
            }
            set {
                this.firstSettlementDateFieldSpecified = value;
            }
        }

        /// 
        public System.DateTime lastSettlementDate {
            get {
                return this.lastSettlementDateField;
            }
            set {
                this.lastSettlementDateField = value;
            }
        }

        /// 
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool &lt;STRONG&gt;&lt;U&gt;lastSettlementDateSpecified &lt;/U&gt;&lt;/STRONG&gt;{
            get {
                return this.lastSettlementDateFieldSpecified;
            }
            set {
                this.lastSettlementDateFieldSpecified = value;
            }
        }
    }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing it to the following (just removing those &lt;FONT face="'courier new', courier"&gt;*Specified&lt;/FONT&gt; properties) fixes the issue and the SDK works as expected:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    /// 
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "AnetApi/xml/v1/schema/AnetApiSchema.xsd")]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "AnetApi/xml/v1/schema/AnetApiSchema.xsd", IsNullable = false)]
    public partial class getSettledBatchListRequest : ANetApiRequest {

        private bool includeStatisticsField;

        private bool includeStatisticsFieldSpecified;

        private System.DateTime firstSettlementDateField;

        private bool firstSettlementDateFieldSpecified;

        private System.DateTime lastSettlementDateField;

        private bool lastSettlementDateFieldSpecified;

        /// 
        public bool includeStatistics {
            get {
                return this.includeStatisticsField;
            }
            set {
                this.includeStatisticsField = value;
            }
        }

		/// 
        public System.DateTime firstSettlementDate {
            get {
                return this.firstSettlementDateField;
            }
            set {
                this.firstSettlementDateField = value;
            }
        }

        /// 
        public System.DateTime lastSettlementDate {
            get {
                return this.lastSettlementDateField;
            }
            set {
                this.lastSettlementDateField = value;
            }
        }
    }&lt;/PRE&gt;&lt;P&gt;I am currenlty using a modified version of the SDK in which I removed the &lt;FONT face="'courier new', courier"&gt;*Specified&lt;/FONT&gt; properties from the &lt;FONT face="'courier new', courier"&gt;getSettledBatchListRequest&lt;/FONT&gt; class. However this is not ideal; I would prefer to be using the SDK as provided by Authorize.Net without any modifications.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2011 23:33:36 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/NullReferenceException-when-using-Transaction-Details-API-via-C/m-p/11604#M7233</guid>
      <dc:creator>nickaceves</dc:creator>
      <dc:date>2011-03-28T23:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: NullReferenceException when using Transaction Details API via C#</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/NullReferenceException-when-using-Transaction-Details-API-via-C/m-p/11750#M7306</link>
      <description>&lt;P&gt;Hey there, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We need a little more information to try and figure out what's going on. For instance, what exactly are you trying to do, where is the error
happening, and what's the stack trace?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Michelle&lt;/P&gt;
&lt;P&gt;Developer Community Manager&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2011 19:46:07 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/NullReferenceException-when-using-Transaction-Details-API-via-C/m-p/11750#M7306</guid>
      <dc:creator>Michelle</dc:creator>
      <dc:date>2011-04-05T19:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: NullReferenceException when using Transaction Details API via C#</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/NullReferenceException-when-using-Transaction-Details-API-via-C/m-p/13906#M8250</link>
      <description>&lt;P&gt;I am see this same problem - I am getting a null reference error everytime I call GetTransactionList.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the trace:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;System.NullReferenceException: Object reference not set to an instance of an object.&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at AuthorizeNet.Batch.NewFromResponse(getSettledBatchListResponse batches)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at AuthorizeNet.ReportingGateway.GetSettledBatchList(DateTime from, DateTime to, Boolean includeStats)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at AuthorizeNet.ReportingGateway.GetTransactionList(DateTime from, DateTime to)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My system is not in test mode and the transaction detail API is on.&amp;nbsp; There is only one transaction, unseltted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is kind of a shower stopper.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2011 23:47:51 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/NullReferenceException-when-using-Transaction-Details-API-via-C/m-p/13906#M8250</guid>
      <dc:creator>nhustak</dc:creator>
      <dc:date>2011-06-22T23:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: NullReferenceException when using Transaction Details API via C#</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/NullReferenceException-when-using-Transaction-Details-API-via-C/m-p/13908#M8251</link>
      <description>&lt;P&gt;Ok I see it looks like there's a new SDK to fix this.&amp;nbsp; NM&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2011 23:52:21 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/NullReferenceException-when-using-Transaction-Details-API-via-C/m-p/13908#M8251</guid>
      <dc:creator>nhustak</dc:creator>
      <dc:date>2011-06-22T23:52:21Z</dc:date>
    </item>
  </channel>
</rss>

