Guest User

Untitled

a guest
Dec 4th, 2018
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.78 KB | None | 0 0
  1. PHP Warning: simplexml_load_string(): Entity: line 1: parser error : Space required after the Public Identifier in /opt/bitnami/pedidos/pedido2.php on line 323
  2. PHP Warning: simplexml_load_string(): <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/str in /opt/bitnami/pedidos/pedido2.php on line 323
  3. PHP Warning: simplexml_load_string(): ^ in /opt/bitnami/pedidos/pedido2.php on line 323
  4. PHP Warning: simplexml_load_string(): Entity: line 3: parser error : Opening and ending tag mismatch: META line 3 and HEAD in /opt/bitnami/pedidos/pedido2.php on line 323
  5. PHP Warning: simplexml_load_string(): <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD> in /opt/bitnami/pedidos/pedido2.php on line 323
  6. PHP Warning: simplexml_load_string(): ^ in /opt/bitnami/pedidos/pedido2.php on line 323
  7. PHP Warning: simplexml_load_string(): Entity: line 6: parser error : Opening and ending tag mismatch: hr line 5 and BODY in /opt/bitnami/pedidos/pedido2.php on line 323
  8. PHP Warning: simplexml_load_string(): </BODY></HTML> in /opt/bitnami/pedidos/pedido2.php on line 323
  9. PHP Warning: simplexml_load_string(): ^ in /opt/bitnami/pedidos/pedido2.php on line 323
  10. PHP Warning: simplexml_load_string(): Entity: line 6: parser error : Opening and ending tag mismatch: BODY line 4 and HTML in /opt/bitnami/pedidos/pedido2.php on line 323
  11. PHP Warning: simplexml_load_string(): </BODY></HTML> in /opt/bitnami/pedidos/pedido2.php on line 323
  12. PHP Warning: simplexml_load_string(): ^ in /opt/bitnami/pedidos/pedido2.php on line 323
  13. PHP Warning: simplexml_load_string(): Entity: line 7: parser error : Premature end of data in tag HEAD line 2 in /opt/bitnami/pedidos/pedido2.php on line 323
  14. PHP Warning: simplexml_load_string(): in /opt/bitnami/pedidos/pedido2.php on line 323
  15. PHP Warning: simplexml_load_string(): ^ in /opt/bitnami/pedidos/pedido2.php on line 323
  16. PHP Warning: simplexml_load_string(): Entity: line 7: parser error : Premature end of data in tag HTML line 2 in /opt/bitnami/pedidos/pedido2.php on line 323
  17. PHP Warning: simplexml_load_string(): in /opt/bitnami/pedidos/pedido2.php on line 323
  18. PHP Warning: simplexml_load_string(): ^ in /opt/bitnami/pedidos/pedido2.php on line 323
  19.  
  20. function create_client($xml_cli){
  21.  
  22. $soapUrl = "http://webservices2.ekamat.es:47047/NaviSC80/WS/CRONUS%20Espa%C3%B1a%20S.A./Codeunit/WSMagento"; // asmx URL of WSDL
  23. $soapUser = "CORE-NAV2013usuariows"; // username
  24. $soapPassword = "usuario.WS"; // password
  25. // xml post structure
  26.  
  27. $xml_post_string = '<?xml version="1.0" encoding="utf-8"?>
  28. <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  29. xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  30. <soap:Body>
  31. <wsm:CreateCustomer>
  32. <wsm:xmlCustomer>
  33. <x60:OrderHeader>
  34. '.$xml_cli.'
  35. </x60:OrderHeader>
  36. </wsm:xmlOrder>
  37. </wsm:CreateCustomer>
  38. </soap:Body>
  39. </soap:Envelope>'; // data from the form, e.g. some ID number
  40.  
  41. $headers = array(
  42. "Content-type: text/xml;charset="utf-8"",
  43. "Accept: text/xml",
  44. "Cache-Control: no-cache",
  45. "Pragma: no-cache",
  46. "SOAPAction: urn:microsoft-dynamics-schemas/codeunit/WSMagento:CreateCustomer",
  47. "Content-length: ".strlen($xml_post_string),
  48. );
  49.  
  50. $url = $soapUrl;
  51.  
  52. // PHP cURL for https connection with auth
  53. $ch = curl_init();
  54. //curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
  55. curl_setopt($ch, CURLOPT_URL, $url);
  56. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  57. curl_setopt($ch, CURLOPT_USERPWD, $soapUser.":".$soapPassword); // username and password - declared at the top of the doc
  58. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
  59. //curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  60. curl_setopt($ch, CURLOPT_POST, true);
  61. curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request
  62. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  63.  
  64. // converting
  65. $response = curl_exec($ch);
  66. curl_close($ch);
  67.  
  68. // converting
  69. $response1 = str_replace("<soap:Body>","",$response);
  70. $response2 = str_replace("</soap:Body>","",$response1);
  71. // convertingc to XML
  72. $parser = simplexml_load_string($response2);
  73. }
Add Comment
Please, Sign In to add comment