Guest User

Untitled

a guest
Mar 16th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. $wsdl = 'my.wsdl';
  2. $username = 'username ';
  3. $password = 'password `enter code here`';
  4. $wss_ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
  5. $wsu = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
  6. $created = date('Y-m-dTH:i:s.0000Z', time());
  7. $nonce = base64_encode(bin2hex(openssl_random_pseudo_bytes(16)));
  8. $auth = new stdClass();
  9. $auth->Username = new SoapVar($username, XSD_STRING, NULL, $wss_ns, NULL, $wss_ns);
  10. $auth->Password = new SoapVar($password, XSD_STRING, NULL, $wss_ns, NULL, $wss_ns);
  11. $auth->Nonce = new SoapVar($nonce, XSD_STRING, NULL, $wss_ns, NULL, $wss_ns);
  12. $auth->Created = new SoapVar($created, XSD_STRING, NULL, $wsu, NULL, $wsu);
  13. $username_token = new stdClass();
  14. $username_token->UsernameToken = new SoapVar($auth, SOAP_ENC_OBJECT, NULL, $wss_ns, 'UsernameToken', $wss_ns);
  15. $security_sv = new SoapVar(
  16. new SoapVar($username_token, SOAP_ENC_OBJECT, NULL, $wss_ns, 'UsernameToken', $wss_ns), SOAP_ENC_OBJECT, NULL, $wss_ns, 'Security', $wss_ns);
  17. $client = new SoapClient($wsdl, array("trace" => 1));
  18. $secheader = new SoapHeader('Security', $security_sv,true);
  19. $client->__setSoapHeaders($secheader);
  20.  
  21. $request = array(
  22. "HPSIncDataRequest" => array('SYSTEM_ID' => 'OA',
  23. 'DATA_TYPE' => '',
  24. 'BGN_DT' => '2016-01-01 00:00:00',
  25. 'END_DT' => '2016-06-01 00:00:00',
  26. 'PAGE_NUM' => 1,
  27. 'PAGE_SIZE' => 1000),
  28. )
  29. $results = $client->__soapCall('HPSJCODEINCDATASERVICE', $request);
  30.  
  31. <soapenv:Envelope xmlns:hps="http://xmlns.oracle.com/Enterprise/Tools/schemas/HPSServiceDocs.HPSIncDataRequest.V1" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  32. <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" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:UsernameToken wsu:Id="UsernameToken-52B0EB9532D4C63E3514896495196904"><wsse:Username>username</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">8L5jM6TwiBi/4/JbKSg1qA==</wsse:Nonce><wsu:Created>2017-03-16T07:31:59.690Z</wsu:Created></wsse:UsernameToken></wsse:Security></soapenv:Header>
  33. <soapenv:Body>
  34. <hps:HPSIncDataRequest>
  35. <hps:SYSTEM_ID>OA</hps:SYSTEM_ID>
  36. <hps:DATA_TYPE/>
  37. <hps:BGN_DT>2016-01-01 00:00:00</hps:BGN_DT>
  38. <hps:END_DT>2016-06-01 00:00:00</hps:END_DT>
  39. <hps:PAGE_NUM>1</hps:PAGE_NUM>
  40. <hps:PAGE_SIZE>1000</hps:PAGE_SIZE>
  41. </hps:HPSIncDataRequest>
  42. </soapenv:Body>
  43. </soapenv:Envelope>
Add Comment
Please, Sign In to add comment