Dynamic URL Failure

Discussion in 'ASP .Net Web Services' started by WhiskyRomeo, Feb 25, 2005.

  1. WhiskyRomeo

    WhiskyRomeo Guest

    I have an solution with several projects which call a web service for the
    data retrieval and updates.

    The main program is called DMS.exe. When I configure the webservice to use
    Dynamic URL and create entries in the app.config file of the following
    format, the application can't find the webservice. Static works fine but I
    have to set the url in code in every place a webservice is used.

    <appSettings>
    <add key="myApplication.myServer.Service1"
    value="http://myServer/myXmlWebService/Service1.asmx"/>
    </appSettings>

    So given:

    application name is DMS,
    the web service project is called DMSDataWS,
    the server is LASER,
    the physcial path on the server is:\InetPub\wwwroot\DMSDataWS\wsCommon.asmx,
    the virtual folder is named DMSDATAWS (under DefaultWebSite)
    the service is name wsCommon.asmx

    What should the entry look like? The following does not work.

    <appSettings>
    <add key="DMS.Laser.wsCommon.asmx"
    value="http://LASER/DMSDATA/wsCommon.asmx"/>
    </appSettings>

    --
    wr
    WhiskyRomeo, Feb 25, 2005
    #1
    1. Advertising

  2. WhiskyRomeo

    Dan Rogers Guest

    You should set the URL setting to be the URL of the service asmx entry
    point. So if it is on a server named laser, it would start with
    http://laser/....

    Try debugging your application - are you sure you are getting the string in
    your config file correctly and then using that to set the proxy URL
    setting? You really only have to do this at the place you create your
    proxy each time. If you can use a local string resource with the right URL
    and that works, you can prove whether or not the string you need is coming
    from the config file.

    Something to be careful of is the \ character - make sure that you account
    for it as the escape operator in any local strings (so you would have
    "http:\\\\laser\\foo.asmx"

    --------------------
    >Thread-Topic: Dynamic URL Failure
    >thread-index: AcUbWjBNICQRk6LrSNKJqbCFhha7zQ==
    >X-WBNR-Posting-Host: 65.27.6.160
    >From: "=?Utf-8?B?V2hpc2t5Um9tZW8=?="

    <>
    >Subject: Dynamic URL Failure
    >Date: Fri, 25 Feb 2005 08:51:02 -0800
    >Lines: 31
    >Message-ID: <>
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    > charset="Utf-8"
    >Content-Transfer-Encoding: 7bit
    >X-Newsreader: Microsoft CDO for Windows 2000
    >Content-Class: urn:content-classes:message
    >Importance: normal
    >Priority: normal
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
    >Path: TK2MSFTNGXA02.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
    >Xref: TK2MSFTNGXA02.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webservices:28301
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >
    >I have an solution with several projects which call a web service for the
    >data retrieval and updates.
    >
    >The main program is called DMS.exe. When I configure the webservice to

    use
    >Dynamic URL and create entries in the app.config file of the following
    >format, the application can't find the webservice. Static works fine but

    I
    >have to set the url in code in every place a webservice is used.
    >
    ><appSettings>
    > <add key="myApplication.myServer.Service1"
    > value="http://myServer/myXmlWebService/Service1.asmx"/>
    ></appSettings>
    >
    >So given:
    >
    >application name is DMS,
    >the web service project is called DMSDataWS,
    >the server is LASER,
    >the physcial path on the server

    is:\InetPub\wwwroot\DMSDataWS\wsCommon.asmx,
    >the virtual folder is named DMSDATAWS (under DefaultWebSite)
    >the service is name wsCommon.asmx
    >
    >What should the entry look like? The following does not work.
    >
    ><appSettings>
    > <add key="DMS.Laser.wsCommon.asmx"
    >value="http://LASER/DMSDATA/wsCommon.asmx"/>
    ></appSettings>
    >
    >--
    >wr
    >
    Dan Rogers, Mar 8, 2005
    #2
    1. Advertising

  3. WhiskyRomeo

    WhiskyRomeo Guest

    Thanks for the reply . . .

    When debugging it is obvious the URL did not come from the config file. But
    what I don't know is -- did it fail because it couldn't find the key it was
    looking for or what?

    So my question remains what does the key look like so the lookup will
    suceed? The URL I am using is correct because when I use the static mode, it
    works correctly.

    I can move it to the production server and set the URL each time I form the
    proxy and it works fine. However, I don't want to have to go through code
    and change it everytime I deploy to a different server.

    I have another way to accomplish this, by I don't understand what is failing
    with they dynamic URL route.

    WR

    "Dan Rogers" wrote:

    > You should set the URL setting to be the URL of the service asmx entry
    > point. So if it is on a server named laser, it would start with
    > http://laser/....
    >
    > Try debugging your application - are you sure you are getting the string in
    > your config file correctly and then using that to set the proxy URL
    > setting? You really only have to do this at the place you create your
    > proxy each time. If you can use a local string resource with the right URL
    > and that works, you can prove whether or not the string you need is coming
    > from the config file.
    >
    > Something to be careful of is the \ character - make sure that you account
    > for it as the escape operator in any local strings (so you would have
    > "http:\\\\laser\\foo.asmx"
    >
    > --------------------
    > >Thread-Topic: Dynamic URL Failure
    > >thread-index: AcUbWjBNICQRk6LrSNKJqbCFhha7zQ==
    > >X-WBNR-Posting-Host: 65.27.6.160
    > >From: "=?Utf-8?B?V2hpc2t5Um9tZW8=?="

    > <>
    > >Subject: Dynamic URL Failure
    > >Date: Fri, 25 Feb 2005 08:51:02 -0800
    > >Lines: 31
    > >Message-ID: <>
    > >MIME-Version: 1.0
    > >Content-Type: text/plain;
    > > charset="Utf-8"
    > >Content-Transfer-Encoding: 7bit
    > >X-Newsreader: Microsoft CDO for Windows 2000
    > >Content-Class: urn:content-classes:message
    > >Importance: normal
    > >Priority: normal
    > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    > >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
    > >Path: TK2MSFTNGXA02.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > >Xref: TK2MSFTNGXA02.phx.gbl

    > microsoft.public.dotnet.framework.aspnet.webservices:28301
    > >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    > >
    > >I have an solution with several projects which call a web service for the
    > >data retrieval and updates.
    > >
    > >The main program is called DMS.exe. When I configure the webservice to

    > use
    > >Dynamic URL and create entries in the app.config file of the following
    > >format, the application can't find the webservice. Static works fine but

    > I
    > >have to set the url in code in every place a webservice is used.
    > >
    > ><appSettings>
    > > <add key="myApplication.myServer.Service1"
    > > value="http://myServer/myXmlWebService/Service1.asmx"/>
    > ></appSettings>
    > >
    > >So given:
    > >
    > >application name is DMS,
    > >the web service project is called DMSDataWS,
    > >the server is LASER,
    > >the physcial path on the server

    > is:\InetPub\wwwroot\DMSDataWS\wsCommon.asmx,
    > >the virtual folder is named DMSDATAWS (under DefaultWebSite)
    > >the service is name wsCommon.asmx
    > >
    > >What should the entry look like? The following does not work.
    > >
    > ><appSettings>
    > > <add key="DMS.Laser.wsCommon.asmx"
    > >value="http://LASER/DMSDATA/wsCommon.asmx"/>
    > ></appSettings>
    > >
    > >--
    > >wr
    > >

    >
    >
    WhiskyRomeo, Mar 8, 2005
    #3
  4. WhiskyRomeo

    Dan Rogers Guest

    I think the problem is going to be in the code you use to get your
    appsettings. If you don't specify a match on key name, you won't get the
    data you want. What I'm suggesting is you debug your logic with
    breakpoints so you can see what and when (or if) your code that gets the
    appsettings is even accessed. You do have code that asks for the specific
    app-setting don't you? There is no automatic app setting mapping done for
    you to get a connection string.

    --------------------
    >Thread-Topic: Dynamic URL Failure
    >thread-index: AcUj8rmKH5JcQEuXQaOmN2jbeWIMtQ==
    >X-WBNR-Posting-Host: 65.27.6.160
    >From: "=?Utf-8?B?V2hpc2t5Um9tZW8=?="

    <>
    >References: <>

    <>
    >Subject: RE: Dynamic URL Failure
    >Date: Tue, 8 Mar 2005 07:23:05 -0800
    >Lines: 99
    >Message-ID: <>
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    > charset="Utf-8"
    >Content-Transfer-Encoding: 7bit
    >X-Newsreader: Microsoft CDO for Windows 2000
    >Content-Class: urn:content-classes:message
    >Importance: normal
    >Priority: normal
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
    >Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    >Xref: TK2MSFTNGXA02.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webservices:28492
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >
    >Thanks for the reply . . .
    >
    >When debugging it is obvious the URL did not come from the config file.

    But
    >what I don't know is -- did it fail because it couldn't find the key it

    was
    >looking for or what?
    >
    >So my question remains what does the key look like so the lookup will
    >suceed? The URL I am using is correct because when I use the static mode,

    it
    >works correctly.
    >
    >I can move it to the production server and set the URL each time I form

    the
    >proxy and it works fine. However, I don't want to have to go through code
    >and change it everytime I deploy to a different server.
    >
    >I have another way to accomplish this, by I don't understand what is

    failing
    >with they dynamic URL route.
    >
    >WR
    >
    >"Dan Rogers" wrote:
    >
    >> You should set the URL setting to be the URL of the service asmx entry
    >> point. So if it is on a server named laser, it would start with
    >> http://laser/....
    >>
    >> Try debugging your application - are you sure you are getting the string

    in
    >> your config file correctly and then using that to set the proxy URL
    >> setting? You really only have to do this at the place you create your
    >> proxy each time. If you can use a local string resource with the right

    URL
    >> and that works, you can prove whether or not the string you need is

    coming
    >> from the config file.
    >>
    >> Something to be careful of is the \ character - make sure that you

    account
    >> for it as the escape operator in any local strings (so you would have
    >> "http:\\\\laser\\foo.asmx"
    >>
    >> --------------------
    >> >Thread-Topic: Dynamic URL Failure
    >> >thread-index: AcUbWjBNICQRk6LrSNKJqbCFhha7zQ==
    >> >X-WBNR-Posting-Host: 65.27.6.160
    >> >From: "=?Utf-8?B?V2hpc2t5Um9tZW8=?="

    >> <>
    >> >Subject: Dynamic URL Failure
    >> >Date: Fri, 25 Feb 2005 08:51:02 -0800
    >> >Lines: 31
    >> >Message-ID: <>
    >> >MIME-Version: 1.0
    >> >Content-Type: text/plain;
    >> > charset="Utf-8"
    >> >Content-Transfer-Encoding: 7bit
    >> >X-Newsreader: Microsoft CDO for Windows 2000
    >> >Content-Class: urn:content-classes:message
    >> >Importance: normal
    >> >Priority: normal
    >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >> >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
    >> >Path: TK2MSFTNGXA02.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
    >> >Xref: TK2MSFTNGXA02.phx.gbl

    >> microsoft.public.dotnet.framework.aspnet.webservices:28301
    >> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >> >
    >> >I have an solution with several projects which call a web service for

    the
    >> >data retrieval and updates.
    >> >
    >> >The main program is called DMS.exe. When I configure the webservice to

    >> use
    >> >Dynamic URL and create entries in the app.config file of the following
    >> >format, the application can't find the webservice. Static works fine

    but
    >> I
    >> >have to set the url in code in every place a webservice is used.
    >> >
    >> ><appSettings>
    >> > <add key="myApplication.myServer.Service1"
    >> > value="http://myServer/myXmlWebService/Service1.asmx"/>
    >> ></appSettings>
    >> >
    >> >So given:
    >> >
    >> >application name is DMS,
    >> >the web service project is called DMSDataWS,
    >> >the server is LASER,
    >> >the physcial path on the server

    >> is:\InetPub\wwwroot\DMSDataWS\wsCommon.asmx,
    >> >the virtual folder is named DMSDATAWS (under DefaultWebSite)
    >> >the service is name wsCommon.asmx
    >> >
    >> >What should the entry look like? The following does not work.
    >> >
    >> ><appSettings>
    >> > <add key="DMS.Laser.wsCommon.asmx"
    >> >value="http://LASER/DMSDATA/wsCommon.asmx"/>
    >> ></appSettings>
    >> >
    >> >--
    >> >wr
    >> >

    >>
    >>

    >
    Dan Rogers, Mar 8, 2005
    #4
  5. WhiskyRomeo

    WhiskyRomeo Guest

    The article on which I am basing my question is:

    Redirecting an Application to Target a Different XML Web Service During
    Installation

    I found it by searching VS Help using "Dynamic URL."

    This article implies -- simply putting a key:value entry in the appconfig
    file of the form I listed in my original question and changing the URL
    Behaviour to Dynamic is all that is needed. They go on to specify a custom
    installer class, so that a user can input the name of the server and service.
    This used to modify the key:value entry in the appconfig during
    installation. I am not doing this, I am simply modifying the appconfig file
    before generating the install files.

    In otherwords, when the URL Behaviour is Dynamic, the application knows to
    look in the appconfig for the key --> MyWebApp.localhost.Service1

    In this case, there is no other code at runtime being used to access the
    appconfig file to set the URL.

    "Dan Rogers" wrote:

    > I think the problem is going to be in the code you use to get your
    > appsettings. If you don't specify a match on key name, you won't get the
    > data you want. What I'm suggesting is you debug your logic with
    > breakpoints so you can see what and when (or if) your code that gets the
    > appsettings is even accessed. You do have code that asks for the specific
    > app-setting don't you? There is no automatic app setting mapping done for
    > you to get a connection string.
    >
    > --------------------
    > >Thread-Topic: Dynamic URL Failure
    > >thread-index: AcUj8rmKH5JcQEuXQaOmN2jbeWIMtQ==
    > >X-WBNR-Posting-Host: 65.27.6.160
    > >From: "=?Utf-8?B?V2hpc2t5Um9tZW8=?="

    > <>
    > >References: <>

    > <>
    > >Subject: RE: Dynamic URL Failure
    > >Date: Tue, 8 Mar 2005 07:23:05 -0800
    > >Lines: 99
    > >Message-ID: <>
    > >MIME-Version: 1.0
    > >Content-Type: text/plain;
    > > charset="Utf-8"
    > >Content-Transfer-Encoding: 7bit
    > >X-Newsreader: Microsoft CDO for Windows 2000
    > >Content-Class: urn:content-classes:message
    > >Importance: normal
    > >Priority: normal
    > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    > >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
    > >Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > >Xref: TK2MSFTNGXA02.phx.gbl

    > microsoft.public.dotnet.framework.aspnet.webservices:28492
    > >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    > >
    > >Thanks for the reply . . .
    > >
    > >When debugging it is obvious the URL did not come from the config file.

    > But
    > >what I don't know is -- did it fail because it couldn't find the key it

    > was
    > >looking for or what?
    > >
    > >So my question remains what does the key look like so the lookup will
    > >suceed? The URL I am using is correct because when I use the static mode,

    > it
    > >works correctly.
    > >
    > >I can move it to the production server and set the URL each time I form

    > the
    > >proxy and it works fine. However, I don't want to have to go through code
    > >and change it everytime I deploy to a different server.
    > >
    > >I have another way to accomplish this, by I don't understand what is

    > failing
    > >with they dynamic URL route.
    > >
    > >WR
    > >
    > >"Dan Rogers" wrote:
    > >
    > >> You should set the URL setting to be the URL of the service asmx entry
    > >> point. So if it is on a server named laser, it would start with
    > >> http://laser/....
    > >>
    > >> Try debugging your application - are you sure you are getting the string

    > in
    > >> your config file correctly and then using that to set the proxy URL
    > >> setting? You really only have to do this at the place you create your
    > >> proxy each time. If you can use a local string resource with the right

    > URL
    > >> and that works, you can prove whether or not the string you need is

    > coming
    > >> from the config file.
    > >>
    > >> Something to be careful of is the \ character - make sure that you

    > account
    > >> for it as the escape operator in any local strings (so you would have
    > >> "http:\\\\laser\\foo.asmx"
    > >>
    > >> --------------------
    > >> >Thread-Topic: Dynamic URL Failure
    > >> >thread-index: AcUbWjBNICQRk6LrSNKJqbCFhha7zQ==
    > >> >X-WBNR-Posting-Host: 65.27.6.160
    > >> >From: "=?Utf-8?B?V2hpc2t5Um9tZW8=?="
    > >> <>
    > >> >Subject: Dynamic URL Failure
    > >> >Date: Fri, 25 Feb 2005 08:51:02 -0800
    > >> >Lines: 31
    > >> >Message-ID: <>
    > >> >MIME-Version: 1.0
    > >> >Content-Type: text/plain;
    > >> > charset="Utf-8"
    > >> >Content-Transfer-Encoding: 7bit
    > >> >X-Newsreader: Microsoft CDO for Windows 2000
    > >> >Content-Class: urn:content-classes:message
    > >> >Importance: normal
    > >> >Priority: normal
    > >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > >> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    > >> >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
    > >> >Path: TK2MSFTNGXA02.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > >> >Xref: TK2MSFTNGXA02.phx.gbl
    > >> microsoft.public.dotnet.framework.aspnet.webservices:28301
    > >> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    > >> >
    > >> >I have an solution with several projects which call a web service for

    > the
    > >> >data retrieval and updates.
    > >> >
    > >> >The main program is called DMS.exe. When I configure the webservice to
    > >> use
    > >> >Dynamic URL and create entries in the app.config file of the following
    > >> >format, the application can't find the webservice. Static works fine

    > but
    > >> I
    > >> >have to set the url in code in every place a webservice is used.
    > >> >
    > >> ><appSettings>
    > >> > <add key="myApplication.myServer.Service1"
    > >> > value="http://myServer/myXmlWebService/Service1.asmx"/>
    > >> ></appSettings>
    > >> >
    > >> >So given:
    > >> >
    > >> >application name is DMS,
    > >> >the web service project is called DMSDataWS,
    > >> >the server is LASER,
    > >> >the physcial path on the server
    > >> is:\InetPub\wwwroot\DMSDataWS\wsCommon.asmx,
    > >> >the virtual folder is named DMSDATAWS (under DefaultWebSite)
    > >> >the service is name wsCommon.asmx
    > >> >
    > >> >What should the entry look like? The following does not work.
    > >> >
    > >> ><appSettings>
    > >> > <add key="DMS.Laser.wsCommon.asmx"
    > >> >value="http://LASER/DMSDATA/wsCommon.asmx"/>
    > >> ></appSettings>
    > >> >
    > >> >--
    > >> >wr
    > >> >
    > >>
    > >>

    > >

    >
    >
    WhiskyRomeo, Mar 8, 2005
    #5
  6. WhiskyRomeo

    Dan Rogers Guest

    Ahh.

    You're right. When you change the URL behavior property from Static to
    Dynamic, you'll find that the setting gets made for you automatically in
    the appsettings section of your config file. The pattern for the key is
    ProjectNamespace.ProxyNamespace.ServiceClassname.

    You should be able to look in your myapplicationexename.config file and see
    this setting. If you put this in a different file, it could explain the
    issue.


    SO where you have

    >> >> ><appSettings>
    >> >> > <add key="myApplication.myServer.Service1"
    >> >> > value="http://myServer/myXmlWebService/Service1.asmx"/>
    >> >> ></appSettings>


    In your example:
    >> >> ><appSettings>
    >> >> > <add key="DMS.Laser.wsCommon.asmx"
    >> >> >value="http://LASER/DMSDATA/wsCommon.asmx"/>
    >> >> ></appSettings>


    You have an extra .asmx in the key name. This could be the problem.


    this means your applications namespace is myApplication, your proxy
    namespace is "myServer", and the name of the service class is Service1.

    --------------------
    >Thread-Topic: Dynamic URL Failure
    >thread-index: AcUkI+aYz8xNpjy3QNOfIYz/9YKiyQ==
    >X-WBNR-Posting-Host: 65.27.6.160
    >From: "=?Utf-8?B?V2hpc2t5Um9tZW8=?="

    <>
    >References: <>

    <>
    <>
    <>
    >Subject: RE: Dynamic URL Failure
    >Date: Tue, 8 Mar 2005 13:15:06 -0800
    >Lines: 172
    >Message-ID: <>
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    > charset="Utf-8"
    >Content-Transfer-Encoding: 7bit
    >X-Newsreader: Microsoft CDO for Windows 2000
    >Content-Class: urn:content-classes:message
    >Importance: normal
    >Priority: normal
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
    >Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    >Xref: TK2MSFTNGXA02.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webservices:28513
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >
    >The article on which I am basing my question is:
    >
    >Redirecting an Application to Target a Different XML Web Service During
    >Installation
    >
    >I found it by searching VS Help using "Dynamic URL."
    >
    >This article implies -- simply putting a key:value entry in the appconfig
    >file of the form I listed in my original question and changing the URL
    >Behaviour to Dynamic is all that is needed. They go on to specify a

    custom
    >installer class, so that a user can input the name of the server and

    service.
    > This used to modify the key:value entry in the appconfig during
    >installation. I am not doing this, I am simply modifying the appconfig

    file
    >before generating the install files.
    >
    >In otherwords, when the URL Behaviour is Dynamic, the application knows to
    >look in the appconfig for the key --> MyWebApp.localhost.Service1
    >
    >In this case, there is no other code at runtime being used to access the
    >appconfig file to set the URL.
    >
    >"Dan Rogers" wrote:
    >
    >> I think the problem is going to be in the code you use to get your
    >> appsettings. If you don't specify a match on key name, you won't get

    the
    >> data you want. What I'm suggesting is you debug your logic with
    >> breakpoints so you can see what and when (or if) your code that gets the
    >> appsettings is even accessed. You do have code that asks for the

    specific
    >> app-setting don't you? There is no automatic app setting mapping done

    for
    >> you to get a connection string.
    >>
    >> --------------------
    >> >Thread-Topic: Dynamic URL Failure
    >> >thread-index: AcUj8rmKH5JcQEuXQaOmN2jbeWIMtQ==
    >> >X-WBNR-Posting-Host: 65.27.6.160
    >> >From: "=?Utf-8?B?V2hpc2t5Um9tZW8=?="

    >> <>
    >> >References: <>

    >> <>
    >> >Subject: RE: Dynamic URL Failure
    >> >Date: Tue, 8 Mar 2005 07:23:05 -0800
    >> >Lines: 99
    >> >Message-ID: <>
    >> >MIME-Version: 1.0
    >> >Content-Type: text/plain;
    >> > charset="Utf-8"
    >> >Content-Transfer-Encoding: 7bit
    >> >X-Newsreader: Microsoft CDO for Windows 2000
    >> >Content-Class: urn:content-classes:message
    >> >Importance: normal
    >> >Priority: normal
    >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >> >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
    >> >Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    >> >Xref: TK2MSFTNGXA02.phx.gbl

    >> microsoft.public.dotnet.framework.aspnet.webservices:28492
    >> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >> >
    >> >Thanks for the reply . . .
    >> >
    >> >When debugging it is obvious the URL did not come from the config file.


    >> But
    >> >what I don't know is -- did it fail because it couldn't find the key

    it
    >> was
    >> >looking for or what?
    >> >
    >> >So my question remains what does the key look like so the lookup will
    >> >suceed? The URL I am using is correct because when I use the static

    mode,
    >> it
    >> >works correctly.
    >> >
    >> >I can move it to the production server and set the URL each time I form

    >> the
    >> >proxy and it works fine. However, I don't want to have to go through

    code
    >> >and change it everytime I deploy to a different server.
    >> >
    >> >I have another way to accomplish this, by I don't understand what is

    >> failing
    >> >with they dynamic URL route.
    >> >
    >> >WR
    >> >
    >> >"Dan Rogers" wrote:
    >> >
    >> >> You should set the URL setting to be the URL of the service asmx

    entry
    >> >> point. So if it is on a server named laser, it would start with
    >> >> http://laser/....
    >> >>
    >> >> Try debugging your application - are you sure you are getting the

    string
    >> in
    >> >> your config file correctly and then using that to set the proxy URL
    >> >> setting? You really only have to do this at the place you create

    your
    >> >> proxy each time. If you can use a local string resource with the

    right
    >> URL
    >> >> and that works, you can prove whether or not the string you need is

    >> coming
    >> >> from the config file.
    >> >>
    >> >> Something to be careful of is the \ character - make sure that you

    >> account
    >> >> for it as the escape operator in any local strings (so you would have
    >> >> "http:\\\\laser\\foo.asmx"
    >> >>
    >> >> --------------------
    >> >> >Thread-Topic: Dynamic URL Failure
    >> >> >thread-index: AcUbWjBNICQRk6LrSNKJqbCFhha7zQ==
    >> >> >X-WBNR-Posting-Host: 65.27.6.160
    >> >> >From: "=?Utf-8?B?V2hpc2t5Um9tZW8=?="
    >> >> <>
    >> >> >Subject: Dynamic URL Failure
    >> >> >Date: Fri, 25 Feb 2005 08:51:02 -0800
    >> >> >Lines: 31
    >> >> >Message-ID: <>
    >> >> >MIME-Version: 1.0
    >> >> >Content-Type: text/plain;
    >> >> > charset="Utf-8"
    >> >> >Content-Transfer-Encoding: 7bit
    >> >> >X-Newsreader: Microsoft CDO for Windows 2000
    >> >> >Content-Class: urn:content-classes:message
    >> >> >Importance: normal
    >> >> >Priority: normal
    >> >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >> >> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >> >> >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
    >> >> >Path:

    TK2MSFTNGXA02.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
    >> >> >Xref: TK2MSFTNGXA02.phx.gbl
    >> >> microsoft.public.dotnet.framework.aspnet.webservices:28301
    >> >> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >> >> >
    >> >> >I have an solution with several projects which call a web service

    for
    >> the
    >> >> >data retrieval and updates.
    >> >> >
    >> >> >The main program is called DMS.exe. When I configure the webservice

    to
    >> >> use
    >> >> >Dynamic URL and create entries in the app.config file of the

    following
    >> >> >format, the application can't find the webservice. Static works

    fine
    >> but
    >> >> I
    >> >> >have to set the url in code in every place a webservice is used.
    >> >> >
    >> >> ><appSettings>
    >> >> > <add key="myApplication.myServer.Service1"
    >> >> > value="http://myServer/myXmlWebService/Service1.asmx"/>
    >> >> ></appSettings>
    >> >> >
    >> >> >So given:
    >> >> >
    >> >> >application name is DMS,
    >> >> >the web service project is called DMSDataWS,
    >> >> >the server is LASER,
    >> >> >the physcial path on the server
    >> >> is:\InetPub\wwwroot\DMSDataWS\wsCommon.asmx,
    >> >> >the virtual folder is named DMSDATAWS (under DefaultWebSite)
    >> >> >the service is name wsCommon.asmx
    >> >> >
    >> >> >What should the entry look like? The following does not work.
    >> >> >
    >> >> ><appSettings>
    >> >> > <add key="DMS.Laser.wsCommon.asmx"
    >> >> >value="http://LASER/DMSDATA/wsCommon.asmx"/>
    >> >> ></appSettings>
    >> >> >
    >> >> >--
    >> >> >wr
    >> >> >
    >> >>
    >> >>
    >> >

    >>
    >>

    >
    Dan Rogers, Mar 9, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon paugh
    Replies:
    1
    Views:
    708
  2. Ilias Lazaridis
    Replies:
    0
    Views:
    571
    Ilias Lazaridis
    Feb 1, 2005
  3. Sanjeev Kumar

    Dynamic memory failure reason

    Sanjeev Kumar, Jan 28, 2005, in forum: C++
    Replies:
    5
    Views:
    502
    Ioannis Vranos
    Jan 29, 2005
  4. Replies:
    0
    Views:
    470
  5. Just D.
    Replies:
    0
    Views:
    418
    Just D.
    Aug 11, 2004
Loading...

Share This Page