0
PHP SOAP Client for InDesign Server
New Here
,
/t5/indesign-discussions/php-soap-client-for-indesign-server/td-p/1379833
Oct 24, 2007
Oct 24, 2007
Copy link to clipboard
Copied
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Beginner
,
/t5/indesign-discussions/php-soap-client-for-indesign-server/m-p/1379834#M200413
Oct 24, 2007
Oct 24, 2007
Copy link to clipboard
Copied
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
LATEST
/t5/indesign-discussions/php-soap-client-for-indesign-server/m-p/1379836#M200415
Sep 19, 2018
Sep 19, 2018
Copy link to clipboard
Copied
For posterity,
"scriptArgs" => $scriptArgs,
should be:
"scriptArgs" => $script_args,
in Sean_M_Berry's code.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
_chrismo_
AUTHOR
New Here
,
/t5/indesign-discussions/php-soap-client-for-indesign-server/m-p/1379835#M200414
Oct 24, 2007
Oct 24, 2007
Copy link to clipboard
Copied
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
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

