Advertisement
Guest User

Untitled

a guest
Feb 26th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.53 KB | None | 0 0
  1. <?php
  2.  
  3. $wsdl = "https://uatsky.yesbank.in/app/uat/InwardRemittanceByPartnerService2SSL?wsdl";
  4. $uri = "https://uatsky.yesbank.in/app/uat/InwardRemittanceByPartnerService2SSL";
  5.  
  6. $username = "testclient";
  7. $password = "test@123";
  8. $clientId = "iN8wU3yQ7wR7bO5xJ7vB4pS2pN5sH7hG2pO5eT8rJ2gI2uX1oL";
  9. $clientSecret = "8ec936f3-5f7f-4360-b0f1-3a37ffb05fb1";
  10.  
  11. $basicAuth = base64_encode($username.":".$password);
  12. $params = array(       
  13.     'getBalance' => array( 'version' => '1',
  14.                            'partnerCode' => 'PLACID'
  15.                                 ),
  16.                 );
  17.  
  18. $client = new SoapClient(null, array(
  19.     "location" => $wsdl,
  20.     "uri" => $uri,
  21.     "trace"=>1,
  22.     "exceptions"=>0,
  23.  
  24.  
  25. /*  'stream_context' => stream_context_create(
  26.     [
  27.         'http' =>
  28.             [
  29.                 'header'           => implode(
  30.                     "\r\n",
  31.                     [
  32.                         'Accept: application/soap+xml',
  33.                         'X-IBM-Client-Id: ' . $clientId,
  34.                         'X-IBM-Client-Secret: ' . $clientSecret,
  35.                     ]
  36.                 ),
  37.             ],
  38.     ]
  39. )*/
  40.  
  41.  
  42.        
  43. ));
  44.  
  45. $auth = array(
  46.         'Username' => $username,
  47.         'Password' => $password,
  48.         'X-IBM-Client-Id' => $clientId,
  49.         'X-IBM-Client-Secret' => $clientSecret,
  50. );    
  51.  
  52. $header[] = new SOAPHeader($wsdl, 'authenticate', $auth, false);      
  53. $header[] = new SoapHeader('header','Authorization: Basic '.$basicAuth);
  54.  
  55. $client->__setSoapHeaders($header);
  56.    
  57. $result = $client->getBalance($params);
  58.  
  59.  
  60. echo "<pre>";
  61. var_dump($result);
  62.  
  63.  
  64.  
  65. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement