0
votes

After days of continual effort, I am at a complete loss as to why I cannot get the Soap API to work for my Magento Install.

The Magento Install is version 1.8.1 PHP version 5.3

I have a script that uses Oauth for authentication and Soap V2 (have also tested with Soap v1).

The URL for this script is dev.redxmedia.co.uk/aff1/oauth_customer.php Here is the code...

// Enable error reporting 
error_reporting(E_ALL);
ini_set('display_errors', '1');

//create soap object
$proxy = new SoapClient('http://dev.redxmedia.co.uk/1and1/api/v2_soap/?wsdl');

// create authorized session id using api user name and api key
// $sessionId = $proxy->login('apiUser', 'apiKey');
$sessionId = $proxy->login('aff1', 'password');

// Get customer info for customer id = 1
$customerinfo = $proxy->customerCustomerInfo($sessionId,1);

print_r($customerinfo);

The response received is as follows...

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://dev.redxmedia.co.uk/1and1/api/v2_soap/?wsdl' : Start tag expected, '<' not found in /home/sites/redxmedia.co.uk/public_html/dev/aff1/oauth_customer.php:7 Stack trace: #0 /home/sites/redxmedia.co.uk/public_html/dev/aff1/oauth_customer.php(7): SoapClient->SoapClient('http://dev.redx...') #1 {main} thrown in /home/sites/redxmedia.co.uk/public_html/dev/aff1/oauth_customer.php on line 7

If you put the Soap URL in the browser directly you get what appears to be the expected response.

After going through many of the given responses in other Questions I believe I have satisfied the PHP configuation requirements.

PHP info can be found at dev.redxmedia.co.uk/info.php

The username and password given are active as this is not a live site, so please feel free to test...

Any help at this stage will be hugely appreciated...!

1

1 Answers