Last active
December 3, 2018 17:59
-
-
Save missoxd/d32a5578f925071a7441842bb53883b8 to your computer and use it in GitHub Desktop.
SOAP Debug that dumps XML response, with some boilerplate for Magento 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SoapClientDebug extends SoapClient | |
{ | |
public function __doRequest($request, $location, $action, $version, $one_way = 0) | |
{ | |
error_log("REQUEST:\n" .$request . "\n"); | |
error_log("LOCATION:\n" .$location . "\n"); | |
error_log("ACTION:\n" .$action . "\n"); | |
error_log("VERSION:\n" .$version . "\n"); | |
error_log("ONE WAY:\n" .$one_way . "\n"); | |
$response = parent::__doRequest($request, $location, $action, $version, $one_way); | |
error_log("RESPONSE:\n" .$response . "\n"); | |
return $response; | |
} | |
} | |
$proxy = new SoapClientDebug('<wsdl>'); | |
### | |
# | |
# Magento 1 - Soap V2 | |
# | |
# $sessionId = $proxy->login('<user>', '<pass>'); | |
# $result = $proxy->salesOrderInfo($sessionId, '<order-id>'); | |
# | |
# Others | |
# | |
### | |
var_dump($result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment