> 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?)
I would suggest to configure your web service in a way that the
namespace does not change. That is possible as a namespace does not have
to refer to an existing resource.
If you want to read out namespaces from an XmlDocument then how you do
that depends on the structure of the XML. If there is just one default
namespace declaration on the root element e.g.
<root xmlns="http://example.com/2007/ns1">
then you can simply access
doc.DocumentElement.namespaceURI
(where doc is your XmlDocument instance).
Using SelectSingleNode or SelectNodes you are also able to access the
namespace nodes the XPath data model knows. If you need help with that
then show us a relevant sample of the XML.

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
maflatoun@gmail.com - 28 Jun 2007 14:19 GMT
> maflat...@gmail.com wrote:
> > The issue is that the namespace changes depending on where the web
[quoted text clipped - 22 lines]
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/
Thank you for your reply. Can you please show me or point me to an
article for configuring web services in a way that the namespace does
not change?
Thanks
Maz.
maflatoun@gmail.com - 28 Jun 2007 14:23 GMT
On Jun 28, 9:19 am, maflat...@gmail.com wrote:
> > maflat...@gmail.com wrote:
> > > The issue is that the namespace changes depending on where the web
[quoted text clipped - 31 lines]
>
> - Show quoted text -
Never mind. Dumb question. I got it.
Thx
Maz
Martin Honnen - 28 Jun 2007 14:27 GMT
> Can you please show me or point me to an
> article for configuring web services in a way that the namespace does
> not change?
The namespace URI is simply a name so you can set up your namespaces
with an attribute as follows:
[WebService(Description="My Service", Namespace="http://example.com/ws1/")]
Choose a name that you own/control like a domain name you control.

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/