質問

We have data services setup, and we would like to call this data service within our jaggery app.

Here is our Jaggery Code:

function invokeWS() {
var ws = require("ws");
var ds = ws.WSRequest();
var options = new Array();
options.useSOAP = 1.2;
options.action = "urn:VerifyUserSession";
var payload = '<p:VerifyUserSession xmlns:p="http://..."><!--Exactly 1 occurrence--> <xs:SESSIONID xmlns:xs="http://...">fb9ecf05-751b-4eff-b454-11a9bee44be1</xs:SESSIONID> </p:VerifyUserSession>';
log.info(payload);
var result;
try {
    ds.open(options, 'http://localhost:9765/services/accountManagementDS', false);
    ds.send(payload);
    result = ds;
}
catch (e){
    return 'error';
}

return result.responseText;

}

Here is what the data service looks like from the "TryIt" service:

<body>
   <p:VerifyUserSession xmlns:p="http://...">
      <!--Exactly 1 occurrence-->
      <xs:SESSIONID xmlns:xs="http://...">?</xs:SESSIONID>
   </p:VerifyUserSession>
</body>

Am I doing anything wrong? It seems that it throws an error with ds.open()

役に立ちましたか?

解決

You have to initialize the WSRequest as,

var ds = new ws.WSRequest();
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top