Magento en Soap

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Kitty N

kitty N

12/01/2010 14:51:00
Quote Anchor link
Hallo,

Ik ben momenteel wat aan het experimenteren met Magento. Dit heb ik op localhost geïnstalleerd. Heb php_soap aan staan, echter krijg ik iedere keer dezelfde melding:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
Warning: SoapClient::SoapClient() [soapclient.soapclient]: php_network_getaddresses: getaddrinfo failed: Host is onbekend. in C:\wamp\www\magento\test.php on line 8

Warning: SoapClient::SoapClient(http://schemas.xmlsoap.org/soap/encoding/) [soapclient.soapclient]: failed to open stream: php_network_getaddresses: getaddrinfo failed: Host is onbekend. in C:\wamp\www\magento\test.php on line 8

Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "http://schemas.xmlsoap.org/soap/encoding/" in C:\wamp\www\magento\test.php on line 8

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from 'http://schemas.xmlsoap.org/soap/encoding/' in C:\wamp\www\magento\test.php:8 Stack trace: #0 C:\wamp\www\magento\test.php(8): SoapClient->SoapClient('http://localhos...') #1 {main} thrown in C:\wamp\www\magento\test.php on line 8


Ik voer de volgende code uit:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
$client
= new SoapClient('http://localhost/magento/index.php/api/v2_soap/?wsdl=1');
// If soap isn't default use this link instead
// http://youmagentohost/api/soap/?wsdl

// If somestuff requires api authentification,
// we should get session token

$session = $client->login('klombarts', '******');

$result = $client->call($session, 'somestuff.method');
$result = $client->call($session, 'somestuff.method', 'arg1');
$result = $client->call($session, 'somestuff.method', array('arg1', 'arg2', 'arg3'));
$result = $client->multiCall($session, array(
     array('somestuff.method'),
     array('somestuff.method', 'arg1'),
     array('somestuff.method', array('arg1', 'arg2'))
));



// If you don't need the session anymore
$client->endSession($session);
?>


Ik heb ook al verschillende url's geprobeerd bij new soapclient, iemand misschien enige idee wat ik nog kan proberen?

Heb PHP versie 5.2.6 en Magento versie 1.3.2.4

Alvast bedankt!
 
PHP hulp

PHP hulp

25/04/2024 12:20:21
 
Jurgen assaasas

Jurgen assaasas

12/01/2010 16:45:00
Quote Anchor link
Wat krijg je als je de SOAP URL rechtstreeks benaderd? Krijg je dan het WSDL file in XML te zien?
 
Kitty N

kitty N

12/01/2010 16:59:00
Quote Anchor link
Ja dan krijg ik hem in XML te zien.

Als ik dit gebruik:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
<?php
$client
= new SoapClient('http://localhost/magento/index.php/api/v2_soap/?wsdl');
?>


in PHP versie 5.2.6 dan krijg ik die error die ik hierboven vermelden, doe ik precies hetzelfde maar dan in versie 5.3.0 krijg ik de volgende melding:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/magento/index.php/api/v2_soap/?wsdl' : Extra content at the end of the document in C:\wamp\www\test.php:2 Stack trace: #0 C:\wamp\www\test.php(2): SoapClient->SoapClient('http://localhos...') #1 {main} thrown in C:\wamp\www\test.php on line 2
 
Kitty N

kitty N

15/01/2010 15:41:00
Quote Anchor link
Helaas geen reacties meer gehad, ben nu dus maar eens begonnen met de xml ervan..

Alleen loop ik hiermee ook vast...

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
<?php
require_once('app/Mage.php');
require_once 'Zend/XmlRpc/Client.php';
require_once('Zend/Http/Client.php');

$client = new Zend_XmlRpc_Client('http://spiderman/magento/api/xmlrpc/');

$session = $client->call('login', array('kitty', '*****'));  
?>


Dan krijg ik de volgende error..

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
Fatal error: Uncaught exception 'Zend_XmlRpc_Client_HttpException' with message 'Bad Request' in C:\Inetpub\wwwroot\magento\lib\Zend\XmlRpc\Client.php:284 Stack trace: #0 C:\Inetpub\wwwroot\magento\lib\Zend\XmlRpc\Client.php(339): Zend_XmlRpc_Client->doRequest(Object(Zend_XmlRpc_Request)) #1 C:\Inetpub\wwwroot\magento\soapapi.php(8): Zend_XmlRpc_Client->call('login', Array) #2 {main} thrown in C:\Inetpub\wwwroot\magento\lib\Zend\XmlRpc\Client.php on line 284
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.