M
mazdotnet
Hi,
I'm working on a ASP.NET component with one requirement being to
catch
Web Service exceptions. I've managed to get it working using the
following code
XmlDocument doc = new XmlDocument();
doc.LoadXml(se.Detail.OuterXml);
XmlNamespaceManager nsManager = new
XmlNamespaceManager(doc.NameTable);
nsManager.AddNamespace("prefix", "http://localhost/site/test/
webservice.asmx");
string errorMessage = doc.DocumentElement.SelectSingleNode("//
prefix:ErrorMessage", nsManager).InnerText;
Response.Write("Error message:" + errorMessage);
The issue is that the namespace changes depending on where the web
service resides (ex. staging, production, local computer). How can I
get the http://localhost/site/test/webservice.asmx dynamically (parse
it from XmlDocument?)
Thanks
Maz
I'm working on a ASP.NET component with one requirement being to
catch
Web Service exceptions. I've managed to get it working using the
following code
XmlDocument doc = new XmlDocument();
doc.LoadXml(se.Detail.OuterXml);
XmlNamespaceManager nsManager = new
XmlNamespaceManager(doc.NameTable);
nsManager.AddNamespace("prefix", "http://localhost/site/test/
webservice.asmx");
string errorMessage = doc.DocumentElement.SelectSingleNode("//
prefix:ErrorMessage", nsManager).InnerText;
Response.Write("Error message:" + errorMessage);
The issue is that the namespace changes depending on where the web
service resides (ex. staging, production, local computer). How can I
get the http://localhost/site/test/webservice.asmx dynamically (parse
it from XmlDocument?)
Thanks
Maz