Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/08/2017, 08:48
jh0sz
 
Fecha de Ingreso: mayo-2010
Mensajes: 60
Antigüedad: 14 años
Puntos: 0
Enviar xml data via soap web services

Hola amigos,

Requiero enviar datos en XML a este Web Services via SOAP:

http://200.27.180.194:8053/WS_Landin...ndingPage.asmx

Este es el código que estoy usando, ¿que estaría mal? Ya que cuando lo ejecuto no llega la data al web services y tampoco me arroja un mensaje de error.

Código HTML:
<?php 
//$credentials = "username:pass"; 
$url = "http://200.27.180.194:8053/WS_LandingPageDesa/WS_LandingPage.asmx";
$body = '<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <CMTXUCEN_LandingPage xmlns="http://tempuri.org/">
      <ContactosLanding>
        <Contactos>
          <DTO_Contacto>
            <rut>256815222</rut>
            <nombre>Jean</nombre>
            <apellido>Chin</apellido>
            <correo>[email protected]</correo>
            <telefonomovil>997599993</telefonomovil>
            <CodigoCarrera>APU0</CodigoCarrera>
          </DTO_Contacto>
        </Contactos>
      </ContactosLanding>
    </CMTXUCEN_LandingPage>
  </soap12:Body>
</soap12:Envelope>'; /// Your SOAP XML needs to be in this variable

$headers = array( 
	'POST /WS_LandingPageDesa/WS_LandingPage.asmx HTTP/1.1"', 
	'Host: 200.27.180.194"', 
  'Content-Type: text/xml; charset="utf-8"', 
  'Content-Length: '.strlen($body)
); 

$ch = curl_init(); 
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_TIMEOUT, 60); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_USERAGENT, $defined_vars['HTTP_USER_AGENT']);

// Stuff I have added
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $body); 
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
//curl_setopt($ch, CURLOPT_USERPWD, $credentials);

$data = curl_exec($ch); 

?> 
Saludos