Skip to Content
0
Oct 23, 2020 at 01:01 PM

CF Fiori how consume SOAP API Service (Technical name: CostCentreReplicationBulkRequest_In)

233 Views

Hi to all,

I created a Fiori app in CF (and created his destination connection in the cockpit) that consume an ODATA services (these data is showed in a table, and they will be modified by the user); once the data was modified (for then, the destination is the same), I have to update them throw the SOAP API CostCentreReplicationBulkRequest_In. Currently, I add the URL, User and Password values as constant, but the navigator is returning me this message error and i don't know why:

XS-APP.JSON

Manifest.JSON

View Controller Code for AJAX:

$.ajax({

contentType:"text/xml; charset=\"utf-8\"",

url:uri,

method:"POST",

dataType:"xml",

data:oXMLData,

async: false,

cache: false,

crossDomain: false,

processData: false,

xhrFields: { withCredentials: true },

beforeSend: function (req) {

// req.setRequestHeader('Authorization', 'Basic ' + btoa(user + ":" + pwd));

// req.setRequestHeader('Access-Control-Allow-Origin', '*'); },

headers: {

"Authorization": "Basic " + btoa(encodeURIComponent(user) + ":" + encodeURIComponent(pwd)),

"Access-Control-Allow-Origin":"*",

"Accept":"application/atom+xml,application/atomsvc+xml,application/xml",

"X-Requested-With":"XMLHttpRequest",

"DataServiceVersion":"2.0" },

//username:user,

//password:pwd,

success: function (data, textStatus, jqXHR) {

var response = data;

console.log(response);

console.log("Is a success!");

},

error: function (data, xhr, status) {

console.log("data:", data);

console.log("Error: : " + status);

},

complete: function (xhr, status) {

console.log(xhr);

});

My doubts ares:

- How have I to adjust the datasourse and model in the manifest.json to customize correctly as SOAP model?

- How get the model data and use in the Ajax Call?

- Is better to use xmlhttprequest object instead Ajax?

Best regards and thank you for your attention.


Luis Ancona

Attachments

w5xkh.png (32.7 kB)
sl4ai.png (35.0 kB)
yq8u5.png (32.1 kB)
oro6r.png (28.5 kB)
jyebn.png (29.9 kB)