Java
Java
Aruba Fatturazione Elettronica GetTransmissionInfoRequest
See more Aruba Fatturazione Examples
Query the status of a request.Chilkat Java Downloads
import com.chilkatsoft.*;
public class ChilkatExample {
static {
try {
System.loadLibrary("chilkat");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String argv[])
{
boolean success = false;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkHttp http = new CkHttp();
// Implements the following CURL command:
// curl -X POST https://ws.fatturazioneelettronica.aruba.it/services/ClientRequest/GetTransmissionInfoRequest \
// -H "Accept: application/json" \
// -H "Content-Type: application/json;charset=UTF-8" \
// -d '{
// "userName" : "ARUBA0000",
// "password" : "ArubaPwd",
// "requestID" : "UYZCDNDYKQ"
// }'
// Use the following online tool to generate HTTP code from a CURL command
// Convert a cURL Command to HTTP Source Code
// Use this online tool to generate code from sample JSON:
// Generate Code to Create JSON
// The following JSON is sent in the request body.
// {
// "userName": "ARUBA0000",
// "password": "ArubaPwd",
// "requestID": "UYZCDNDYKQ"
// }
CkJsonObject json = new CkJsonObject();
json.UpdateString("userName","ARUBA0000");
json.UpdateString("password","ArubaPwd");
json.UpdateString("requestID","UYZCDNDYKQ");
http.SetRequestHeader("Content-Type","application/json;charset=UTF-8");
http.SetRequestHeader("Accept","application/json");
CkHttpResponse resp = new CkHttpResponse();
success = http.HttpJson("POST","https://ws.fatturazioneelettronica.aruba.it/services/ClientRequest/GetTransmissionInfoRequest",json,"application/json",resp);
if (success == false) {
System.out.println(http.lastErrorText());
return;
}
CkStringBuilder sbResponseBody = new CkStringBuilder();
resp.GetBodySb(sbResponseBody);
CkJsonObject jResp = new CkJsonObject();
jResp.LoadSb(sbResponseBody);
jResp.put_EmitCompact(false);
System.out.println("Response Body:");
System.out.println(jResp.emit());
int respStatusCode = resp.get_StatusCode();
System.out.println("Response Status Code = " + respStatusCode);
if (respStatusCode >= 400) {
System.out.println("Response Header:");
System.out.println(resp.header());
System.out.println("Failed.");
}
else {
System.out.println("Success.");
}
}
}