Buen día hermanos!
Tengo un webService en C# y lo quiero consumir con PHP pero al momento de cargarlo me aparece este error.
Catchable fatal error: Object of class stdClass could not be converted to string
Les dejo mi código, muchas gracias!
<?php
require("nusoap/lib/nusoap.php");
// Llamada al WebService
$wsdl ="http://192.168.1.1:8081/MyWebService.asmx?WSDL";
$client = new SoapClient($wsdl);
$result = $client->Saludo();
$xml = $result;
// procesar xml
$xml = simplexml_load_string($xml->$result);
print_r($xml);
?>
El retorno del webService sería un saludo solamente.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
/// <summary>
/// Summary description for MyWebService
/// </summary>
[WebService(Namespace = "http://tempuraxs.mx/webservices/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class MyWebService : System.Web.Services.WebService
{
public MyWebService()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string Saludo()
{
return "Has creado tu servicio web";
}
}
$xml = simplexml_load_string($result);