Can't Change Dynamic Web Service Address At Deployment Site 
Author Message
 Can't Change Dynamic Web Service Address At Deployment Site

My Web Service client consists of two Assemblies, PDExplorer.EXE and
PDClient.DLL. The PDClient DLL brokers the interface between the
PDExplorer and the PDPortal Web Service. End to end it looks like this:

PDExplorer <-> PDClient <-> PDPortal

Anyway, since PDportal is a web service, its address is subject to change
over time. Therefore, in PDClient I set this reference up as dynamic. Sure
enough, Visual Studio created an app.config file for PDClient. It looks like
this:

<configuration>
 <appSettings>
  <add key="PDClient.PDPortal.ParaDocs"
value=" http://www.*-*-*.com/ :81/FPSNow/PDPortal.asmx" />
 </appSettings>
</configuration>

(You can try it. There is a web service at this address.)
http://www.*-*-*.com/ :81/FPSNow/PDPortal.asmx

Anyway, I've deployed the following files into a deployment directory:

PDExplorer.EXE, PDClient.DLL and app.config.

However, no matter how I mangle the URL in app.config, the PDExplorer still
connects to the web service (via PDClient.DLL)! this is troublesome since it
indicates to me that PDClient.DLL is using a statically bound web service
address, rather than a dynamic one. I even tried renaming app.config to
PDExplorer.config and PDClient.config, but no dice, the client always
connects to the web service no matter what I do. I need this to be dynamic
because sometimes the IP address changes and I don't want to have to
redistribute a new DLL every time the service address changes. What am I
doing wrong?

Thanks for your help.

- Joe Geretz -



Sun, 05 Jun 2005 11:58:38 GMT  
 Can't Change Dynamic Web Service Address At Deployment Site
Well I saw an example which states that I need to set the .Url property
myself. (I'm kinda wondering, so what's the whole big deal of dynamic in the
first place, but OK, I'll give this a shot...)

So I wrote this little wrapper method to create the WS 'object'.

private PDPortal.ParaDocs zParaDocsPortal()
{
  PDPortal.ParaDocs PDP = new PDPortal.ParaDocs();
  string DynURL =
ConfigurationSettings.AppSettings["PDClient.PDPortal.ParaDocs"];
  PDP.Url = DynURL;
  return PDP;

Quote:
}

Here's the contents of app.config:

<configuration>
 <appSettings>
  <add key="PDClient.PDPortal.ParaDocs"
value="http://www.FPSNow.com/PDPortal.asmx" />
 </appSettings>
</configuration>

Looks pretty straightforward. BUT my app chokes on

  PDP.Url = DynURL;

since for some reason DynURL is comming back null from

  string DynURL =
ConfigurationSettings.AppSettings["PDClient.PDPortal.ParaDocs"];

??!!

I don't understand why, since the key is in the app.config file. Again, in
desperation I renamed this file PDExplorer.config and PDClient.config but
that doesn't help either. I admit this is the first time i'm trying to use a
.config file for a Win32 app, but i've used them before in web apps
(Web.config) with no problem.

What am I doing wrong?

Thanks for your help!

- Joe Geretz -


Quote:
> My Web Service client consists of two Assemblies, PDExplorer.EXE and
> PDClient.DLL. The PDClient DLL brokers the interface between the
> PDExplorer and the PDPortal Web Service. End to end it looks like this:

> PDExplorer <-> PDClient <-> PDPortal

> Anyway, since PDportal is a web service, its address is subject to change
> over time. Therefore, in PDClient I set this reference up as dynamic. Sure
> enough, Visual Studio created an app.config file for PDClient. It looks
like
> this:

> <configuration>
>  <appSettings>
>   <add key="PDClient.PDPortal.ParaDocs"
> value="http://67.84.42.188:81/FPSNow/PDPortal.asmx" />
>  </appSettings>
> </configuration>

> (You can try it. There is a web service at this address.)
> http://67.84.42.188:81/FPSNow/PDPortal.asmx

> Anyway, I've deployed the following files into a deployment directory:

> PDExplorer.EXE, PDClient.DLL and app.config.

> However, no matter how I mangle the URL in app.config, the PDExplorer
still
> connects to the web service (via PDClient.DLL)! this is troublesome since
it
> indicates to me that PDClient.DLL is using a statically bound web service
> address, rather than a dynamic one. I even tried renaming app.config to
> PDExplorer.config and PDClient.config, but no dice, the client always
> connects to the web service no matter what I do. I need this to be dynamic
> because sometimes the IP address changes and I don't want to have to
> redistribute a new DLL every time the service address changes. What am I
> doing wrong?

> Thanks for your help.

> - Joe Geretz -



Sun, 05 Jun 2005 12:49:28 GMT  
 Can't Change Dynamic Web Service Address At Deployment Site

Quote:
> I don't understand why, since the key is in the app.config file. Again, in
> desperation I renamed this file PDExplorer.config and PDClient.config but
> that doesn't help either. I admit this is the first time I'm trying to use
a
> .config file for a Win32 app, but i've used them before in web apps
> (Web.config) with no problem.

> What am I doing wrong?

OK, here's the deal. The config file needs to be named
PDExplorer.exe.config.

So why in the world does specifying dynamic url resolution in Visual Studio
generate a file named app.config if this config file is useless at run
time??

I got it to work, but this is so quirky, I've got to be doing something
wrong. Please tell me there's a more straightforward way of doing this...

- Joe Geretz -



Sun, 05 Jun 2005 12:59:12 GMT  
 Can't Change Dynamic Web Service Address At Deployment Site

Quote:
> So why in the world does specifying dynamic url resolution in Visual
Studio
> generate a file named app.config if this config file is useless at run
> time??

Just to clear one thing up. With the properly named configuration file, then
it's not necessary to explicitly set the .Url property for a dynamically
resolved web service address. It happens automatically for you. But I'm
still wondering why does VS create a file named app.config if this is
useless at run time?

- Joe Geretz -



Sun, 05 Jun 2005 13:20:43 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. VB Programmer's Journal web site address

2. Web Site and Package and Deployment wizard.

3. VB.Net web service deployment problem

4. Small Business Web Services Deployment

5. web sites start charging for services

6. 'Canned' data in VB program

7. How to Load IE with a Web site address for VB

8. Looking for ASCII numeric equivalents?????(web site address given)

9. find IP address from web site

10. How to Load IE with a Web site address for VB

11. How to Load IE with a Web site address for VB

12. DLL's and Web Class Deployment

 

 
Powered by phpBB® Forum Software