Getting this response when I try to post a cancel using the JAVA ARB API in the Sanbox but it works fine production....
<HTML><HEAD>
<TITLE>Invalid URL</TITLE>
</HEAD><BODY>
<H1>Invalid URL</H1>
The requested URL "/xml/v1/request.api", is invalid.<p>
Reference #9.26f7f648.1430961437.1721bea6
</BODY></HTML>
End point is: https://apitest.authorize.net/xml/v1/request.api
Request is:
<?xml version="1.0"?>
<ARBCancelSubscriptionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>xxxx</name>
<transactionKey>xxxx</transactionKey>
</merchantAuthentication>
<subscriptionId>2399775</subscriptionId>
</ARBCancelSubscriptionRequest>
Could this be related to the SSL key upgrade?
05-06-2015 06:24 PM
Can you go to the https://apitest.authorize.net/xml/v1/request.api on a web browser on the pc/server that you are trying to run the sandbox code?
05-07-2015 04:15 AM
05-07-2015 05:16 AM
I don't see any SSL errors on the browser. I see the lock.
05-07-2015 05:16 AM
The error have the url encoded in HTML?
The requested URL "/xml/v1/request.api", is invalid.
instead of
The requested URL "/xml/v1/request.api", is invalid.
05-07-2015 05:45 AM
Thats the response coming back from your servers. I'm using the JAVA ARB and have changed nothing except adding logging.
If I switch the url to https://api.authorize.net/xml/v1/request.api
Everything works fine.
public BasicXmlDocument sendRequest(BasicXmlDocument request_document){
BasicXmlDocument response = null;
result_code = null;
messages.clear();
String in_response = http_util.postUrl(request_document.dump());
System.out.println("Response-XML::\n" + request_document.dump());
if(in_response == null) return null;
int mark = in_response.indexOf("<?xml");
if(mark == -1){
System.out.println("Invalid response");
System.out.println(in_response);
return null;
}
response = new BasicXmlDocument();
response.parseString(in_response.substring(mark,in_response.length()));
// System.out.println("Response-XML::\n" + response.dump());
if(response.IsAccessible() == false){
System.out.println("Invalid response");
System.out.println(in_response);
return null;
}
/*
try{
FileOutputStream fos = new FileOutputStream("out.xml",true);
fos.write(in_response.getBytes());
}
catch(Exception e){
System.out.println(e);
}
*/
current_response = response;
importResponseMessages();
return response;
}
05-07-2015 07:28 AM
Might need to use some http traffic logger like fiddler to see what you sending exactly, and what was the response are.
the XML url shouldn't be response a HTML page. something is not working, could be a bad request. are you setting the xml type / request length?
05-07-2015 09:18 AM - edited 05-07-2015 09:22 AM
I'm using the JAVA ARB API, so the API code is setting those flags and as far as I can tell it looks correct. Is anybody else having trouble with the java api?
Here is the method for the API.
private String doSocketTransfer(Socket socket, String path, String post_data) throws IOException {
String line;
StringBuffer sb = new StringBuffer();
String method = "GET";
if (post_data != null)
method = "POST";
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
out.write(method + " " + path + " HTTP/1.0\n");
if (post_data != null) {
out.write("Content-Length: " + Integer.toString(post_data.length()) + "\n");
out.write("Content-Type: text/xml; charset=\"utf-8\"\n");
}
out.write("\n");
if (post_data != null) {
out.write(post_data);
}
out.flush();
while ((line = in.readLine()) != null) {
sb.append(line + "\r\n");
}
out.close();
in.close();
socket.close();
return sb.toString();
}
05-08-2015 05:23 AM
Is there a solution for this issue? We are running into this same issue on Sandbox testing for ARB.
We made sure the below things:
1. Our keystore has GeoTrust_Global_CA
2. Uses SHA-256
3. Solution does not connect directly to auth.net using ip address
4. Not blocking external connections through firewall
Is there anything else to check? Below are some other things tried:
1. Set Java to not DNS cache by editing the java.security file and setting "networkaddress.cache.ttl" to 0 instead of chaching forever by default. Tried this to avoid java connecting to a static ip as Auth.net seems to have switched to serving from CDN instead of from static ip's.
2. Restarted JVM with parameter to not cache "-Dsun.net.inetaddr.ttl=10"
3. Used 8.8.8.8 in resolv.conf to have Google resolve DNS.
06-24-2015 08:41 AM
Do you get the 400 error when you put the url in a browser windows?
06-24-2015 08:47 AM