<?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 ECheque Error:  There was an error generating the XML document. in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ECheque-Error-There-was-an-error-generating-the-XML-document/m-p/62123#M36496</link>
    <description>&lt;P&gt;Below is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;&lt;BR /&gt;ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.RunEnvironment = UseSandbox ? AuthorizeNet.Environment.SANDBOX : AuthorizeNet.Environment.PRODUCTION;&lt;BR /&gt;ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.MerchantAuthentication = new merchantAuthenticationType()&lt;BR /&gt;{&lt;BR /&gt;name = ApiLoginID,&lt;BR /&gt;ItemElementName = ItemChoiceType.transactionKey,&lt;BR /&gt;Item = TransactionKey&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ECheckPayment eChequePayment = payment as ECheckPayment;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var bankAccount = new bankAccountType&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;accountType = bankAccountTypeEnum.checking,&lt;BR /&gt;routingNumber = eChequePayment.CheckRouting,&lt;BR /&gt;accountNumber = eChequePayment.CheckAccount,&lt;BR /&gt;nameOnAccount = eChequePayment.CardHolderName,&lt;BR /&gt;echeckType = echeckTypeEnum.WEB&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;// standard api call to retrieve response&lt;BR /&gt;var paymentType = new paymentType { Item = bankAccount };&lt;/P&gt;&lt;P&gt;var transactionRequest = new transactionRequestType&lt;BR /&gt;{&lt;BR /&gt;transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),&lt;BR /&gt;payment = paymentType,&lt;BR /&gt;amount = eChequePayment.Amount&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;var request = new createTransactionRequest { transactionRequest = transactionRequest };&lt;/P&gt;&lt;P&gt;// instantiate the controller that will call the service&lt;BR /&gt;var controller = new createTransactionController(request);&lt;BR /&gt;controller.Execute();&lt;/P&gt;&lt;P&gt;// get the response from the service (errors contained if any)&lt;BR /&gt;var response = controller.GetApiResponse();&lt;/P&gt;&lt;P&gt;// validate response&lt;BR /&gt;if (response != null)&lt;BR /&gt;{&lt;BR /&gt;if (response.messages.resultCode == messageTypeEnum.Ok)&lt;BR /&gt;{&lt;BR /&gt;if (response.transactionResponse.messages != null)&lt;BR /&gt;{&lt;BR /&gt;//Transaction ID and Transaction Code are the same&lt;BR /&gt;eChequePayment.TransactionID = response.transactionResponse.transId;&lt;BR /&gt;eChequePayment.ProviderTransactionID = response.refId;&lt;BR /&gt;eChequePayment.AuthorizationCode = response.transactionResponse.responseCode;&lt;BR /&gt;eChequePayment.ValidationCode = response.messages.message[0].code;&lt;BR /&gt;result = true;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Logger.GetLogger.Error("Failed Transaction.");&lt;BR /&gt;if (response.transactionResponse.errors != null)&lt;BR /&gt;{&lt;BR /&gt;Logger.GetLogger.Error("Error Code: " + response.transactionResponse.errors[0].errorCode);&lt;BR /&gt;Logger.GetLogger.Error("Error message: " + response.transactionResponse.errors[0].errorText);&lt;BR /&gt;throw new Exception("Error: " + response.transactionResponse.errors[0].errorCode + " " + response.transactionResponse.errors[0].errorText);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Logger.GetLogger.Error("Failed Transaction.");&lt;BR /&gt;if (response.transactionResponse != null &amp;amp;&amp;amp; response.transactionResponse.errors != null)&lt;BR /&gt;{&lt;BR /&gt;Logger.GetLogger.Error("Error Code: " + response.transactionResponse.errors[0].errorCode);&lt;BR /&gt;Logger.GetLogger.Error("Error message: " + response.transactionResponse.errors[0].errorText);&lt;BR /&gt;throw new Exception("Error: " + response.transactionResponse.errors[0].errorCode + " " + response.transactionResponse.errors[0].errorText);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Logger.GetLogger.Error("Error Code: " + response.messages.message[0].code);&lt;BR /&gt;Logger.GetLogger.Error("Error message: " + response.messages.message[0].text);&lt;BR /&gt;throw new Exception("Error: " + response.messages.message[0].code + " " + response.messages.message[0].text);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Logger.GetLogger.Error("Null Response.");&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;message = "Unexpected error encountered in AuthorizeDotNetEChequeGateway.ProcessPayment: " + ex.Message.ToString();&lt;BR /&gt;Logger.GetLogger.Error("Unexpected error encountered in AuthorizeDotNetEChequeGateway.ProcessPayment: " + ex.Message.ToString());&lt;BR /&gt;throw ex;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It gives me the below mentioned error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;There was an error generating the XML document.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the stack trace:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)&lt;BR /&gt;at AuthorizeNet.Util.HttpUtility.PostData[TQ,TS](Environment env, TQ request)&lt;BR /&gt;at AuthorizeNet.Api.Controllers.Bases.ApiOperationBase`2.Execute(Environment environment)&lt;BR /&gt;at AuthorizeDotNet.Gateways.Authorize.Net.ECheque.AuthorizeDotNetEChequeGateway.ProcessPayment(Payment payment, String&amp;amp; message)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone got a similar error/issue, any guidance on this will be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Mar 2018 23:04:48 GMT</pubDate>
    <dc:creator>sidu1987</dc:creator>
    <dc:date>2018-03-14T23:04:48Z</dc:date>
    <item>
      <title>ECheque Error:  There was an error generating the XML document.</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ECheque-Error-There-was-an-error-generating-the-XML-document/m-p/62123#M36496</link>
      <description>&lt;P&gt;Below is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;&lt;BR /&gt;ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.RunEnvironment = UseSandbox ? AuthorizeNet.Environment.SANDBOX : AuthorizeNet.Environment.PRODUCTION;&lt;BR /&gt;ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.MerchantAuthentication = new merchantAuthenticationType()&lt;BR /&gt;{&lt;BR /&gt;name = ApiLoginID,&lt;BR /&gt;ItemElementName = ItemChoiceType.transactionKey,&lt;BR /&gt;Item = TransactionKey&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ECheckPayment eChequePayment = payment as ECheckPayment;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var bankAccount = new bankAccountType&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;accountType = bankAccountTypeEnum.checking,&lt;BR /&gt;routingNumber = eChequePayment.CheckRouting,&lt;BR /&gt;accountNumber = eChequePayment.CheckAccount,&lt;BR /&gt;nameOnAccount = eChequePayment.CardHolderName,&lt;BR /&gt;echeckType = echeckTypeEnum.WEB&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;// standard api call to retrieve response&lt;BR /&gt;var paymentType = new paymentType { Item = bankAccount };&lt;/P&gt;&lt;P&gt;var transactionRequest = new transactionRequestType&lt;BR /&gt;{&lt;BR /&gt;transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),&lt;BR /&gt;payment = paymentType,&lt;BR /&gt;amount = eChequePayment.Amount&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;var request = new createTransactionRequest { transactionRequest = transactionRequest };&lt;/P&gt;&lt;P&gt;// instantiate the controller that will call the service&lt;BR /&gt;var controller = new createTransactionController(request);&lt;BR /&gt;controller.Execute();&lt;/P&gt;&lt;P&gt;// get the response from the service (errors contained if any)&lt;BR /&gt;var response = controller.GetApiResponse();&lt;/P&gt;&lt;P&gt;// validate response&lt;BR /&gt;if (response != null)&lt;BR /&gt;{&lt;BR /&gt;if (response.messages.resultCode == messageTypeEnum.Ok)&lt;BR /&gt;{&lt;BR /&gt;if (response.transactionResponse.messages != null)&lt;BR /&gt;{&lt;BR /&gt;//Transaction ID and Transaction Code are the same&lt;BR /&gt;eChequePayment.TransactionID = response.transactionResponse.transId;&lt;BR /&gt;eChequePayment.ProviderTransactionID = response.refId;&lt;BR /&gt;eChequePayment.AuthorizationCode = response.transactionResponse.responseCode;&lt;BR /&gt;eChequePayment.ValidationCode = response.messages.message[0].code;&lt;BR /&gt;result = true;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Logger.GetLogger.Error("Failed Transaction.");&lt;BR /&gt;if (response.transactionResponse.errors != null)&lt;BR /&gt;{&lt;BR /&gt;Logger.GetLogger.Error("Error Code: " + response.transactionResponse.errors[0].errorCode);&lt;BR /&gt;Logger.GetLogger.Error("Error message: " + response.transactionResponse.errors[0].errorText);&lt;BR /&gt;throw new Exception("Error: " + response.transactionResponse.errors[0].errorCode + " " + response.transactionResponse.errors[0].errorText);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Logger.GetLogger.Error("Failed Transaction.");&lt;BR /&gt;if (response.transactionResponse != null &amp;amp;&amp;amp; response.transactionResponse.errors != null)&lt;BR /&gt;{&lt;BR /&gt;Logger.GetLogger.Error("Error Code: " + response.transactionResponse.errors[0].errorCode);&lt;BR /&gt;Logger.GetLogger.Error("Error message: " + response.transactionResponse.errors[0].errorText);&lt;BR /&gt;throw new Exception("Error: " + response.transactionResponse.errors[0].errorCode + " " + response.transactionResponse.errors[0].errorText);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Logger.GetLogger.Error("Error Code: " + response.messages.message[0].code);&lt;BR /&gt;Logger.GetLogger.Error("Error message: " + response.messages.message[0].text);&lt;BR /&gt;throw new Exception("Error: " + response.messages.message[0].code + " " + response.messages.message[0].text);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Logger.GetLogger.Error("Null Response.");&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;message = "Unexpected error encountered in AuthorizeDotNetEChequeGateway.ProcessPayment: " + ex.Message.ToString();&lt;BR /&gt;Logger.GetLogger.Error("Unexpected error encountered in AuthorizeDotNetEChequeGateway.ProcessPayment: " + ex.Message.ToString());&lt;BR /&gt;throw ex;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It gives me the below mentioned error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;There was an error generating the XML document.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the stack trace:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)&lt;BR /&gt;at AuthorizeNet.Util.HttpUtility.PostData[TQ,TS](Environment env, TQ request)&lt;BR /&gt;at AuthorizeNet.Api.Controllers.Bases.ApiOperationBase`2.Execute(Environment environment)&lt;BR /&gt;at AuthorizeDotNet.Gateways.Authorize.Net.ECheque.AuthorizeDotNetEChequeGateway.ProcessPayment(Payment payment, String&amp;amp; message)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone got a similar error/issue, any guidance on this will be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 23:04:48 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ECheque-Error-There-was-an-error-generating-the-XML-document/m-p/62123#M36496</guid>
      <dc:creator>sidu1987</dc:creator>
      <dc:date>2018-03-14T23:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: ECheque Error:  There was an error generating the XML document.</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ECheque-Error-There-was-an-error-generating-the-XML-document/m-p/62124#M36497</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/23690"&gt;@sidu1987&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you checked out our sample code for it&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/AuthorizeNet/sample-code-csharp/blob/master/PaymentTransactions/DebitBankAccount.cs" target="_blank"&gt;https://github.com/AuthorizeNet/sample-code-csharp/blob/master/PaymentTransactions/DebitBankAccount.cs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps !!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 04:36:15 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ECheque-Error-There-was-an-error-generating-the-XML-document/m-p/62124#M36497</guid>
      <dc:creator>Anurag</dc:creator>
      <dc:date>2018-03-15T04:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: ECheque Error:  There was an error generating the XML document.</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ECheque-Error-There-was-an-error-generating-the-XML-document/m-p/62131#M36502</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/21382"&gt;@Anurag&lt;/a&gt;, thank you for looking into my issue. The code above is the same as the sample piece that you provided. Do I need to change any setting for ECheque which I am missing in my case.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 13:47:04 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ECheque-Error-There-was-an-error-generating-the-XML-document/m-p/62131#M36502</guid>
      <dc:creator>sidu1987</dc:creator>
      <dc:date>2018-03-15T13:47:04Z</dc:date>
    </item>
  </channel>
</rss>

