3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //Username and password. $username = 'phillip.morris@gbgplc.com'; $password = 'Sp1der031!'; $wsdl = 'https://idmp.gb.co.uk/idm-globalservices-ws/GlobalServices15b.wsdl'; $soapClient = new SoapClient($wsdl, array('compression' => SOAP_COMPRESSION_ACCEPT, 'trace' => 1, 'cache_wsdl' => WSDL_CACHE_NONE,)); //Authenticate user account and return authenticationToken $clientIP = $_SERVER['REMOTE_ADDR']; $authUserArray = array('username' => $username, 'userIdentity' => '', 'password' => $password, 'ipAddress' => $clientIP); try { $soapAuthUser = $soapClient->AuthenticateUser($authUserArray); $authToken = $soapAuthUser->authenticationToken; } catch (Exception $e) { echo '<h3>soapAuthenticateUser Exception</h3><br />'; echo '<pre>'; print_r($e); echo '</pre>'; } //Security Header $objParam = new stdClass(); $objParam ->securityHeader = new stdClass(); $objParam ->securityHeader->ipAddress = $clientIP; $objParam ->securityHeader->authenticationToken = $authToken; $objParam ->securityHeader->username = $username; //Configuration $objParam ->profileRequest = new stdClass(); $objParam ->profileRequest->customerReference = 'DR-Address-PHP'; $objParam ->profileRequest->profileGuid= '6C49BC44-C104-41b2-BB62-2AE45A09DD54'; $objParam ->profileRequest->configurationId = '1'; //Address Data $objParam ->profileRequest->requestData = new stdClass(); $objParam ->profileRequest->requestData->address = new stdClass(); $objParam ->profileRequest->requestData->address->organisation = ''; $objParam ->profileRequest->requestData->address->street = ''; $objParam ->profileRequest->requestData->address->town = ''; $objParam ->profileRequest->requestData->address->postCode = 'CH4 9GB'; $objParam ->profileRequest->requestData->address->locality = ''; $objParam ->profileRequest->requestData->address->subBuilding = ''; $objParam ->profileRequest->requestData->address->building = ''; $objParam ->profileRequest->requestData->address->subLocality = ''; $objParam ->profileRequest->requestData->address->stateRegion = ''; $objParam ->profileRequest->requestData->address->countryCode = 'GBR'; $objParam ->profileRequest->requestData->address->poBox = ''; $objParam ->profileRequest->requestData->address->freeFormatAddress = ''; //Options $objParam ->profileRequest->requestData->options = new stdClass(); $objParam ->profileRequest->requestData->options->addressEnvelopeFormat = 'A4P'; $objParam ->profileRequest->requestData->options->offset = '0'; $objParam ->profileRequest->requestData->options->maxReturn = '0'; $objParam ->profileRequest->requestData->options->addressSearchLevel = 'PREMISE'; try { $objRet = $soapClient->ExecuteCapture($objParam); echo '<h3>soapExecuteCapture Results</h3><br />'; echo '<pre>'; print_r($objRet); echo '</pre>';} catch (Exception $e) { echo '<h3>soapExecuteCapture Exception</h3><br />'; echo '<pre>'; print_r($e); echo '</pre>'; } ?>
based on F6CuJ
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Class 'SoapClient' not found in /in/HXKQU:7 Stack trace: #0 {main} thrown in /in/HXKQU on line 7
Process exited with code 255.
Output for 5.4.2 - 5.6.28
Fatal error: Class 'SoapClient' not found in /in/HXKQU on line 7
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://idmp.gb.co.uk/idm-globalservices-ws/GlobalServices15b.wsdl' : failed to load external entity "https://idmp.gb.co.uk/idm-globalservices-ws/GlobalServices15b.wsdl" in /in/HXKQU:7 Stack trace: #0 /in/HXKQU(7): SoapClient->SoapClient('https://idmp.gb...', Array) #1 {main} thrown in /in/HXKQU on line 7
Process exited with code 255.