Advertisement
Guest User

Untitled

a guest
Jul 30th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pos="http://PostWebService.org/">
  2. <soap:Header>
  3. <pos:Authentication>
  4. <!--Optional:-->
  5. <pos:UserName>xxxxxxx</pos:UserName>
  6. <!--Optional:-->
  7. <pos:Password>yyyyyyyy</pos:Password>
  8. </pos:Authentication>
  9. </soap:Header>
  10. <soap:Body>
  11. .....
  12. </soap:Body>
  13. </soap:Envelope>
  14.  
  15. $client = new SoapClient({soapurl},$params);
  16. $auth = new stdClass();
  17. $auth->UserName = 'xxxxxxx';
  18. $auth->Password = 'yyyyyyyy';
  19. $header = new SoapHeader('NAMESPACE','Authentication',$auth,false);
  20. $client->__setSoapHeaders($header);
  21.  
  22. $result = $client->__soapCall('{soap function}',array()); // when this line executes it throws me the error "Could not connect to the host"
  23.  
  24. $opts = array(
  25. 'ssl' => array('ciphers'=>'RC4-SHA', 'verify_peer'=>false, 'verify_peer_name'=>false)
  26. );
  27. // SOAP 1.2 client
  28. $params = array ('encoding' => 'UTF-8', 'verifypeer' => false, 'verifyhost' => false, 'soap_version' => SOAP_1_2, 'keep_alive' => false,'trace' => 1, 'exceptions' => 1, "connection_timeout" => 180, 'stream_context' => stream_context_create($opts) );
  29. $client = new SoapClient({soapurl},$params);
  30.  
  31. //Remaining as the same above
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement