cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 soapclient request

SOLVED

Magento 2 soapclient request

Hi,

 

    I am creating an extension for Magento 2 and I need to call third party data with the help of soapclient to show in my extension. I have been using soapclient in my Magent 1.x extension but getting problem in Magento 2.0 extension. This is the code I have been using in Magento 1.x extension.

$options = array('location' => "https://www.abc.com/soapserver.php", 
		'uri' => 'http://localhost/magento2/', 
		'login' => 'xxx', 
		'password' => 'xxx'
		);		
$api = new SoapClient(NULL, $options);
$result = $api->getMyContents();

But this code is not working in my Magento 2 extension. Am I forgetting to add some classes. Need help to make a soapclient request for a third party API.

 

I am thankful for help/suggestion.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2 soapclient request

Its working now, I just changed to

$api = new \Zend\Soap\Client(NULL, $options);

Thanks

View solution in original post

3 REPLIES 3

Re: Magento 2 soapclient request

What exactly error message you got?

Re: Magento 2 soapclient request

Hi,
thanks for your reply. The page just goes blank instead or any error message.

Re: Magento 2 soapclient request

Its working now, I just changed to

$api = new \Zend\Soap\Client(NULL, $options);

Thanks