Servizio per l’interrogazione dello stato di una richiesta
curl -X POST https://demows.fatturazioneelettronica.aruba.it/services/ClientRequest/GetTransmissionInfoRequest?username=Utente&password=Password \
-H 'Accept: application/json' \
-H 'Content-Type: application/json;charset=UTF-8' \
-d '{
"userName" : "Utente",
"password" : "Password",
"requestID" : "Z68Q7T4KZ3"
}'
integer li_rc
oleobject loo_Rest
integer li_Success
integer li_BTls
integer li_Port
integer li_BAutoReconnect
oleobject loo_Json
oleobject loo_SbRequestBody
oleobject loo_SbResponseBody
integer li_RespStatusCode
oleobject loo_JsonResponse
string ls_Result
string ls_Error
string ls_NotifyResult
string ls_ElaboratedResult
string ls_ReceiptTimestamp
string ls_FileID
string ls_FileName
loo_Rest = create oleobject
li_rc = loo_Rest.ConnectToNewObject("Chilkat_9_5_0.Rest")
if li_rc < 0 then
destroy loo_Rest
MessageBox("Error","Connecting to COM object failed")
return
end if
// URL: https://demows.fatturazioneelettronica.aruba.it/services/ClientRequest/GetTransmissionInfoRequest?username=Utente&password=Password
li_BTls = 1
li_Port = 443
li_BAutoReconnect = 1
li_Success = loo_Rest.Connect("demows.fatturazioneelettronica.aruba.it",li_Port,li_BTls,li_BAutoReconnect)
if li_Success <> 1 then
Write-Debug "ConnectFailReason: " + string(loo_Rest.ConnectFailReason)
Write-Debug loo_Rest.LastErrorText
destroy loo_Rest
return
end if
// See the Online Tool for Generating JSON Creation Code
loo_Json = create oleobject
li_rc = loo_Json.ConnectToNewObject("Chilkat_9_5_0.JsonObject")
loo_Json.UpdateString("userName","Utente")
loo_Json.UpdateString("password","Password")
loo_Json.UpdateString("requestID","Z68Q7T4KZ3")
loo_Rest.AddHeader("Content-Type","application/json;charset=UTF-8")
loo_Rest.AddHeader("Accept","application/json")
loo_SbRequestBody = create oleobject
li_rc = loo_SbRequestBody.ConnectToNewObject("Chilkat_9_5_0.StringBuilder")
loo_Json.EmitSb(loo_SbRequestBody)
loo_SbResponseBody = create oleobject
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat_9_5_0.StringBuilder")
li_Success = loo_Rest.FullRequestSb("POST","/services/ClientRequest/GetTransmissionInfoRequest?username=Utente&password=Password",loo_SbRequestBody,loo_SbResponseBody)
if li_Success <> 1 then
Write-Debug loo_Rest.LastErrorText
destroy loo_Rest
destroy loo_Json
destroy loo_SbRequestBody
destroy loo_SbResponseBody
return
end if
li_RespStatusCode = loo_Rest.ResponseStatusCode
if li_RespStatusCode >= 400 then
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
Write-Debug "Response Header:"
Write-Debug loo_Rest.ResponseHeader
Write-Debug "Response Body:"
Write-Debug loo_SbResponseBody.GetAsString()
destroy loo_Rest
destroy loo_Json
destroy loo_SbRequestBody
destroy loo_SbResponseBody
return
end if
loo_JsonResponse = create oleobject
li_rc = loo_JsonResponse.ConnectToNewObject("Chilkat_9_5_0.JsonObject")
loo_JsonResponse.LoadSb(loo_SbResponseBody)
// See the Online Tool for Generating JSON Parse Code
ls_Result = loo_JsonResponse.StringOf("result")
ls_Error = loo_JsonResponse.StringOf("error")
ls_NotifyResult = loo_JsonResponse.StringOf("notifyResult")
ls_ElaboratedResult = loo_JsonResponse.StringOf("elaboratedResult")
ls_ReceiptTimestamp = loo_JsonResponse.StringOf("receiptTimestamp")
ls_FileID = loo_JsonResponse.StringOf("fileID")
ls_FileName = loo_JsonResponse.StringOf("fileName")
destroy loo_Rest
destroy loo_Json
destroy loo_SbRequestBody
destroy loo_SbResponseBody
destroy loo_JsonResponse
{
"result": "SF01",
"error": "In elaborazione",
"notifyResult": "",
"elaboratedResult": "",
"receiptTimestamp": "2017-04-18 18:30:30",
"fileID": "0610103456",
"fileName": "ITAFUMBWJKFGU_LI_0001.xml"
}