Environment: Internet.
Protocol: HTTPS 1.1 (TLS 1.1 or higher).
Shipping method: POST.
Messages: Rest Service.
Encoding: UTF-8. The input is an XML that must conform to the following XSD input schema specification.
This is the config.json that I'm using after read the documentation of plugin:
- Code: Select all
TicketBAI: {
method: "post",
processType: "client",
params: {
url: "String", //web service url
inPath: "String", //xml file path to send
certPath: "String", //digital certificate path to use
certpasswordPath: "String" //path of the key of the digital certificate to use
},
return: {
file: "Path"
},
headers: {
Content-Type: "application/xml",
charset: "UTF-8",
Accept: "application/json"
}
}
And I'm calling it like this:
- Code: Select all
function envioTBAI98(myXml)
{
var sURL = "https://tbai-prep.egoitza.gipuzkoa.eus/WAS/HACI/HTBRecepcionFacturasWEB/rest/recepcionFacturas/alta"
plugins.Velocity.invokeService('TicketBAI',{url:sURL,inPath: 'C:\TMP\ficheroenviocurl.xml',certPath: 'D:\CERTIF_AG\cgagfnmt.pem', certpasswordPath: 'D:\CERTIF_AG\cgagfnmt_key.pem'}, callBack);
}
function callBack(result){
application.output('callback');
if (result) {
if (result.exception) {
application.output(result.exception, LOGGINGLEVEL.ERROR);
} else {
application.output(JSON.stringify(result));
}
}
}
but I must not be doing something right, I can't get it to run. I would be grateful if someone could help me and tell me the correct way to do it.