Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $wsdl = 'my.wsdl';
- $username = 'username ';
- $password = 'password `enter code here`';
- $wss_ns = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
- $wsu = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
- $created = date('Y-m-dTH:i:s.0000Z', time());
- $nonce = base64_encode(bin2hex(openssl_random_pseudo_bytes(16)));
- $auth = new stdClass();
- $auth->Username = new SoapVar($username, XSD_STRING, NULL, $wss_ns, NULL, $wss_ns);
- $auth->Password = new SoapVar($password, XSD_STRING, NULL, $wss_ns, NULL, $wss_ns);
- $auth->Nonce = new SoapVar($nonce, XSD_STRING, NULL, $wss_ns, NULL, $wss_ns);
- $auth->Created = new SoapVar($created, XSD_STRING, NULL, $wsu, NULL, $wsu);
- $username_token = new stdClass();
- $username_token->UsernameToken = new SoapVar($auth, SOAP_ENC_OBJECT, NULL, $wss_ns, 'UsernameToken', $wss_ns);
- $security_sv = new SoapVar(
- new SoapVar($username_token, SOAP_ENC_OBJECT, NULL, $wss_ns, 'UsernameToken', $wss_ns), SOAP_ENC_OBJECT, NULL, $wss_ns, 'Security', $wss_ns);
- $client = new SoapClient($wsdl, array("trace" => 1));
- $secheader = new SoapHeader('Security', $security_sv,true);
- $client->__setSoapHeaders($secheader);
- $request = array(
- "HPSIncDataRequest" => array('SYSTEM_ID' => 'OA',
- 'DATA_TYPE' => '',
- 'BGN_DT' => '2016-01-01 00:00:00',
- 'END_DT' => '2016-06-01 00:00:00',
- 'PAGE_NUM' => 1,
- 'PAGE_SIZE' => 1000),
- )
- $results = $client->__soapCall('HPSJCODEINCDATASERVICE', $request);
- <soapenv:Envelope xmlns:hps="http://xmlns.oracle.com/Enterprise/Tools/schemas/HPSServiceDocs.HPSIncDataRequest.V1" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
- <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>
- <soapenv:Body>
- <hps:HPSIncDataRequest>
- <hps:SYSTEM_ID>OA</hps:SYSTEM_ID>
- <hps:DATA_TYPE/>
- <hps:BGN_DT>2016-01-01 00:00:00</hps:BGN_DT>
- <hps:END_DT>2016-06-01 00:00:00</hps:END_DT>
- <hps:PAGE_NUM>1</hps:PAGE_NUM>
- <hps:PAGE_SIZE>1000</hps:PAGE_SIZE>
- </hps:HPSIncDataRequest>
- </soapenv:Body>
- </soapenv:Envelope>
Add Comment
Please, Sign In to add comment