Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $wsdl = "http://irusalserver.dns-dns.com/eComerce/Servicio.asmx";
- $xml = '<?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>
- <GenerarVenta xmlns="http://tempuri.org/">
- <venta>
- <VentaDT>
- <Encabezado>
- <FechaEntrega type="xs:dateTime">2019-08-27T12:20:00</FechaEntrega>
- <Amex type="xs:decimal">0</Amex>
- <Tarjeta type="xs:decimal">899</Tarjeta>
- </Encabezado>
- <Cuerpo>
- <Producto_Id type="xs:string">013059</Producto_Id>
- <Cantidad type="xs:decimal">1</Cantidad>
- <Precio type="xs:decimal">899</Precio>
- </Cuerpo>
- </VentaDT>
- </venta>
- </GenerarVenta>
- </soap:Body>
- </soap:Envelope>';
- $headers = array(
- "Content-type: text/xml; charset=utf-8",
- "Cache-Control: no-cache",
- "Pragma: no-cache",
- "SOAPAction: \"http://tempuri.org/GenerarVenta\"",
- "Content-length: ".strlen($xml),
- );
- $soap_do = curl_init();
- curl_setopt($soap_do, CURLOPT_URL, $wsdl);
- curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10);
- curl_setopt($soap_do, CURLOPT_TIMEOUT, 10);
- curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
- curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($soap_do, CURLOPT_POST, true );
- curl_setopt($soap_do, CURLOPT_POSTFIELDS, $xml);
- curl_setopt($soap_do, CURLOPT_HTTPHEADER, $headers);
- $result = curl_exec($soap_do);
- $err = curl_error($soap_do);
- var_export($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement