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

SOAP Returns from IDS

New Here ,
Jan 17, 2007 Jan 17, 2007
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?
1.9K
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 ,
Jan 17, 2007 Jan 17, 2007
You should be getting a RunScriptResult in the returned XML packet. Something like...



0

words in story = 3




Are you not seeing this (with a packet sniffer) or is your axis client's deserializer simply not being called? - or are you trying to return something specific, but getting something else? (IDServer packages up, as the return data, the result of the last call in your javascript.)
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 ,
Jan 18, 2007 Jan 18, 2007
This is what I'm getting:<br /><br /><?xml version="1.0".encoding="UTF-8"?><br /><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:IDSP="http://ns.adobe.com/InDesign/soap/"><br /> <SOAP-ENV:Body><br /> <IDSP:RunScriptResult><br /> <errorNumber><br /> 0<br /> </errorNumber><br /> <scriptResult><br /> </scriptResult><br /> </IDSP:RunScriptResult><br /> </SOAP-ENV:Body><br /></SOAP-ENV:Envelope><br /><br />I would like to get actual data returned. On the other InDesign forum it was stated that IDS would return the last command in the script. however I have not seen anything other than the error number returned.
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 ,
Jan 18, 2007 Jan 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.
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 ,
Jan 18, 2007 Jan 18, 2007
PS. the call of app.consoleout needs to be the last line in your javascript.
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 ,
Jan 18, 2007 Jan 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.
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 ,
Mar 26, 2007 Mar 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
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 ,
Feb 08, 2008 Feb 08, 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
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 ,
Feb 25, 2008 Feb 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
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 ,
Mar 10, 2008 Mar 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.
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 ,
Mar 31, 2008 Mar 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?
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 ,
Apr 02, 2008 Apr 02, 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
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 ,
Dec 05, 2008 Dec 05, 2008
LATEST
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
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