He creado un servicio WCF con un método que devuelve un System.Xml.XmlElement
:VS2010 confunde System.Xml.XmlElement con System.Xml.Linq.XElement?
Interfaz:
[ServiceContract]
public interface IWCFService
{
[OperationContract]
XmlElement Execute(...);
}
Servicio:
public XmlElement Execute(...)
{
XmlNode node = ...;
return (XmlElement)node;
}
Cuando intento acceder al servicio desplegado en mi servidor
WCFServiceClient service = new WCFServiceClient("WSHttpBinding_IWCFService");
XmlElement node = service.Execute(...);
me sale el error:
Cannot implicitly convert type 'System.Xml.Linq.XElement' to 'System.Xml.XmlElement'
Buscando mi solución servicio, no puedo ver ninguna referencia a System.Xml.Linq.XElement
. ¿Es malo de mi parte esperar un System.Xml.XmlElement
o VS 2010 está bromeando conmigo?
Intente llamar al servicio utilizando wcftestclient.exe. tuviste algun error? –
@Raj: Esto no es posible ya que 'wcftestclient' no es compatible con' System.Xml.XmlElement'. Pero lo suficientemente gracioso no menciona nada sobre 'System.Xml.Linq.XmlElement'. – Chau
Vea si esta publicación ayuda: http://social.msdn.microsoft.com/Foros/es-ES/wcf/thread/2f29bdab-a3ab-41b9-980a-692e7bb7e133 –