2 Replies Latest reply on Oct 24, 2007 12:31 PM by (chrismo)

    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

          HTH,
          _ Sean
          • 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!

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

            Many Thanks
            Christoph