Don't like ads? PRO users don't see any ads ;-)
Guest

ksugihara

By: a guest on Aug 17th, 2012  |  syntax: PHP  |  size: 0.85 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //creating the stream context option containing the http headers
  2. $ctx = stream_context_create($opts);
  3.  
  4. $soapClient = new SoapClient($wsdl,
  5.                                                         array('location' => $api_endpoint,
  6.                                   'uri' => "urn:ConvertCurrency",
  7.                                   'soap_version' => SOAP_1_1,
  8.                                   'trace' => 1, //debugging option
  9.                                   'stream_context' => $ctx)); //adding the stream context option containing the http headers
  10.  
  11. $response = $soapClient->ConvertCurrency($params);
  12.  
  13. //The $response is a PreapprovalResponse type.
  14. //Retriving few information from the response
  15.  
  16. debug($response);
  17.  
  18.  
  19. } catch (SoapFault $e) {
  20.    echo "Error Id : ||" . $e->detail->FaultMessage->error->errorId. "<br/>";
  21.    echo "Error Message : ||" . $e->detail->FaultMessage->error->message;       
  22. }