<?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: using SDK on sendbox and getting: An existing connection was forcibly closed by the remote host in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/using-SDK-on-sendbox-and-getting-An-existing-connection-was/m-p/64494#M38375</link>
    <description>&lt;P&gt;One quick sanity check would be to pull down the sample C# project and run that (should only take a minute) to confirm that is working on your machine/environment.&amp;nbsp; It's here : &lt;A href="https://github.com/AuthorizeNet/sample-code-csharp" target="_blank"&gt;https://github.com/AuthorizeNet/sample-code-csharp&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let us know how that goes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Brian&lt;/P&gt;</description>
    <pubDate>Thu, 13 Sep 2018 13:46:07 GMT</pubDate>
    <dc:creator>brianmc</dc:creator>
    <dc:date>2018-09-13T13:46:07Z</dc:date>
    <item>
      <title>using SDK on sendbox and getting: An existing connection was forcibly closed by the remote host</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/using-SDK-on-sendbox-and-getting-An-existing-connection-was/m-p/64480#M38364</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just downloaded C# sdk and I am running as web app on VS 2017. Windows Server 2008 R2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting the error :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;System.Net.WebException: 'The underlying connection was closed: An unexpected error occurred on a receive.'&lt;/P&gt;&lt;P&gt;SocketException: An existing connection was forcibly closed by the remote host'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I saw some other messages here in relation to a similar error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added the code :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;var request = new createTransactionRequest { transactionRequest = transactionRequest };&lt;BR /&gt;&lt;BR /&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But nothing works. I am just sending test values to the Sandbox server, but nothing works&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;protected ANetApiResponse ChargeCard(String ApiLoginID, String ApiTransactionKey, decimal amount)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;ApiOperationBase&amp;lt;ANetApiRequest, ANetApiResponse&amp;gt;.RunEnvironment = AuthorizeNet.Environment.SANDBOX;&lt;/P&gt;&lt;P&gt;// define the merchant information (authentication / transaction id)&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 = ApiTransactionKey,&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;var creditCard = new creditCardType&lt;BR /&gt;{&lt;BR /&gt;cardNumber = "4111111111111111",&lt;BR /&gt;expirationDate = "0725",&lt;BR /&gt;cardCode = "123"&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;var billingAddress = new customerAddressType&lt;BR /&gt;{&lt;BR /&gt;firstName = "John",&lt;BR /&gt;lastName = "Doe",&lt;BR /&gt;address = "123 My St",&lt;BR /&gt;city = "OurTown",&lt;BR /&gt;zip = "98004"&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;//standard api call to retrieve response&lt;BR /&gt;var paymentType = new paymentType { Item = creditCard };&lt;/P&gt;&lt;P&gt;// Add line Items&lt;BR /&gt;var lineItems = new lineItemType[2];&lt;BR /&gt;lineItems[0] = new lineItemType { itemId = "1", name = "t-shirt", quantity = 2, unitPrice = new Decimal(15.00) };&lt;BR /&gt;lineItems[1] = new lineItemType { itemId = "2", name = "snowboard", quantity = 1, unitPrice = new Decimal(450.00) };&lt;/P&gt;&lt;P&gt;var transactionRequest = new transactionRequestType&lt;BR /&gt;{&lt;BR /&gt;transactionType = transactionTypeEnum.authCaptureTransaction.ToString(), // charge the card&lt;/P&gt;&lt;P&gt;amount = amount,&lt;BR /&gt;payment = paymentType,&lt;BR /&gt;billTo = billingAddress,&lt;BR /&gt;lineItems = lineItems&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;&lt;/STRONG&gt;&lt;BR /&gt;var request = new createTransactionRequest { transactionRequest = transactionRequest };&lt;BR /&gt;&lt;BR /&gt;// instantiate the controller that will call the service&lt;BR /&gt;var controller = new createTransactionController(request);&lt;BR /&gt;&lt;STRONG&gt;controller.Execute();&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&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;{SocketException: An existing connection was forcibly closed by the remote host&lt;/P&gt;&lt;P&gt;if (response.messages.resultCode == messageTypeEnum.Ok)&lt;BR /&gt;{&lt;BR /&gt;if(response.transactionResponse.messages != null)&lt;BR /&gt;{&lt;BR /&gt;Response.Write("Successfully created transaction with Transaction ID: " + response.transactionResponse.transId);&lt;BR /&gt;Response.Write("&amp;lt;br&amp;gt;");&lt;BR /&gt;Response.Write("Response Code: " + response.transactionResponse.responseCode);&lt;BR /&gt;Response.Write("&amp;lt;br&amp;gt;");&lt;BR /&gt;Response.Write("Message Code: " + response.transactionResponse.messages[0].code);&lt;BR /&gt;Response.Write("&amp;lt;br&amp;gt;");&lt;BR /&gt;Response.Write("Description: " + response.transactionResponse.messages[0].description);&lt;BR /&gt;Response.Write("&amp;lt;br&amp;gt;");&lt;BR /&gt;Response.Write("Success, Auth Code : " + response.transactionResponse.authCode);&lt;BR /&gt;Response.Write("&amp;lt;br&amp;gt;");&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Response.Write("Failed Transaction.");&lt;BR /&gt;if (response.transactionResponse.errors != null)&lt;BR /&gt;{&lt;BR /&gt;Response.Write("Error Code: " + response.transactionResponse.errors[0].errorCode);&lt;BR /&gt;Response.Write("Error message: " + response.transactionResponse.errors[0].errorText);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Response.Write("Failed Transaction.");&lt;BR /&gt;if (response.transactionResponse != null &amp;amp;&amp;amp; response.transactionResponse.errors != null)&lt;BR /&gt;{&lt;BR /&gt;Response.Write("Error Code: " + response.transactionResponse.errors[0].errorCode);&lt;BR /&gt;Response.Write("&amp;lt;br&amp;gt;");&lt;BR /&gt;Response.Write("Error message: " + response.transactionResponse.errors[0].errorText);&lt;BR /&gt;Response.Write("&amp;lt;br&amp;gt;");&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Response.Write("Error Code: " + response.messages.message[0].code);&lt;BR /&gt;Response.Write("&amp;lt;br&amp;gt;");&lt;BR /&gt;Response.Write("Error message: " + response.messages.message[0].text);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Response.Write("Null Response.");&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return response;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help ??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 11:36:55 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/using-SDK-on-sendbox-and-getting-An-existing-connection-was/m-p/64480#M38364</guid>
      <dc:creator>CRMAustralia201</dc:creator>
      <dc:date>2018-09-12T11:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: using SDK on sendbox and getting: An existing connection was forcibly closed by the remote host</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/using-SDK-on-sendbox-and-getting-An-existing-connection-was/m-p/64494#M38375</link>
      <description>&lt;P&gt;One quick sanity check would be to pull down the sample C# project and run that (should only take a minute) to confirm that is working on your machine/environment.&amp;nbsp; It's here : &lt;A href="https://github.com/AuthorizeNet/sample-code-csharp" target="_blank"&gt;https://github.com/AuthorizeNet/sample-code-csharp&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let us know how that goes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Brian&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 13:46:07 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/using-SDK-on-sendbox-and-getting-An-existing-connection-was/m-p/64494#M38375</guid>
      <dc:creator>brianmc</dc:creator>
      <dc:date>2018-09-13T13:46:07Z</dc:date>
    </item>
  </channel>
</rss>

