Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 80307

Re: How to Write urn:nms:rtEvent in Javascript Activity

$
0
0

Hi rajadobedev

 

Something like

 

try {

 

 

logInfo("PREPARING SESSION");

 

 

  var cnx = new HttpSoapConnection("https://INSTANCEURL/nl/jsp/soaprouter.jsp");

  try {

    var session = new SoapService(cnx, 'urn:xtk:session');

    try {

      session.addMethod("Logon", "xtk:session#Logon",

          ["sessiontoken", "string", "Login", "string", "Password", "string", "Parameters", "NLElement"],

          ["sessionToken", "string", "sessionInfo", "NLElement", "securityToken", "string"]);

 

 

      logInfo("LOGION");

 

      var res = session.Logon("", "mc", "PASSWORD", <param/>);

 

 

      logInfo("RESPONSE: " + JSON.stringify(res));

 

 

      var sessionToken = res[0];

      var securityToken = res[2];

 

 

      cnx.addTokens(sessionToken, securityToken);

 

 

      logInfo("PREPARING EVENT PUSH");

 

 

 

 

      var event = new SoapService(cnx, 'urn:nms:rtEvent');

      try {

        event.addMethod("PushEvent", "nms:rtEvent#PushEvent",

            ["sessiontoken", "string", "domEvent", "NLElement"],

            ["plId", "NLRawXML"]);

 

 

        logInfo("PUSHING ENEVTN");

 

 

        var eventRes = event.PushEvent("",

          <rtEvent

              type="loginSecurityCode"

              email="*****"

              mobilePhone="*****"

              wishedChannel="1">

            <ctx>

              <securitycode>123456</securitycode>

            </ctx>

          </rtEvent>);

   

        logInfo("PARSING RESULTS");

   

        if (null === eventRes || undefined === eventRes) {

           logError("No response");

        } 

 

 

        logInfo("EVENT RESPONSE: " + eventRes.toString())

      } finally {

        event.dispose();

      }

    } finally {

      session.dispose();

    }

  } finally {

    cnx.dispose();

  }

} catch (e) {

  logError(e);

}

 

Regards,

Ananya Kuthiala


Viewing all articles
Browse latest Browse all 80307

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>