Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/08/2014, 12:46
Avatar de YeisonSoto
YeisonSoto
 
Fecha de Ingreso: enero-2011
Ubicación: Cali, Colombia, Colombia
Mensajes: 116
Antigüedad: 13 años, 3 meses
Puntos: 4
Pregunta Obtener Respuesta XML WebService

Buenas Tardes Amigos del foro del web estoy trabajando en un proyecto en el cual me debo consumir un servicio web.

Tengo esta respuesta que obtuve:

Pero no estoy seguro si este es Response completo o es el XML.
Si no es el XML puro como puedo obtenerlo??

Gracias.


Código XML:
Ver original
  1. <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  2.     <s:Body>
  3.         <GetStockQuoteResponse xmlns="http://www.restfulwebservices.net/ServiceContracts/2008/01">
  4.             <GetStockQuoteResult xmlns:a="http://www.restfulwebservices.net/DataContracts/2008/01" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  5.                 <a:Symbol>IBM</a:Symbol>
  6.                 <a:Last>187.18</a:Last>
  7.                 <a:Date>8/12/2014</a:Date>
  8.                 <a:Time>2:07pm</a:Time>
  9.                 <a:Change>-0.29</a:Change>
  10.                 <a:Open>187.45</a:Open>
  11.                 <a:High>188.69</a:High>
  12.                 <a:Low>186.81</a:Low>
  13.                 <a:Volume>1048490</a:Volume>
  14.                 <a:MktCap>186.7B</a:MktCap>
  15.                 <a:PreviousClose>187.47</a:PreviousClose>
  16.                 <a:PercentageChange>-0.15%</a:PercentageChange>
  17.                 <a:AnnRange>172.19 - 199.21</a:AnnRange>
  18.                 <a:Earns>15.85</a:Earns>
  19.                 <a:PE>11.83</a:PE>
  20.                 <a:Name>International Bus</a:Name>
  21.             </GetStockQuoteResult>
  22.         </GetStockQuoteResponse>
  23.     </s:Body>
  24. </s:Envelope>


Este es la forma como lo obtengo.


Código PHP:
Ver original
  1. <?php
  2.    
  3.         $wsdl = "http://www.restfulwebservices.net/wcf/StockQuoteService.svc?wsdl";
  4.    
  5.             $client = new SoapClient($wsdl, array(
  6.                                 "trace"=>1,
  7.                                 "exceptions"=>0));
  8.  
  9.             $stock = "IBM";
  10.             $parameters= array("request"=>$stock);
  11.             $value = $client->GetStockQuote($parameters);
  12.    
  13.         print "<pre>\n";
  14.         print "<br />\n Response: ".htmlspecialchars($client->__getLastResponse());
  15.         print "</pre>";
  16.    
  17.     ?>