2 Replies Latest reply on Mar 25, 2008 12:29 AM by (fivan79)

    passing parameters via SOAP

      Hi All.

      I Have to call ID Server via SOAP from Flex (Actionscript).
      I use RunScript command described in my WSDL file.

      The script I want to execute, starts correctly, but I can't pass parameters.
      I set scriptArgs with an array containing couples of name:vale elements.
      But when the script tries to read scriptArgs, they are undefined.

      Someone can help me?
      thanks in advance.

      Ivan
        • 1. Re: passing parameters via SOAP
          Level 1
          I am able to get it to work using Flex3, InDesign CS3 Server. Here's my ActionScript that I call from a button:

          public function doRunScript():void {
          ws = new WebService("http://localhost:12345/service?wsdl");
          ws.wsdl = "http://localhost:12345/service?wsdl";
          ws.RunScript.addEventListener("result", runScriptResultHandler);
          ws.RunScript.addEventListener("fault", runScriptFaultHandler);
          ws.loadWSDL();

          var myScript:String =
          "var myArg0 = app.scriptArgs.getValue(\"arg0\");" +
          "var myArg1 = app.scriptArgs.getValue(\"arg1\");" +
          "var myResult = \"arg0:\" +myArg0 + \", arg1:\" +myArg1;" +
          "app.consoleout(myResult);" +
          "myResult;";

          var params:Object = new Object();
          params.scriptText = myScript;
          params.scriptLanguage = "javascript";
          params.scriptFile = "";

          params.scriptArgs = new Array();
          params.scriptArgs.push( {name:'arg0', value:"NUMBER ONE"});
          params.scriptArgs.push( {name:'arg1', value:"NUMBER TWO"});

          ws.RunScript(params);
          }

          Susan
          • 2. Re: passing parameters via SOAP
            Level 1
            Thanks Susan!

            You have switched on a light in my dark path.

            :-)