Skip to content

Instantly share code, notes, and snippets.

@anilex
Forked from Marko-M/soap-debug.php
Created May 2, 2017 10:59
Show Gist options
  • Save anilex/ba30cfd2da1df58d15b96cbd2d3c6420 to your computer and use it in GitHub Desktop.
Save anilex/ba30cfd2da1df58d15b96cbd2d3c6420 to your computer and use it in GitHub Desktop.
Debug SOAP requests
<?php
/**
* Debug SOAP requests
*/
$client = new SoapClient(
'http://example.loc/index.php/api/v2_soap/?wsdl'
);
// Set yourself debug session cookie, for Xdebug and Phpstorm
$client->__setCookie('XDEBUG_SESSION', 'PHPSTORM');
$session = $client->login('user', 'key');
$productId = '123456';
$stockItemData = array(
'qty' => '123',
'is_in_stock ' => 1,
'manage_stock ' => 1
);
$result = $client->catalogInventoryStockItemUpdate($session, $productId, $stockItemData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment