Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PHP SOAP Client for InDesign Server

New Here ,
Oct 24, 2007 Oct 24, 2007
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
3.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 24, 2007 Oct 24, 2007
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 19, 2018 Sep 19, 2018
LATEST

For posterity,

"scriptArgs" => $scriptArgs,

should be:

"scriptArgs" => $script_args,

in Sean_M_Berry's code.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 24, 2007 Oct 24, 2007
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines