Skip to main content
Participant
January 17, 2007
Question

SOAP Returns from IDS

  • January 17, 2007
  • 12 replies
  • 1867 views
Is anybody getting any type of return from IDS through and [java] axis interface? I can send a request and it is executed but I get no return from IDS?
This topic has been closed for replies.

12 replies

Participating Frequently
December 5, 2008
Hi, SusanDoan

Is it possible to read from the terminal also during the execution of a script, or only at the end?

I would like to trace the progress of my scripts and show a progress bar.

thanks
Ivan
Participating Frequently
April 2, 2008
fivan79,
Change your javascript so the last line returns the data you want to get back. app.consoleout() won't do it. This will work:

var myReturnData = "hello there";
// ... more stuff here
myReturnData;

Susan
Participating Frequently
March 31, 2008
Hi All,

I have some problem reading response from IDS.
I use Flex 3.0 and actionscript.

I run a js and it works correctly.
The script ends with app.consoleout command and I can see the result in the terminal but I can not read the response in "scriptResult.data".
Flex debugger tell me "data" is not defined.

I try to read the response from RunScriptResponse, from scriptResult and also from event.result but without success.

Is it possible that the problem is in the WSDL file?

Can you help me?
Participant
March 10, 2008
I Have Prepared a Client Which Attaches & sends XML file To Web Service,
I Got Exception:exception occuredjava.io.FileNotFoundException: http://209.85.13.194:8080/soap/desiya/TestWebsevice/message209
Wld U Pls Help me To Solve This Error.
Participating Frequently
February 25, 2008
There is a sample client in the InDesign CS3 Server SDK that demonstrates how to interact with InDesign Server through SOAP via Java, using Apache Axis 1.2.1. It's in the samples/sampleclient-java-soap folder.

Basically, Axis is used to generate the SOAP wrapper. One of the classes it creates is DataHolder. When runScript returns, the DataHolder object will hold the return value which can be accessed from the "value" field: myDataHolder.value.getData()

To note however, your JavaScript will only return a value if that value is specified in the last executed line in the script. A couple examples:

* As above, return a value from the main method, and make sure main is the last function you call:

function main()
{
return "MY-RETURN-VALUE";
}
main();

* Access the return value in the last statement in the script:

var theStrokeWeight = myRectangle.strokeWeight;
// ... do more stuff ...
theStrokeWeight;

Susan Doan
Participant
February 8, 2008
Hi folks,

we have here exactly the problem, that tom described. the return value arrives correctly on the network interface (checked with a packet sniffer) within the following soap message:

<SOAP-ENV:Body>
<IDSP:RunScriptResult>
<errorNumber>0</errorNumber>
<scriptResult>
<data xsi:type="xsd:string">-262</data>
</scriptResult>
</IDSP:RunScriptResult>
</SOAP-ENV:Body>

but the problem is now, that this value can't be read from the java application. if i debug the code, i receive the errorNumber but the scriptResult --> data is alway NULL?

does anybody have an idea?

best wishes
hermann
Participant
March 26, 2007
For some reason, app.consoleout didn't work for me but I figured out an alternative.

Wrap the code in a function and have the function return a value. Then call that function. Here's an example.

function main()
{
app.consoleout("SOAP test started!");
app.consoleout("SOAP test finished!");
return "MY-RETURN-VALUE";
}
main();

You should see, "MY-RETURN-VALUE" in scriptResult.data.

Good luck,
Sunny Judo
Silicon Publishing
Participant
January 18, 2007
After making a bad js file I realize that it's my axis that for some reason is either not deserializing or receiving the response IDS is sending stuff back but I can't see it.
Participating Frequently
January 18, 2007
PS. the call of app.consoleout needs to be the last line in your javascript.
Participating Frequently
January 18, 2007
There is a 'loophole' in the way IDS handles javascript that you can take advantage of if you want to return something specific (and relatively uncomplicated). The 'app' object defines a method called 'consoleout' for displaying messages in the console. If you instead call this as if it were a property the string passed to it will be returned to your soap client in the 'scriptResult' tag. For example...

app.consoleout = "words in story = "+theCount;

.. will return the result I show above.