Questo metodo deve essere utilizzato dall’OE per effettuare l’invio di una fattura nel formato XML e già firmata digitalmente secondo norme AGID, ovvero con estension .p7m e formato CAdES-BES (CMS Advanced Electronic Signatures).
curl -X POST https://demows.fatturazioneelettronica.aruba.it/services/invoice/uploadSigned \
-H 'Accept: application/json' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Authorization: Bearer NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE=' \
-d '{
"dataFile" : "dGVzdA=="
}'
Dim rest As New Chilkat.Rest
Dim success As Boolean
// URL: https://demows.fatturazioneelettronica.aruba.it/services/invoice/uploadSigned
Dim bTls As Boolean
bTls = True
Dim port As Int32
port = 443
Dim bAutoReconnect As Boolean
bAutoReconnect = True
success = rest.Connect("demows.fatturazioneelettronica.aruba.it",port,bTls,bAutoReconnect)
If (success <> True) Then
System.DebugLog("ConnectFailReason: " + Str(rest.ConnectFailReason))
System.DebugLog(rest.LastErrorText)
Return
End If
// See the Online Tool for Generating JSON Creation Code
Dim json As New Chilkat.JsonObject
success = json.UpdateString("dataFile","dGVzdA==")
success = rest.AddHeader("Content-Type","application/json;charset=UTF-8")
success = rest.AddHeader("Authorization","Bearer NLOGDVXLVaF3tzmnVPkTwpkuh7dG0i09uSCcog3u+rE=")
success = rest.AddHeader("Accept","application/json")
Dim sbRequestBody As New Chilkat.StringBuilder
success = json.EmitSb(sbRequestBody)
Dim sbResponseBody As New Chilkat.StringBuilder
success = rest.FullRequestSb("POST","/services/invoice/uploadSigned",sbRequestBody,sbResponseBody)
If (success <> True) Then
System.DebugLog(rest.LastErrorText)
Return
End If
Dim respStatusCode As Int32
respStatusCode = rest.ResponseStatusCode
If (respStatusCode >= 400) Then
System.DebugLog("Response Status Code = " + Str(respStatusCode))
System.DebugLog("Response Header:")
System.DebugLog(rest.ResponseHeader)
System.DebugLog("Response Body:")
System.DebugLog(sbResponseBody.GetAsString())
Return
End If
Dim jsonResponse As New Chilkat.JsonObject
success = jsonResponse.LoadSb(sbResponseBody)
// See the Online Tool for Generating JSON Parse Code
Dim errorCode As String
Dim errorDescription As String
Dim uploadFileName As String
errorCode = jsonResponse.StringOf("errorCode")
errorDescription = jsonResponse.StringOf("errorDescription")
uploadFileName = jsonResponse.StringOf("uploadFileName")
{
"errorCode": "",
"errorDescription": "",
"uploadFileName": "IT00499202641_kwefc.xml.p7m"
}