Advertisement
Guest User

Soap Request PHP

a guest
Aug 23rd, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.58 KB | None | 0 0
  1. <?php
  2. $wsdl = "http://irusalserver.dns-dns.com/eComerce/Servicio.asmx?wsdl";$wsdl = "http://irusalserver.dns-dns.com/eComerce/Servicio.asmx?wsdl";
  3.         $client = new SoapClient($wsdl,
  4.             array(
  5.                 'trace' => 1,
  6.                 "cache_wsdl" => 0,
  7.                 "soap_version"  => SOAP_1_1
  8.             )
  9.         );
  10.        
  11.         $encabezado = array();
  12.         $encabezado[] = new SoapVar("2019-08-27T12:20:00",XSD_DATETIME,'datetime','http://www.w3.org/2001/XMLSchema','FechaEntrega');
  13.         $encabezado[] = new SoapVar(0,XSD_DECIMAL,'decimal','http://www.w3.org/2001/XMLSchema','Amex');
  14.         $encabezado[] = new SoapVar(899, XSD_DECIMAL, 'decimal', 'http://www.w3.org/2001/XMLSchema', 'Tarjeta' );
  15.         $BigEncabezado = new SoapVar($encabezado,SOAP_ENC_OBJECT,null,null,'Encabezado');
  16.  
  17.         $cuerpo=array();
  18.         $cuerpo[]=new SoapVar("013059",XSD_STRING,'string','http://www.w3.org/2001/XMLSchema','Producto_Id');
  19.         $cuerpo[]=new SoapVar(1,XSD_DECIMAL,'decimal','http://www.w3.org/2001/XMLSchema','Cantidad');
  20.         $cuerpo[]=new SoapVar(899,XSD_DECIMAL,'decimal','http://www.w3.org/2001/XMLSchema','Precio');
  21.         $BigCuerpo=new SoapVar($cuerpo,SOAP_ENC_OBJECT,null,null,'Cuerpo');
  22.        
  23.         /*$FF = array(
  24.             'VentaDT' => array($BigEncabezado,$BigCuerpo)
  25.         );*/
  26.  
  27.         $FF = array($BigEncabezado,$BigCuerpo);
  28.  
  29.         $FlexFields = new SoapVar($FF,SOAP_ENC_OBJECT,null,null,'venta');
  30.         $resp = $client->GenerarVenta(
  31.             array('venta'=>$FlexFields)
  32.         );
  33.         pr($resp);
  34.        
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement