Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

API 404
 
PistolGrip
Jr. Member
 
Total Posts:  4
Joined:  2008-08-22
 

Since I’m not having much luck with DataFlow, I decided to play with the API to test possible Magento integration solution(s).

But, I am not having any luck getting the API to respond. I created a Role and User under System->Web Services, but I can only get a 404 error on any of the URL’s:

http://localhost/api/xmlrpc/
http://localhost/api/?wsdl
http://localhost/index.php/api/xmlrpc/
http://localhost/index.php/api/?wsdl

Just wondering if you must do something to enable the API? Or possibly change configuration somewhere? I’m running CentOS 5.2 and Magento 1.1.3.

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
shefen
Jr. Member
 
Total Posts:  5
Joined:  2008-08-19
 

I have a fresh install of 1.1.3 on Debian-etch and I’m trying to use SOAP to automate the creation of product categories.

I was able to create an API user but get an error when I try to create an API role.
and this URL
http://hostname/index.php/api/?wsdl

gives the same result as when I try to create a role, which is this

Warning: SimpleXMLElement::addAttribute() [function.SimpleXMLElement-addAttribute]: Attribute name and value are required in /var/www/htdocs/lib/Varien/Simplexml/Element.php on line 367

#0 [internal function]: mageCoreErrorHandler(2, ‘SimpleXMLElemen...’, ‘/var/www/htdocs...’, 367, Array)
#1 /var/www/htdocs/lib/Varien/Simplexml/Element.php(367): SimpleXMLElement->addAttribute(’descr’, ‘’)
#2 /var/www/htdocs/lib/Varien/Simplexml/Element.php(387): Varien_Simplexml_Element->extendChild(Object(Mage_Core_Model_Config_Element), true)
#3 /var/www/htdocs/lib/Varien/Simplexml/Element.php(387): Varien_Simplexml_Element->extendChild(Object(Mage_Core_Model_Config_Element), true)
#4 /var/www/htdocs/lib/Varien/Simplexml/Element.php(387): Varien_Simplexml_Element->extendChild(Object(Mage_Core_Model_Config_Element), true)
#5 /var/www/htdocs/lib/Varien/Simplexml/Element.php(387): Varien_Simplexml_Element->extendChild(Object(Mage_Core_Model_Config_Element), true)
#6 /var/www/htdocs/lib/Varien/Simplexml/Element.php(326): Varien_Simplexml_Element->extendChild(Object(Mage_Core_Model_Config_Element), true)
#7 /var/www/htdocs/lib/Varien/Simplexml/Config.php(586): Varien_Simplexml_Element->extend(Object(Mage_Core_Model_Config_Element), true)
#8 /var/www/htdocs/app/code/core/Mage/Api/Model/Config.php(72): Varien_Simplexml_Config->extend(Object(Mage_Core_Model_Config_Base), true)
#9 /var/www/htdocs/app/code/core/Mage/Api/Model/Config.php(43): Mage_Api_Model_Config->_construct()
#10 /var/www/htdocs/app/code/core/Mage/Core/Model/Config.php(715): Mage_Api_Model_Config->__construct(Array)
#11 /var/www/htdocs/app/Mage.php(287): Mage_Core_Model_Config->getModelInstance(’api/config’, Array)
#12 /var/www/htdocs/app/Mage.php(301): Mage::getModel(’api/config’, Array)
#13 /var/www/htdocs/app/code/core/Mage/Api/Model/Server.php(39): Mage::getSingleton(’api/config’)
#14 /var/www/htdocs/app/code/core/Mage/Api/controllers/IndexController.php(35): Mage_Api_Model_Server->init(Object(Mage_Api_IndexController), ‘soap’)
#15 /var/www/htdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(343): Mage_Api_IndexController->indexAction()
#16 /var/www/htdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(144): Mage_Core_Controller_Varien_Action->dispatch(’index’)
#17 /var/www/htdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(168): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#18 /var/www/htdocs/app/Mage.php(420): Mage_Core_Controller_Varien_Front->dispatch()
#19 /var/www/htdocs/index.php(46): Mage::run()
#20 {main}

 
Magento Community Magento Community
Magento Community
Magento Community
 
PistolGrip
Jr. Member
 
Total Posts:  4
Joined:  2008-08-22
 

I would be happy to even get that far at this point. I’ve exhausted all ideas of trying to get the Magento API to respond, SOAP or XMLRPC.

I’ve successfully created a Role and User under System->Web Services, but I can only get a 404 error on any of the URL’s:

http://localhost/api/xmlrpc/
http://localhost/api/?wsdl
http://localhost/index.php/api/xmlrpc/
http://localhost/index.php/api/?wsdl

I’m running CentOS 5.2, Apache 2.2.8, PHP 5.2.6,,and Magento 1.1.3.

Both the php-soap and php-xmlrpc modules are loaded and present on the phpinfo() page.

Is there some Magento setting or config option that needs to be enabled to turn it on? Anyone have any ideas?

Please! smile

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
PistolGrip
Jr. Member
 
Total Posts:  4
Joined:  2008-08-22
 

Nobody has any ideas?

I thought Magento looked promising, but the non-mature code, lack of documentation, and other issues seems to indicate it is not ready for production.

I guess it is time to forget Magento and stick with a more mature product. I was hoping to use it for a couple implementations coming up but I’m not so sure that is wise at this point.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Camulos
Jr. Member
 
Total Posts:  10
Joined:  2008-07-15
 
shefen - 23 August 2008 02:50 PM

...
gives the same result as when I try to create a role, which is this

Warning: SimpleXMLElement::addAttribute() [function.SimpleXMLElement-addAttribute]: Attribute name and value are required in /var/www/htdocs/lib/Varien/Simplexml/Element.php on line 367

#0 [internal function]: mageCoreErrorHandler(2, ‘SimpleXMLElemen...’, ‘/var/www/htdocs...’, 367, Array)
#1 /var/www/htdocs/lib/Varien/Simplexml/Element.php(367): SimpleXMLElement->addAttribute(’descr’, ‘’)
#2 /var/www/htdocs/lib/Varien/Simplexml/Element.php(387): Varien_Simplexml_Element->extendChild(Object(Mage_Core_Model_Config_Element), true)
...

I have the EXACT same problem. On my windows test-machine ( wamp-server ), I can create webservice-roles without any problems. But on my linux production-machine ( Ubuntu ) I also get the same problem when trying to create a webservice role.
Any help would be very usefull

 
Magento Community Magento Community
Magento Community
Magento Community
 
shefen
Jr. Member
 
Total Posts:  5
Joined:  2008-08-19
 
Camulos - 25 August 2008 12:46 AM


I have the EXACT same problem. On my windows test-machine ( wamp-server ), I can create webservice-roles without any problems. But on my linux production-machine ( Ubuntu ) I also get the same problem when trying to create a webservice role.
Any help would be very usefull

I found another thread that provided a clue (sorry I didn’t bookmark it and I can’t find it again).
That discussion pointed to this bug in PHP

http://bugs.php.net/bug.php?id=41175

I originally installed Debian-etch, with PHP 5.2.0-8. To fix the SimpleXML bug I upgraded to PHP 5.2.6-2 (from Debian-lenny) but PHP-Curl had to be uninstalled so now my Magento admin is broken.

One step forward and two steps back. I’m not any closer to a functioning site.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Camulos
Jr. Member
 
Total Posts:  10
Joined:  2008-07-15
 

Thanks Shefen,

I just foud this thread myself: http://www.magentocommerce.com/boards/viewthread/12367/P0/
You have to have atleast PHP 5.2.2 (because the bug was in 5.2.1).

My linux server is now up and running smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lorenzo66
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2008-06-04
London, UK
 

Hi guys,
I still have a 404 of any of the API. I don’t even know where to look for in the code.
I’m using the last 1.1.6 version.
Did you have any luck?

Thank you for your help

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lorenzo66
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2008-06-04
London, UK
 

Finally I found out the problem:
I have the “Add Store Code to Urls” option selected.
Obviously this will change the url for the request....

 
Magento Community Magento Community
Magento Community
Magento Community
 
Chris Farley
Member
 
Total Posts:  43
Joined:  2008-03-09
 

Thank you!! I was having this problem.

So what happens if you do want to add the store code to the URLs? What URL would you use to access web services?

 
Magento Community Magento Community
Magento Community
Magento Community
 
gunnar
Member
 
Avatar
Total Posts:  37
Joined:  2008-05-27
 

hey,

instead of

/index.php/api/xmlrpc

use this uri:

/default/api/xmlrpc

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top