The BatchStatisticType class has a bunch of boolean flags that seem to be redundant. For example, these two
private bool returnedItemAmountFieldSpecified;
private bool returnedItemAmountSpecified1Field;
are used to indicate whether “returnedItemAmountField” field is present or not. I understand that the API was developed before nullable value types where allowed in .NET, so at that time, “returnedItemAmountField” could not be declared like this:
private decimal? returnedItemAmountField;
That is fine, but my question is related to the two Boolean flags. One is called “***FieldSpecified” and the other one is called “***Specified1Field”. What’s the difference between the two?
01-28-2014 05:51 AM
I can't seem to find returnedItemAmountSpecified1Field is the C# dll solution.
01-28-2014 06:47 AM
I use my Sandbox account and therefore my Service Reference points to the test environment Authorize.Net exposes for developers. This is the URL configured in the service reference:
https://apitest.authorize.net/soap/v1/Service.asmx
When the service is added to the solution, a whole bunch of classes are brought in. This is how the "BatchStatisticType" class looks like after the import (I bolded the properties that are duplicates):
///<remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.18408")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace=https://api.authorize.net/soap/v1/)]
public partial classBatchStatisticType : object, System.ComponentModel.INotifyPropertyChanged {
private string accountTypeField;
private string currencyCodeField;
private decimal chargeAmountField;
private int chargeCountField;
private decimal refundAmountField;
private int refundCountField;
private int voidCountField;
private int declineCountField;
private int errorCountField;
private decimal returnedItemAmountField;
private bool returnedItemAmountFieldSpecified;
private bool returnedItemAmountSpecified1Field;
private int returnedItemCountField;
private bool returnedItemCountFieldSpecified;
private bool returnedItemCountSpecified1Field;
// I had to chop the resdt of the class because the message would have been to big.
Am I missing something? Do i use the wrong URL to create my service reference?
Thanks,
Eddie
01-29-2014 06:21 AM - edited 01-29-2014 06:23 AM
https://apitest.authorize.net/soap/v1/Service.asmx?wsdl
search on BatchStatisticType
Look like they use the returnedItemAmountSpecified or their definition,
and then .Net create it own copy for the minOccurs="0" maxOccurs="1" name="xyz" type="s:decimal"
01-29-2014 06:39 AM