 | MEMBER LOGIN |
|
|
 |
|
 | SERVICES & FEATURES |
|
|
 |
|
 | THE 20 LATEST PROJECTS |
 | POPULAR NEW PROJECTS |
|
|
Project: SOAP problems with magento
ID: 1258635632 |
|
 |  |  |
 |
| |
|
Status: |
Closed (Cancelled)
|
|
Budget: |
N/A
|
|
Created: |
11/19/2009 at 8:00 EST
|
|
Cancelled: |
11/26/2009 at 8:05 EST
|
|
Project Creator: |
|
|
Description: |
We have had soap working with magento but has suddenly stopped working and causing errors in our script.
making this call twice seemed to fix the problem to the proxy and sessionID
<?
//$proxy = new SoapClient('http://www.xxx.co.uk/api/soap/?wsdl', array('trace'=>1));
$proxy = new SoapClient('http://www.xxx.co.uk/api/soap/?wsdl');
$sessionId = $proxy->login('xxx', 'xxx');
$row_rsGetOrderInfo=$proxy->call($sessionId, 'sales_order.info', 100000324);
$trackitem_shipmethod=$row_rsGetOrderInfo[shipping_description];
echo "SHIP METHOD: $trackitem_shipmethod<BR><BR>";
//try { $row_rsGetOrderInfo=$proxy->call($sessionId, 'sales_order.info', 100000319); } catch(SoapFault $soapFault){
//echo "<br><br>Fault: " . var_dump($soapFault);
//echo "<br><br>Request :<br>", htmlentities($proxy->__getLastRequest()), "<br>";
//echo "<br><br>Response :<br>", htmlentities($proxy->__getLastResponse()), "<br>";
//}
//$proxy = new SoapClient('http://www.xxx.co.uk/api/soap/?wsdl');
//$sessionId = $proxy->login('xxx', 'xxx');
$row_rsGetOrderInfo=$proxy->call($sessionId, 'sales_order.info', 100000324);
$trackitem_shipmethod=$row_rsGetOrderInfo[shipping_description];
echo "SHIP METHOD: $trackitem_shipmethod<BR><BR>";
?>
We then discovered last night that reinstantiate the SoapClient Object worked but today we have new / more problems with getting soap to work which previously worked:
Just worked out that I only need to reinstantiante the SoapClient object for it to work. I dont even need to log back in to the session.
i.e. I can do this first:
$proxy = new SoapClient('http://www.xxx.co.uk/api/soap/?wsdl');
$sessionId = $proxy->login('xxx', 'xxx');
Then execute a query:
try { $countries = $proxy->call($sessionId, 'country.list'); } catch(Exception $e){ echo "<BR>ERROR Code : " . $e->getCode() . ": " . $e->getMessage(); }
Next time I just:
$proxy = new SoapClient('http://www.xxx.co.uk/api/soap/?wsdl');
then execute another query.
And this works.
Are you there?
I've just recoded all that - run 5 test orders through successfully.
Noticed a small error with the order comments which I fixed.
Went to retest a single order and now getting a different error:
ERROR Code : 0: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.xxx.co.uk/api/soap/?wsdl' Additional Info (Added 11/19/2009 at 10:44 EST)...Really looking for a fix for this today/tomorrow
|
|
Tags: |
Programming, PHP, Magento
|
| |
 |
|
Messages Posted: 16 |
| |