Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- 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
- PHP Warning: simplexml_load_string(): ^ in /opt/bitnami/pedidos/pedido2.php on line 323
- 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
- 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
- PHP Warning: simplexml_load_string(): ^ in /opt/bitnami/pedidos/pedido2.php on line 323
- 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
- PHP Warning: simplexml_load_string(): </BODY></HTML> in /opt/bitnami/pedidos/pedido2.php on line 323
- PHP Warning: simplexml_load_string(): ^ in /opt/bitnami/pedidos/pedido2.php on line 323
- 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
- PHP Warning: simplexml_load_string(): </BODY></HTML> in /opt/bitnami/pedidos/pedido2.php on line 323
- PHP Warning: simplexml_load_string(): ^ in /opt/bitnami/pedidos/pedido2.php on line 323
- 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
- PHP Warning: simplexml_load_string(): in /opt/bitnami/pedidos/pedido2.php on line 323
- PHP Warning: simplexml_load_string(): ^ in /opt/bitnami/pedidos/pedido2.php on line 323
- 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
- PHP Warning: simplexml_load_string(): in /opt/bitnami/pedidos/pedido2.php on line 323
- PHP Warning: simplexml_load_string(): ^ in /opt/bitnami/pedidos/pedido2.php on line 323
- function create_client($xml_cli){
- $soapUrl = "http://webservices2.ekamat.es:47047/NaviSC80/WS/CRONUS%20Espa%C3%B1a%20S.A./Codeunit/WSMagento"; // asmx URL of WSDL
- $soapUser = "CORE-NAV2013usuariows"; // username
- $soapPassword = "usuario.WS"; // password
- // xml post structure
- $xml_post_string = '<?xml version="1.0" encoding="utf-8"?>
- <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <soap:Body>
- <wsm:CreateCustomer>
- <wsm:xmlCustomer>
- <x60:OrderHeader>
- '.$xml_cli.'
- </x60:OrderHeader>
- </wsm:xmlOrder>
- </wsm:CreateCustomer>
- </soap:Body>
- </soap:Envelope>'; // data from the form, e.g. some ID number
- $headers = array(
- "Content-type: text/xml;charset="utf-8"",
- "Accept: text/xml",
- "Cache-Control: no-cache",
- "Pragma: no-cache",
- "SOAPAction: urn:microsoft-dynamics-schemas/codeunit/WSMagento:CreateCustomer",
- "Content-length: ".strlen($xml_post_string),
- );
- $url = $soapUrl;
- // PHP cURL for https connection with auth
- $ch = curl_init();
- //curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_USERPWD, $soapUser.":".$soapPassword); // username and password - declared at the top of the doc
- curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
- //curl_setopt($ch, CURLOPT_TIMEOUT, 10);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- // converting
- $response = curl_exec($ch);
- curl_close($ch);
- // converting
- $response1 = str_replace("<soap:Body>","",$response);
- $response2 = str_replace("</soap:Body>","",$response1);
- // convertingc to XML
- $parser = simplexml_load_string($response2);
- }
Add Comment
Please, Sign In to add comment