/** * Display SOAP XML Object * * @return Response */ public function webservice(Request $request) { $client = new \SoapClient("http://www2.inegi.org.mx/servicioindicadores/Indicadores.asmx?WSDL"); $indicador = 1002000001; $ubicacionGeografica = 32; if ($request->has("indicador")) { $indicador = $request->input("indicador"); } if ($request->has("ubicacion_geografica")) { $ubicacionGeografica = $request->input("ubicacion_geografica"); } $content = $client->obtieneValoresOportunos(["Indicador" => $indicador, "ubicacionGeografica" => $ubicacionGeografica]); return Response($content->obtieneValoresOportunosResult->any, 200)->header('Content-Type', 'text/xml'); }