SOAP via CURL in PHP

Suepleslece

New Member
We're using the Equifax ID verification system and this PHP code:\[code\]$user = "USERNAME HERE";$password = "PASSWORD";$post_string = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://eid.equifax.com/soap/schema/uk/v2"><soapenv:Header> <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:UsernameToken wsu:Id="UsernameToken-6" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:Username>/'.$user.'</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">'.$password.'</wsse:Password> <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">HQdwZFMD2D/hajyoSTwJQQ==</wsse:Nonce> <wsu:Created>2011-12-20T14:08:02.848Z</wsu:Created> </wsse:UsernameToken> </wsse:Security> </soapenv:Header></soapenv:Envelope>'; $soap_do = curl_init(); curl_setopt($soap_do, CURLOPT_URL, "https://pilot.eidverifier.com/uru/soap/ut/ukv2?wsdl" ); curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($soap_do, CURLOPT_TIMEOUT, 10); curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($soap_do, CURLOPT_POST, true ); curl_setopt($soap_do, CURLOPT_POSTFIELDS, $post_string); curl_setopt($soap_do, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=utf-8', 'Content-Length: '.strlen($post_string) )); curl_setopt($soap_do, CURLOPT_USERPWD, $user . ":" . $password);$result = curl_exec($soap_do);$err = curl_error($soap_do);if(curl_exec($soap_do) === false){ $err = 'Curl error: ' . curl_error($soap_do); curl_close($soap_do); echo $err;}else{ curl_close($soap_do); echo $result; }\[/code\]However it is returning this error message: \[code\]soap:ServerFault occurred while processing.\[/code\]If anybody could either convert this into the new PHP5 SoapClient() class or assist with the reasons as to why this isn't working that'd be great.Many thanks,Nick
 
Back
Top