Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: SOAP Message Formatting and PDI

  1. #1
    Join Date
    Apr 2008
    Posts
    123

    Default SOAP Message Formatting and PDI

    Ok, so I am trying to do a lookup of data (Tier Pricing) in the Magento API using a webservice lookup and am having some problems logging into the webservice with my "call" .

    I have successfully connected to it and can see the operations, but every time I try to execute against it with PDI, I get the error below.

    Attached is a screenshot of my transformation and below you will find what a PHP SOAP client would look like for this call, as well as the error log when I attempt to run this transformation.

    I believe all my problems relate to the sessionId string, so I could use some help trying to understand how to pass that through PDI.

    Thanks,
    Roco

    PHP SOAP Client(This one works!!):
    Code:
    $proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
    $sessionId = $proxy->login('apiUser', 'apiKey');
     
    // Get tier prices
    $tierPrices = $proxy->call($sessionId, 'product_tier_price.info', 'Sku');
     
    var_dump($tierPrices);
     
    // Add new
    $tierPrices[] = array(
        'website'           => 'all',
        'customer_group_id' => 'all',
        'qty'               => 68,
        'price'             => 18.20
    );
     
    // Update tier prices
    $proxy->call($sessionId, 'product_tier_price.update', array('Sku', $tierPrices));
     
    // Compare values
    var_dump($proxy->call($sessionId, 'product_tier_price.info', 'Sku'));
     
    var_dump($tierPrices);

    Error Log:
    2008/09/24 15:14:20 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : Unexpected error :
    2008/09/24 15:14:20 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : org.pentaho.di.core.exception.KettleStepException:
    2008/09/24 15:14:20 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : Internal server error while calling the web service. Response code = 500.
    Response body: <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>2</faultcode><faultstring>Access denied.</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>


    2008/09/24 15:14:20 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) :
    2008/09/24 15:14:20 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.steps.webservices.WebService.requestSOAP(WebService.java:327)
    2008/09/24 15:14:20 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.steps.webservices.WebService.processRow(WebService.java:133)
    2008/09/24 15:14:20 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.step.BaseStep.runStepThread(BaseStep.java:2654)
    2008/09/24 15:14:20 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.steps.webservices.WebService.run(WebService.java:890)
    2008/09/24 15:14:20 - Web services lookup 2.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)
    2008/09/24 15:14:20 - Spoon - The transformation has finished!!
    2008/09/24 15:14:20 - Transformation 1 - Transformation detected one or more steps with errors.
    2008/09/24 15:14:20 - Transformation 1 - Transformation is killing the other steps!
    Link to big version of image: http://www.boardshort.com/tango/WebService.png


    Updated in next post
    Attached Images Attached Images  
    Last edited by roco; 09-29-2008 at 05:37 PM. Reason: Update: Some Success!

  2. #2
    Join Date
    Apr 2008
    Posts
    123

    Default

    UPDATE: SO after a lot of time consuming trial and error, I was able to get the login webservice to work and to pass information to another webservice that returned a SOAP ENVELOPE!!

    However now it appears that Pentaho is having a hard time parsing the data for some reason. Here is the Log file for the transformation with errors:

    2008/09/25 23:22:33 - Tier Pricing Attempt - Dispatching started for transformation [Tier Pricing Attempt]
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : Unexpected error :
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : org.pentaho.di.core.exception.KettleStepException:
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : Error parsing data returned by the web service, content:
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:callResponse><callReturn SOAP-ENC:arrayType="ns2:Map[4]" xsi:type="SOAP-ENC:Array"><item xsi:type="ns2:Map"><item><key xsi:type="xsd:string">customer_group_id</key><value xsi:type="xsd:string">all</value></item><item><key xsi:type="xsd:string">website</key><value xsi:type="xsd:string">all</value></item><item><key xsi:type="xsd:string">qty</key><value xsi:type="xsd:string">20.0000</value></item><item><key xsi:type="xsd:string">price</key><value xsi:type="xsd:string">9.8800</value></item></item><item xsi:type="ns2:Map"><item><key xsi:type="xsd:string">customer_group_id</key><value xsi:type="xsd:string">all</value></item><item><key xsi:type="xsd:string">website</key><value xsi:type="xsd:string">all</value></item><item><key xsi:type="xsd:string">qty</key><value xsi:type="xsd:string">50.0000</value></item><item><key xsi:type="xsd:string">price</key><value xsi:type="xsd:string">9.1900</value></item></item><item xsi:type="ns2:Map"><item><key xsi:type="xsd:string">customer_group_id</key><value xsi:type="xsd:string">all</value></item><item><key xsi:type="xsd:string">website</key><value xsi:type="xsd:string">all</value></item><item><key xsi:type="xsd:string">qty</key><value xsi:type="xsd:string">100.0000</value></item><item><key xsi:type="xsd:string">price</key><value xsi:type="xsd:string">8.1600</value></item></item><item xsi:type="ns2:Map"><item><key xsi:type="xsd:string">customer_group_id</key><value xsi:type="xsd:string">all</value></item><item><key xsi:type="xsd:string">website</key><value xsi:type="xsd:string">all</value></item><item><key xsi:type="xsd:string">qty</key><value xsi:type="xsd:string">250.0000</value></item><item><key xsi:type="xsd:string">price</key><value xsi:type="xsd:string">7.9000</value></item></item></callReturn></ns1:callResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>



    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) :
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : Unable to get value for field [callReturn]. Verify that this is not a complex data type by looking at the response XML.
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : Expected a text token, got START_ELEMENT.
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at [row,col {unknown-source}]: [2,498]
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) :
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) :
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.steps.webservices.WebService.compatibleProcessRows(WebService.java:740)
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.steps.webservices.WebService.processRows(WebService.java:400)
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.steps.webservices.WebService.requestSOAP(WebService.java:315)
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.steps.webservices.WebService.processRow(WebService.java:133)
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.step.BaseStep.runStepThread(BaseStep.java:2654)
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.steps.webservices.WebService.run(WebService.java:890)
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : Caused by: org.pentaho.di.core.exception.KettleStepException:
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : Unable to get value for field [callReturn]. Verify that this is not a complex data type by looking at the response XML.
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : Expected a text token, got START_ELEMENT.
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at [row,col {unknown-source}]: [2,498]
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) :
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.steps.webservices.WebService.compatibleProcessRows(WebService.java:634)
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : ... 5 more
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : Caused by: com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT.
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at [row,col {unknown-source}]: [2,498]
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:605)
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:461)
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at com.ctc.wstx.sr.BasicStreamReader.getElementText(BasicStreamReader.java:677)
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.steps.webservices.WebService.compatibleProcessRows(WebService.java:631)
    2008/09/25 23:22:40 - Web services lookup 2.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : ... 5 more
    2008/09/25 23:22:40 - Spoon - The transformation has finished!!
    2008/09/25 23:22:40 - Tier Pricing Attempt - Transformation detected one or more steps with errors.
    2008/09/25 23:22:40 - Tier Pricing Attempt - Transformation is killing the other steps!
    2008/09/29 08:07:12 - Kettle - MYSQL - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : Error rolling back repository.
    Any Ideas?

  3. #3
    Join Date
    Apr 2008
    Posts
    123

    Default

    Sorry to Bump so soon, but I am running out of time to figure this out.........

  4. #4
    Join Date
    Jun 2008
    Posts
    27

    Default

    Hi there,

    did you ever figure something out about that one?

    Bye, Chris

  5. #5
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    I keep answering that the web services lookup step is only useful for simple cases and that for more complex cases it's better to manually assemble and parse the SOAP request and response. You can look at the annotated SOAP example in the samples.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.