Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cekStockDetail(productId){
- var taskName = "system";
- var serviceName = "getDetailProductById";
- // Calling other connector
- var authResult = JSON.parse(Mogaway.server.callProcedure("login", "doLogin", [ "whs4", "sts123" ]));
- if(authResult.result.status=='OK'){
- var request = {
- url: "/axis2/services/CommerceTaskService.CommerceTaskServiceHttpEndpoint/execute",
- method: "POST",
- contentType: "application/json",
- data: {
- result: {
- header: {
- sessionId: "" + Session.getId(),
- userLoginId: authResult.result.userId,
- roleLoginId: authResult.result.roleDefaultId,
- tenantLoginId: authResult.result.tenantId,
- tenantKey: authResult.result.tenantKey,
- secureKey: authResult.result.secureKey,
- datetime: "" + new com.wenresearch.mogaway.util.DateUtil.dateTimeNow(),
- taskName: taskName,
- serviceName: serviceName,
- http_remoteAddr: "127.0.0.1",
- http_remoteHost: "127.0.0.1",
- http_userAgent: "mogaway",
- http_remoteUser: null
- },
- payload: {
- productId: productId
- },
- version: "1.1"
- }
- }
- };
- return Mogaway.server.callHttp(request);
- } else {
- return authResult;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment