Magento Forum

   
Fehler: “Attribute name and value are required” in SOAP
 
sempf
Jr. Member
 
Total Posts:  1
Joined:  2008-06-14
 

moin,

beim aufruf von “http://magento-host/api/soap/?wsdl” kam bei mir immer folgende fehlerseite:

WarningSimpleXMLElement::addAttribute() [function.SimpleXMLElement-addAttribute]Attribute name and value are required  in C:\magento\lib\Varien\Simplexml\Element.php on line 368

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

den fehler habe ich in der datei \lib\Varien\Simplexml\Element.php ab Zeile 368 durch folgende änderungen behoben:

$targetChild $this->addChild($sourceName$source->xmlentities());
            
$targetChild->setParent($this);
            foreach (
$source->attributes() as $key=>$value{
// changes // begin
//                $targetChild->addAttribute($key, $this->xmlentities($value));
if ($this->xmlentities($value) != ""{
                $targetChild
->addAttribute($key$this->xmlentities($value));
else {
                $targetChild
->addAttribute($key"irgendwas");
}
// changes // end
*/
            
}
            
return $this;

warum und weshalb der fehler bei mir auftritt, habe ich nicht erörtert. solltet ihr das gleiche problem haben, könnt ihr durch die änderung die magento core api einwandfrei nutzen.

umgebung: windows xp, easyphp 2.0

viel spass!

sempf

 
Magento Community Magento Community
Magento Community
Magento Community
 
stefan_herxe
Member
 
Total Posts:  49
Joined:  2008-08-20
 

Servus Sempf,

Schau mal hier, das wird wohl die bessere Lösung sein.

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

ciao, Stefan

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