PHP SOAP CreateSessionContext


/ Published in: PHP
Save to your folder(s)

Mockup of how to create a SessionContext using PHP SOAP and ClientServices 2


Copy this code and paste it in your HTML
  1. $client = new SoapClient("http://cs2.acme.com/SessionService.svc?wsdl",
  2. array('location' => "http://cs2.acme.com/SessionService.svc/basic"));
  3.  
  4. $createSessionContextParameters->IpAdress = '127.0.0.1';
  5. $createSessionContextParameters->ClientType = 'web_browser';
  6. $createSessionContextParameters->Referrer = '';
  7. $createSessionContextParameters->OperatorOverride = 'abc12345def67';
  8. $createSessionContextParameters->ServiceID = 123;
  9. $createSessionContextParameters->RegionOverride = '';
  10. $createSessionContextParameters->LanguageOverride = '';
  11.  
  12. try{
  13. $response = $client->CreateSessionContext(array('parameters' => $createSessionContextParameters));
  14. }
  15. catch(SoapFault $fault){
  16. trigger_error("ERROR: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
  17. }
  18.  
  19. $sessionContext = $response->CreateSessionContextResult;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.