thank you for answering I tried with client request but it still does not work I don’t know if it’s possible to always use xhttprequest without having the problem of cors here is what I send with client request
var us="";
var pas="";
var headers = {
"Authorization": "Basic <%= "+us+" + ':' + "+pas+" %>",
"Content-Type":"text/xml, application/xml",
"X-Requested-With": "XMLHttpRequest",
"Access-Control-Allow-Origin":"*",
"Access-Control-Allow-Methods": "HEAD, GET, POST, PUT, PATCH, DELETE",
"Access-Control-Allow-Headers": "X_Token,Origin, Content-Type, X-Auth-Token,Authorization"
};
var options = { headers: headers ,body:dataClientUr, mode: "no-cors" };
var url = "https://kong.u.cafein.isge49.com/ur/gemo/CustomerEngineService";
client.request.post(url, options).then(
function(data) {
console.log("///// data",data);
},
function(error) {
console.log("///// error",error);
}
);
we notice that it was sent in json but it must be sent on soap
1. {action: "execute",…}
1. action: "execute"
2. data: {headers: {Authorization: "Basic <%= + ':' + %>",…},…}
1. body: "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:cus=\"http://com/cylande/unitedretail/customer/service/common/CustomerEngineService/\"> <soapenv:Header/> <soapenv:Body> <cus:findCustomer> <!--Optional:--> <pCriteriaListType> <parameter> <size>20</size> </parameter> <list> <mailCrit> <email> <equals>etpcs@eram.fr</equals> </email> </mailCrit> <deletionTime> <manageNull>true</manageNull> </deletionTime> <issuedInSupport/> <modificationSupport/> <mainSupport/> </list> </pCriteriaListType> <pScenario> <manageMainLoyaltyId>true</manageMainLoyaltyId> <manageLoyaltyAccounts>true</manageLoyaltyAccounts> <manageMedia>true</manageMedia> <manageDatas>true</manageDatas> <manageCustomerLinkedPersons>true</manageCustomerLinkedPersons> </pScenario> <pContext> <businessUnit>151</businessUnit> <businessFunction>MANCUS</businessFunction> <language>FR</language> </pContext> </cus:findCustomer> </soapenv:Body> </soapenv:Envelope>"
2. headers: {Authorization: "Basic <%= "username" + ':' + "pssword" %>",…}
3. method: "post"
4. mode: "no-cors"
5. url: "https://kong.u.cafein.isge49.com/ur/gemo/CustomerEngineService"
here is the problem that comes back to me
error
1. {response: 'Error while substituting the templates', status: 400, headers: {…}, errorSource: 'APP'}
1. errorSource: "APP"
2. headers: {}
3. response: "Error while substituting the templates"
4. status: 400
5. [[Prototype]]: Object