jump to navigation

Namespace prefix ‘ns1’ is not defined. XMLDocument June 17, 2016

Posted by juanpablo1manrique in SharePoint.
Tags: , ,

Para solucionar este toca agregar todos los namespaces del mensaje


XmlNamespaceManager nsm = new XmlNamespaceManager(new NameTable());

nsm.AddNamespace(“SOAP-ENV”, “http://schemas.xmlsoap.org/soap/envelope/”);
nsm.AddNamespace(“ns1”, “http://schemas.xmlsoap.org/wsdl/soap/”);
nsm.AddNamespace(“xsd”, “http://www.w3.org/2001/XMLSchema”);
nsm.AddNamespace(“xsi”, “http://www.w3.org/2001/XMLSchema-instance”);
nsm.AddNamespace(“SOAP-ENC”, “http://schemas.xmlsoap.org/soap/encoding/”);
nsm.AddNamespace(“ns2”, “http://xml.apache.org/xml-soap”);
nsm.AddNamespace(“ns3”, “http://www.example.org/myns/”);

XmlNode node = xdoc.SelectSingleNode(“/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:metodo1/return/property1”,nsm);



PD. Recomendado



Errores relacionados

‘XElement’ does not contain a definition for ‘XPathSelectElements’ and no extension method ‘XPathSelectElements’ accepting a first argument of type ‘XElement’ could be found (are you missing a using directive or an assembly reference?



No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: