Question: Why would you want to do that? The reason you have namespace is to
distinctly identify the service. If two services are identical, regardless
of the server they run in, they should have the same namespace. Besides, the
namespace does not have to do with the URL, although URLs make good
"distinguishers" for similar services.
That said, I don't think there is a way to have a dynamic namespace
(although I am not certain). First of all, the WSDL is generated not at
run-time -- it is upon reflection of the wev service assembly. Second, the
proxies contain a reference namespace, and you may have to create one proxy
for each server, to account for different namespaces.

Signature
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
> Does anyone have a method for using a dynamically-generated namespace in a
> web service?
>
> Scenario: suppose you're deploying the web service to mulitple servers and
> you want the namespace to be generated at run-time to reflect the server or
> domain where it resides.
Jonathan Eggert - 28 Mar 2005 17:19 GMT
I realize the purpose of namespaces but the convention is to use the URL to
distinguish services. If I would like to adhere to that rule, how could I
do that? It appears that you can use a Constant or Enumeration to change
the value of the Namespace attribute, but not a value generated on the fly
(returned by a method). Does anyone have any experience with this?
I have two domains this.server.com and another.server.com
I want the namespace for the same service on a different server to be
reflected at runtime.
Example:
http://this.server.com/webservice/service.asmx
and
http://another.server.com/webservice/service.asmx
I want to generate the namespace depending on which server/domain the
service resides.
Hi
I have the same problem. I'm developing webservices and for this, I have 3 platforms: Development, Integration and Production. Now I want to set the namespace for the Services to [platform].[myCompanyName].[WebserviceName]. This is because the same webservice may be different between each platform. And when I want to promote it for ex. from int to prod I don't want to recompile the service. (Because this is a working build)
Is there really no possibility to do this?
Thx for your help!
From http://www.developmentnow.com/g/16_2005_3_0_0_370396/changing-the-web-service-na
mespace-at-runtime.ht