widana

Untitled

Feb 7th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function cekStockDetail(productId){
  2.  
  3.     var taskName = "system";
  4.     var serviceName = "getDetailProductById";
  5.  
  6.     // Calling other connector
  7.     var authResult = JSON.parse(Mogaway.server.callProcedure("login", "doLogin", [ "whs4", "sts123" ]));
  8.  
  9.     if(authResult.result.status=='OK'){
  10.         var request = {
  11.                 url: "/axis2/services/CommerceTaskService.CommerceTaskServiceHttpEndpoint/execute",
  12.                 method: "POST",
  13.                 contentType: "application/json",
  14.                 data: {
  15.                     result: {
  16.                         header: {
  17.                             sessionId: "" + Session.getId(),
  18.                             userLoginId: authResult.result.userId,
  19.                             roleLoginId: authResult.result.roleDefaultId,
  20.                             tenantLoginId: authResult.result.tenantId,
  21.                             tenantKey: authResult.result.tenantKey,
  22.                             secureKey: authResult.result.secureKey,
  23.                             datetime: "" + new com.wenresearch.mogaway.util.DateUtil.dateTimeNow(),
  24.                             taskName: taskName,
  25.                             serviceName: serviceName,
  26.                             http_remoteAddr: "127.0.0.1",
  27.                             http_remoteHost: "127.0.0.1",
  28.                             http_userAgent: "mogaway",
  29.                             http_remoteUser: null
  30.                         },
  31.                         payload: {
  32.                             productId: productId
  33.                         },
  34.                         version: "1.1"
  35.                     }
  36.                 }
  37.         };
  38.  
  39.         return Mogaway.server.callHttp(request);
  40.  
  41.     } else {
  42.         return authResult;
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment