Skip to content

Instantly share code, notes, and snippets.

@samilkahraman
Last active December 6, 2022 12:43
Show Gist options
  • Save samilkahraman/fff61d2a7586002db6412948c4cecf11 to your computer and use it in GitHub Desktop.
Save samilkahraman/fff61d2a7586002db6412948c4cecf11 to your computer and use it in GitHub Desktop.
NodeJS ile Aras Kargo API'lerinin Kullanımı
const soap = require("soap");
const url =
"http://customerservices.araskargo.com.tr/ArasCargoCustomerIntegrationService/ArasCargoIntegrationService.svc?wsdl";
//Esasweb uzerinden alinan bilgiler
const loginInfo =
"<LoginInfo>" +
"<UserName>samilkahraman</UserName>" +
"<Password>sifre</Password>" +
"<CustomerCode>123456789musterino</CustomerCode>" +
"</LoginInfo>";
//QueryInfo için dökümantasyonda 2 numaralı örneği seçtim. 7 Aralık Tarihinde gönderilen bütün kargoları listelemekte
let queryInfo =
"<QueryInfo>" +
"<QueryType>2</QueryType>" +
"<Date>07/12/2020</Date>" +
"</QueryInfo>";
const args = {
loginInfo: loginInfo,
queryInfo: queryInfo,
};
let client;
(async () => {
client = await soap.createClientAsync(url);
console.log(client);
client.ArasCargoIntegrationService.BasicHttpBinding_IArasCargoIntegrationService.GetQueryJSON(
args,
(err, response) => {
if (err) console.error(err);
else {
console.log(response);
// cevap = { GetQueryJSONResult: '{"QueryResult":{"Cargo":[{"MUSTERI_KODU"......}]}}' }
}
}
);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment