This content has been marked as final. Show 12 replies
I believe the only way to work with multi-instances is by using the soap communications with each server responding on a different port.
The problem is not to start different instances. In the Windows Task Manager and the console output of InDesign Server I can see, that both instances are running with different configurations. When I use Systems.Diagnostics.Processes.GetProcess() I get both processes too.
But I don't know how to get objects of both instances using the Interop Assembly or (as a runaround) how to cast an object of System.Diagnostics.Process into an object of InDesignServer.Application.
When you talking about SOAP, do you know how to start InDesignServer twice with diffrent ports from inside VB and getting the InDesignServer.Application objects of it?
This should be solve our problem too.
I understand your problem (can run 2 instances, but only communicate with 1 using VB's com interface). I am 99% certain I've seen a posting somewhere from Adobe saying the only way to separate communication between multiple instances of server running on one machine is by using soap.
I know virtually nothing of VB - can it do like C#, I made a test app once that talked over soap very easily there? As far as casting objects etc in VB - sorry no idea at all.
Hmmm, but what I've seen there is only 1 SOAP command (RunScript) supported by InDesign Server. So I would have to save each action (like place a textbox at x, y) as a script, and call the scripts using RunScript. That's sad. When I can control one instance, why not two? This works with other programs, so why should it not work with InDesignServer? That's reducing the possibilities of the multi-instance-idea and increases process time, I think.
Reducing the possibilities - I agree, increasing the process time - I'm not sure. What is the time difference between a com message to place at x/y vs a soap message, probably not very much. Also a script can contain many instructions, which is the better way to work with server - server has no context. If you have a script that opens a doc, does some work on it, closes it that is fine. If you send a message open doc, wait a while, send a message make a text frame at x/y, etc. there is no guarantee that someone else hasn't sent a close doc message....
With InDesign Server CS2, the only way to interact with multiple instances of the server is by using SOAP. When you send your SOAP message to RunScript, you can specify which script to run, and any parameters you'd like. You can build a function in your script that takes the arguments and passes them along to the appropriate function to do the appropriate work. If you are concerned about another process closing the document in between your SOAP messages, you would need to build some other transaction system that the other applications accessing your multiple instances would need to query for which is available.
best free web hosting
myIndApps0 = Activator.CreateInstance(Type.GetTypeFromProgID("InDesignServer.Application.CS2"))
myIndApps1 = Activator.CreateInstance(Type.GetTypeFromProgID("InDesignServer.Application.CS2"))
same result: myIndApps0 and myIndApps1 are the same Object.
It's not possible. Use SOAP.
It's not possible, because this feature is missing in the type library (or wherever it's defined how Interop Assembly gets an InDesign object). For the InDesign Server application it would be no problem.
The program I build have to handle instances of InDesign "Desktop" too. So I cannot use SOAP.
You need to change your software design if you want to use multiple instances of InDesignServer! It only works with SOAP!
It is possible to build an application, that works with indesign desktop via COM and with indesign server via SOAP! I have done it myself!