3 Replies Latest reply on Sep 19, 2018 10:47 AM by toddm72

    PHP SOAP Client for InDesign Server

      Hi, <br />I am new to IDS and I am writing my diploma thesis about working with IDS. I need some help or ideas how I can implement a SOAP-Client for IDS with PHP. <br /> <br />I am working with PHP 5's SOAP-Extension and know that there is one function "runScript". But when I try to send a SOAP-Message I get some error like "The required SOAP element "RunScriptParameters" could not be found Please check the SOAP Message that was send to InDesign Server." <br /> <br />Thats my code: <br /> <br /><?php<br /><br />$client = new SoapClient('http://localhost/IDSP.wsdl');<br /><br />$client->__call('runScript',$params);<br />?> <br /> <br />How should I fill the array '$params'? <br /> <br />Thanks, <br />Christoph
        • 1. Re: PHP SOAP Client for InDesign Server
          Level 1
          runScriptParameters, lowercase r, is the required variable for the InDesign SOAP server. runScriptParameters is an associative array of three things.

          scriptFile -> the script file location
          scriptArgs -> an array of associative arrays containing name and value as keys
          scriptLanguage -> the scripting language of scriptFile.

          So, you might want to try something like this.

          $client = new SoapClient("http://localhost/IDSP.wsdl");
          $script_args = array(array("name" => "varible_1_name", "value" => "variable_1_value"));
          $script_parameters = array( "scriptFile" => /path/to/my/jsx/file.jsx",
          "scriptArgs" => $scriptArgs,
          "scriptLanguage" => 'javascript',
          $script_data = array("runScriptParameters" => $script_parameters);
          $return_value = $client->RunScript($script_data);
          - or -
          $return_value = $client->__call('RunScript', $script_data);

          PLEASE NOTE: Not tested

          _ Sean
          1 person found this helpful
          • 2. Re: PHP SOAP Client for InDesign Server
            Level 1
            Hi Sean,
            thanks a lot! It works! I just knew the parameters and names resp. values of the variables, but I had some problems with the lots of arrays! Your example helped me a lot and I could manage the problem!

            $return_value = $client->__call('RunScript', $script_data); doesn't work but the other alternative!

            Many Thanks
            • 3. Re: PHP SOAP Client for InDesign Server
              toddm72 Level 1

              For posterity,


              "scriptArgs" => $scriptArgs,

              should be:

              "scriptArgs" => $script_args,


              in Sean_M_Berry's code.

              1 person found this helpful