<?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: Java API - Null response when errors are thrown in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Java-API-Null-response-when-errors-are-thrown/m-p/64676#M38504</link>
    <description>&lt;P&gt;This is also happening when even a simple invalid credentials are supplied so&amp;nbsp;there is no way to capture any errors from Authorize.Net while using the API. I'm assuming it is working for others in this approach?&lt;/P&gt;</description>
    <pubDate>Thu, 04 Oct 2018 16:55:16 GMT</pubDate>
    <dc:creator>kschaller1979</dc:creator>
    <dc:date>2018-10-04T16:55:16Z</dc:date>
    <item>
      <title>Java API - Null response when errors are thrown</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Java-API-Null-response-when-errors-are-thrown/m-p/64668#M38496</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not getting any response programmically from Authorize.NET when my XML request is invalid. It is returning a null response object. I am using JDK 1.7.0_80 and&amp;nbsp;anet-java-sdk-1.9.7.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I copy the request I logged into a SoapUI Rest request and I find out I have XML parsing errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&amp;lt;ErrorResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"&amp;gt;&amp;lt;messages&amp;gt;&amp;lt;resultCode&amp;gt;Error&amp;lt;/resultCode&amp;gt;&amp;lt;message&amp;gt;&amp;lt;code&amp;gt;E00003&amp;lt;/code&amp;gt;&amp;lt;text&amp;gt;The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:invoiceNumber' element is invalid - The value &amp;amp;amp;#39;927-WR-896228-1364474&amp;amp;amp;#39; is invalid according to its datatype 'String' - The actual length is greater than the MaxLength value.&amp;lt;/text&amp;gt;&amp;lt;/message&amp;gt;&amp;lt;/messages&amp;gt;&amp;lt;/ErrorResponse&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is how I am generating the transaction:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CreateTransactionRequest request = new CreateTransactionRequest();

// the request I built
request.setTransactionRequest(transactionRequestType);

CreateTransactionController controller = new CreateTransactionController(request);
controller.execute();

response = controller.getApiResponse();

if(response != null)
{
// do something
}
else
{
// log no response
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why am I not getting any response from Java? I should be getting at least an error response.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 00:09:17 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Java-API-Null-response-when-errors-are-thrown/m-p/64668#M38496</guid>
      <dc:creator>kschaller1979</dc:creator>
      <dc:date>2018-10-04T00:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Java API - Null response when errors are thrown</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Java-API-Null-response-when-errors-are-thrown/m-p/64676#M38504</link>
      <description>&lt;P&gt;This is also happening when even a simple invalid credentials are supplied so&amp;nbsp;there is no way to capture any errors from Authorize.Net while using the API. I'm assuming it is working for others in this approach?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 16:55:16 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Java-API-Null-response-when-errors-are-thrown/m-p/64676#M38504</guid>
      <dc:creator>kschaller1979</dc:creator>
      <dc:date>2018-10-04T16:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Java API - Null response when errors are thrown</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Java-API-Null-response-when-errors-are-thrown/m-p/65471#M39136</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/26067"&gt;@kschaller1979&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SDK returns a ErrorResponse object instead of Response object in case of error while xsd validation, thus you will need to get the &lt;SPAN&gt;ErrorResponse&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;if Response is null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i.e&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;if(controller.getApiResponse() == null) -&amp;gt;&amp;nbsp;controller.getErrorResponse()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code should be something like this &lt;STRONG&gt;&lt;A href="https://github.com/AuthorizeNet/sample-code-java/blob/master/src/main/java/net/authorize/sample/CustomerProfiles/CreateCustomerProfile.java#L72-L79" target="_blank"&gt;sample&lt;/A&gt;&lt;/STRONG&gt;.&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;Happy Coding !&lt;/P&gt;&lt;P&gt;Kaushik&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2018 08:50:12 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Java-API-Null-response-when-errors-are-thrown/m-p/65471#M39136</guid>
      <dc:creator>kikmak42</dc:creator>
      <dc:date>2018-12-26T08:50:12Z</dc:date>
    </item>
  </channel>
</rss>

