Hi all.

I have a customer that is running an HR-system using Service Bus for
Windows Server. I need to retrieve updates from this HR-system using
REST.

To authenticate I need to send a SAS token as an Authorization header.

To generate the SAS token I have created a ECMA-script seen below. I
call the function using
getToken('https://fake.url.org','secretkey','username');

When I call the function using Designer it works well. However when I
try to run it on the engine I get an error message. What could be the
cause for this issue on the engine side? Does anyone have any idea what
could be done to fix it?

The response should be similar to:

Code:
--------------------
SharedAccessSignature sr=https%3a%2f%2ffake.url.org&sig=lCXLvuP%2fbek0vR pPYiCWXXe%2brcGt8h4nGvmYaJtGgqc%3d&se=1441794669&s kn=username
--------------------


Error message on the engine:

Code:
--------------------
DirXML Log Event -------------------
Driver: \DEV-TREE\idm\system\Driver Set\ECMA
Channel: Subscriber
Status: Error
Message: Code(-9083) Error submitting event to subscriber: Code(-9010) An exception occurred: java.lang.NoSuchMethodError: com.novell.soa.script.mozilla.javascript.optimizer .OptRuntime.thisGet(Lcom/novell/soa/script/mozilla/javascript/Scriptable;Ljava/lang/String;Lcom/novell/soa/script/mozilla/javascript/ScriptableLjava/lang/Object;
at com.novell.soa.script.mozilla.javascript.gen.c9._c 13(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data:152)
at com.novell.soa.script.mozilla.javascript.gen.c9.ca ll(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data)
at com.novell.soa.script.mozilla.javascript.optimizer .OptRuntime.call1(Unknown Source)
at com.novell.soa.script.mozilla.javascript.gen.c9._c 24(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data:221)
at com.novell.soa.script.mozilla.javascript.gen.c9.ca ll(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data)
at com.novell.soa.script.mozilla.javascript.optimizer .OptRuntime.call1(Unknown Source)
at com.novell.soa.script.mozilla.javascript.gen.c9._c 29(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data:257)
at com.novell.soa.script.mozilla.javascript.gen.c9.ca ll(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data)
at com.novell.soa.script.mozilla.javascript.optimizer .OptRuntime.call1(Unknown Source)
at com.novell.soa.script.mozilla.javascript.gen.c9._c 45(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data:375)
at com.novell.soa.script.mozilla.javascript.gen.c9.ca ll(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data)
at com.novell.soa.script.mozilla.javascript.optimizer .OptRuntime.callProp0(Unknown Source)
at com.novell.soa.script.mozilla.javascript.gen.c9._c 44(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data:370)
at com.novell.soa.script.mozilla.javascript.gen.c9.ca ll(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data)
at com.novell.soa.script.mozilla.javascript.ScriptRun time.applyOrCall(Unknown Source)
at com.novell.soa.script.mozilla.javascript.BaseFunct ion.execIdCall(Unknown Source)
at com.novell.soa.script.mozilla.javascript.IdFunctio nObject.call(Unknown Source)
at com.novell.soa.script.mozilla.javascript.optimizer .OptRuntime.call2(Unknown Source)
at com.novell.soa.script.mozilla.javascript.gen.c9._c 7(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data:114)
at com.novell.soa.script.mozilla.javascript.gen.c9.ca ll(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data)
at com.novell.soa.script.mozilla.javascript.optimizer .OptRuntime.call2(Unknown Source)
at com.novell.soa.script.mozilla.javascript.gen.c9._c 35(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data:279)
at com.novell.soa.script.mozilla.javascript.gen.c9.ca ll(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data)
at com.novell.soa.script.mozilla.javascript.optimizer .OptRuntime.call2(Unknown Source)
at com.novell.soa.script.mozilla.javascript.gen.c9._c 1(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data:12)
at com.novell.soa.script.mozilla.javascript.gen.c9.ca ll(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data)
at com.novell.soa.script.mozilla.javascript.ScriptRun time.doTopCall(Unknown Source)
at com.novell.soa.script.mozilla.javascript.gen.c9.ca ll(vnd.nds.stream://DEV-TREE/idm/system/Driver+Set/ECMA/SAS-token2#DirXML-Data)
at com.novell.xsl.extensions.ECMAScriptFunctionImpl.i nvoke(ECMAScriptFunctionImpl.java:108)
at com.novell.xml.xpath.FunctionCall.evaluate(Functio nCall.java:90)
at com.novell.xml.dom.DOMEvaluator.evaluate(DOMEvalua tor.java:89)
at com.novell.nds.dirxml.engine.rules.RuleDynamicCont ext.evaluateXPath(RuleDynamicContext.java:165)
at com.novell.nds.dirxml.engine.rules.TokenXPath.expa nd(TokenXPath.java:72)
at com.novell.nds.dirxml.engine.rules.Arg.evaluate(Ar g.java:460)
at com.novell.nds.dirxml.engine.rules.DoSetLocalVaria ble.apply(DoSetLocalVariable.java:100)
at com.novell.nds.dirxml.engine.rules.ActionSet.apply (ActionSet.java:180)
at com.novell.nds.dirxml.engine.rules.DirXMLScriptPro cessor.applyRules(DirXMLScriptProcessor.java:307)
at com.novell.nds.dirxml.engine.Subscriber.processEve nts(Subscriber.java:902)
at com.novell.nds.dirxml.engine.Driver.submitTransact ion(Driver.java:628)
at com.novell.nds.dirxml.engine.DriverEntry.submitTra nsaction(DriverEntry.java:1065)
at com.novell.nds.dirxml.engine.DriverEntry.processCa chedTransaction(DriverEntry.java:949)
at com.novell.nds.dirxml.engine.DriverEntry.eventLoop (DriverEntry.java:771)
at com.novell.nds.dirxml.engine.DriverEntry.run(Drive rEntry.java:561)
at java.lang.Thread.run(Unknown Source)

--------------------


I have uploaded the ECMA-script to pastebin:
http://pastebin.com/V7TG3t44

Any help is greatly appriciated!

Best Regards
Marcus


--
marcus_jonsson
------------------------------------------------------------------------
marcus_jonsson's Profile: https://forums.netiq.com/member.php?userid=1157
View this thread: https://forums.netiq.com/showthread.php?t=54258