Advertisement
Guest User

test soap

a guest
May 9th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. $post_string= '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservice.bccsgw.viettel.com/">
  2. <soapenv:Header/>
  3. <soapenv:Body>
  4. <web:gwOperation>
  5. <Input>
  6. <username>2427adb509b93ed4</username>
  7. <password>e7a34fb48b5f12af4687ccba21e07165</password>
  8. <wscode>getSubAcc</wscode>
  9. <param name="msisdn" value="8562099997106"/>
  10. <rawData>?</rawData>
  11. </Input>
  12. </web:gwOperation>
  13. </soapenv:Body>
  14. </soapenv:Envelope>';
  15.  
  16. $user = "2427adb509b93ed4";
  17. $password = "e7a34fb48b5f12af4687ccba21e07165";
  18. $url = 'http://183.182.100.169:8999/BCCSGateway';
  19. $soap_do = curl_init();
  20. curl_setopt($soap_do, CURLOPT_URL, $url );
  21. curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10);
  22. curl_setopt($soap_do, CURLOPT_TIMEOUT, 10);
  23. curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
  24. curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
  25. curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
  26. curl_setopt($soap_do, CURLOPT_POST, true );
  27. curl_setopt($soap_do, CURLOPT_POSTFIELDS, $post_string);
  28. curl_setopt($soap_do, CURLOPT_HTTPHEADER, array('Content-Type: text/xml; charset=utf-8', 'Content-Length: '.strlen($post_string) ));
  29. // curl_setopt($soap_do, CURLOPT_USERPWD, $user . ":" . $password);
  30.  
  31. $result = curl_exec($soap_do);
  32. $err = curl_error($soap_do);
  33.  
  34. // $xml=simplexml_load_string($result);
  35. //// var_dump($err);
  36. var_dump( $result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement