Call-back icon  Enterprise Sales: +1.310.775.2674 (N. America)   +44 20.3286.4137 (UK)

Magento

eCommerce Software for Online Growth

Magento Forum

   
API - How do I get started? 
 
itzik
Jr. Member
 
Total Posts:  25
Joined:  2008-07-21
 

I’m a little unsure of how to get started with API....could someone please advise? I created a PHP file and put in this code:

<?

  $proxy 
= new SoapClient('http://mydomain.com/api/?wsdl');
  
$sessionId $proxy->login('apiUser''apiKey');
  
  
var_dump($proxy->call($sessionId'product.info''InvOf_78'));

?>

but then I got this error:

Fatal errorUncaught SoapFault exception[WSDL] SOAP-ERRORParsing WSDLCouldn't load from 'http://mydomain.com/api/soap/?wsdl' in /home/liquncom/public_html/custom/soap.php:3 Stack trace: #0 /home/liquncom/public_html/custom/soap.php(3): SoapClient->SoapClient('http://liquidat...') #1 {main} thrown in /home/liquncom/public_html/custom/soap.php on line 3

 
Magento Community Magento Community
Magento Community
Magento Community
 
clorne
Sr. Member
 
Total Posts:  109
Joined:  2008-01-10
London
 

To begin with you should be using Magento 1.1.1

1.  Make sure that extension=php_soap.dll is enabled in php.ini
2. You may have to include index.php in your url “ http://mydomain.com/index.php/api/?wsdl’
3. Create BOTH a role and user in your admin System/Web Services

Good luck

 
Magento Community Magento Community
Magento Community
Magento Community
 
itzik
Jr. Member
 
Total Posts:  25
Joined:  2008-07-21
 

Does that mean API does not work in Magento ver. 1.0.19870 ?

and if so, is there any way to update the API functionality without updating the entire script?

 
Magento Community Magento Community
Magento Community
Magento Community
 
novalis
Sr. Member
 
Avatar
Total Posts:  248
Joined:  2007-10-13
Berlin, Germany
 

Are you running PHP as CGI? There’s a duplicate header error which is hidden because Magento loads the wsdl internal. For the fixed function see my blogpost about this issue:

http://www.exanto.de/duplicate-headers-bei-magento-113.html

Or the issue itself with the “old” fix… you should use the one from my blogpost.

http://www.magentocommerce.com/bug-tracking/issue/?issue=1257

Greetz,
Nov

 Signature 

http://www.exanto.de | Magento-DE auf Freenode | Kein Support per PM, ICQ oder E-Mail, bitte nutzt das Forum!

 
Magento Community Magento Community
Magento Community
Magento Community
 
adultcart
Jr. Member
 
Total Posts:  4
Joined:  2009-02-01
 

I still can’t get it to work :(

Can anyone help?

http://mariasfantasy.com/SCRIPT/magento.api.php

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2009 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
108696 users|410 users currently online|199763 forum posts