SOAPpy / WSDL help... please

Discussion in 'Python' started by sberry, Oct 30, 2007.

  1. sberry

    sberry Guest

    I have an Adobe InDesign server running that includes a built-in SOAP
    server. The wsdl is located here:
    http://www.seanberry.com/IDSP.wsdl.

    I have a PHP example that looks like this for calling the SOAP
    function runScriptParameters

    //---------------------------------------------------------------------------
    $scriptArgs = array();
    $scriptArgs[] = array("name" => "myVarName", "value" => "myVarValue");
    $scriptArgs[] = array("name" => "myVarName2", "value" =>
    "myVarValue2");
    $runScriptParams = array( "scriptFile" => "/some/path/to/file.jsx",
    "scriptArgs" => $scriptArgs, "scriptLanguage" => "javascript");
    $scriptData = array("runScriptParameters" => $runScriptParams);
    $client = new SoapClient("IDSP.wsdl", $proxy_settings);
    $returnedValue = $client->RunScript($scriptData);
    //---------------------------------------------------------------------------



    This works fine and produces the following as its output XML:
    //---------------------------------------------------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
    envelope/" xmlns:ns1="http://ns.adobe.com/InDesign/soap/">
    <SOAP-ENV:Body>
    <ns1:RunScript>
    <runScriptParameters>
    <scriptLanguage>javascript</scriptLanguage>
    <scriptFile>/some/path/to/file.jsx</scriptFile>
    <scriptArgs><name>myVarName</name><value>myVarValue</value></
    scriptArgs>
    <scriptArgs><name>myVarName2</name><value>myVarValue2</value></
    scriptArgs>
    </runScriptParameters>
    </ns1:RunScript>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    ---------------------------------------------------------------------------


    Now I am writing a client in Python and have tried the following:
    //---------------------------------------------------------------------------
    #!/usr/bin/python

    import SOAPpy

    url = "./IDSP.wsdl"

    wsdlObject = SOAPpy.WSDL.Proxy(url)
    SOAPpy.Config.debug = 1

    scriptArgs = []
    scriptArgs.append({"name":"myVarName", "value":"myVarValue"})
    scriptArgs.append({"name":"myVarName2", "value":"myVarValue2"})
    runScriptParams = {}
    runScriptParams["scriptFile"] = "/some/path/to/file.jsx"
    runScriptParams["scriptLanguage"] = "javascript"
    runScriptParams["scriptArgs"] = scriptArgs

    result = wsdlObject.RunScript(runScriptParameters=runScriptParams)
    print result
    //---------------------------------------------------------------------------


    This errors out and shows the following as the XML.
    //---------------------------------------------------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    >

    <SOAP-ENV:Body>
    <RunScript SOAP-ENC:root="1">
    <runScriptParameters>
    <scriptArgs SOAP-
    ENC:arrayType="ns1:SOAPStruct[2]" xsi:type="SOAP-ENC:Array"
    xmlns:ns1="http://soapinterop.org/xsd">
    <item>
    <name
    xsi:type="xsd:string">myVarName</name>
    <value
    xsi:type="xsd:string">myVarValue</value>
    </item>
    <item>
    <name
    xsi:type="xsd:string">myVarName2</name>
    <value
    xsi:type="xsd:string">myVarValue2</value>
    </item>
    </scriptArgs>
    <scriptLanguage
    xsi:type="xsd:string">javascript</scriptLanguage>
    <scriptFile xsi:type="xsd:string">/some/
    path/to/file.jsx</scriptFile>
    </runScriptParameters>
    </RunScript>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    //---------------------------------------------------------------------------------

    This looks wrong first off because of the RunScript node, but also has
    those extra "item" nodes for the scriptArgs instead of each being a
    scriptArgs node. Can anyone help? I really need to get this working
    and would appreciate any pointers anyone can give.

    THANKS!!!
     
    sberry, Oct 30, 2007
    #1
    1. Advertising

  2. sberry

    sberry Guest

    On Oct 30, 4:10 pm, sberry <> wrote:
    > I have an Adobe InDesign server running that includes a built-in SOAP
    > server. The wsdl is located here:http://www.seanberry.com/IDSP.wsdl.
    >
    > I have a PHP example that looks like this for calling the SOAP
    > function runScriptParameters
    >



    Sorry, I meant that I was trying to run the SOAP function RunScript...
    not runScriptParameters like I posted previously.

    Thanks for any help.
     
    sberry, Oct 31, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vivek
    Replies:
    0
    Views:
    2,581
    Vivek
    Aug 4, 2004
  2. Miki Tebeka
    Replies:
    0
    Views:
    597
    Miki Tebeka
    Oct 11, 2005
  3. Rodney

    SOAPpy SOAP and/or WSDL Question

    Rodney, Dec 4, 2005, in forum: Python
    Replies:
    0
    Views:
    382
    Rodney
    Dec 4, 2005
  4. Replies:
    1
    Views:
    568
    Dieter Maurer
    Mar 8, 2006
  5. Henrik Aagaard Sørensen

    Re: Help with SOAPpy and WSDL.

    Henrik Aagaard Sørensen, Nov 2, 2009, in forum: Python
    Replies:
    0
    Views:
    635
    Henrik Aagaard Sørensen
    Nov 2, 2009
Loading...

Share This Page