Node SOAP client to connect to InDesign Server
<p>I am trying to get node/express to send soap request to indesign server.</p>

<p>Posting the request from Soap.ui or Postman works fine. Loading the "soap" page in the browser errors.</p>

<p>I also tried the node client with a few sample scripts from the new and they work, so the install should be OK.</p>

<p>This is what I have so far:</p>

<pre><code>    router.get('/soap', function(req, res, next) {

      var url = 'http://&lt;server_ip&gt;:8088/service?wsdl';

      var args = { "IDSP:RunScriptParameters" :
                         { 'scriptLanguage': 'javascript',
                           'scriptFile': 'C:/indesign_scripts/test.jsx'
                         }
                   };


      soap.createClient(url, function(err, client){
          client.Service.Service.RunScript(args, function(err, result) {
            if (err)   console.log(err);
            console.log(result);
          });
  });
</code></pre>

<p>client.describe() returns:</p>

<pre><code>{ Service: 
   { Service: 
      { RunScript: [Object],
        BeginSession: [Object],
        EndSession: [Object] } } }
</code></pre>

<p>I am trying to use RunScript object.</p>

<p>client.describe().Service.Service.RunScript:</p>

<pre><code>{ input: 
   { runScriptParameters: 
      { scriptText: 'xsd:string',
        scriptLanguage: 'xsd:string',
        scriptFile: 'xsd:string',
        'scriptArgs[]': [Object],
        targetNSAlias: 'IDSP',
        targetNamespace: 'http://ns.adobe.com/InDesign/soap/' } },
  output: 
   { errorNumber: 'xsd:int',
     errorString: 'xsd:string',
     scriptResult: 
      { data: 'xsd:anyType',
        targetNSAlias: 'IDSP',
        targetNamespace: 'http://ns.adobe.com/InDesign/soap/' } } }
</code></pre>

<p>Console shows this error:</p>

<pre><code>[Error: connect ECONNREFUSED 127.0.0.1:8088]
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 8088 }
</code></pre>

<p>Indesign Server wsdl could be viewed here:</p>

<p><a href="https://gist.github.com/tomtaylor/1034317" rel="nofollow">https://gist.github.com/tomtaylor/1034317</a></p>

<p>I suspect this is something with args variable format.</p>