Dynamic URL not working

Discussion in 'ASP .Net Web Services' started by erin.sebastian@cowaninsurancegroup.com, Jan 12, 2006.

  1. Guest

    Hello All,
    I have a program that uses web services, i added the webservice and
    initially had been using the static URL but I now am changing back and
    forth to the development environment and the production environment so
    i've changed the URL to DYNAMIC and have added the appropriate keys in
    my app.config .... The problem is that it doesn't work, when i change
    from local host to development the web reference still tries to access
    the local host. I thought that the basis behind the Dynamic option was
    that this tells it to look at your config file to find the appropriate
    reference, am i wrong?
    I have attached my config file for your information, thanks SO MUCH in
    advance!!

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <appSettings>
    <!-- localhost -->
    <!--add key="Marine-Connector.MarineEDI.ElectronicDataInterchange"
    value="http://localhost/Marine-WebServices/WebServices/EDI/ElectronicDataInterchange.asmx"/>
    <add key="Marine-Connector.MarineRating.RatePolicy"
    value="http://localhost/Marine-WebServices/WebServices/RatingEngine/RatePolicy.asmx"/>
    <add key="Marine-Connector.MarineServices.Repository"
    value="http://localhost/Marine-WebServices/WebServices/Data/Repository.asmx"/>
    <add key="Marine-Connector.MarineTam.TAM"
    value="http://localhost/Marine-WebServices/WebServices/TAM/TAM.asmx"/>
    <add key="Marine-Connector.MarineValidation.ValidatePolicy"
    value="http://localhost/Marine-WebServices/WebServices/Validation/ValidatePolicy.asmx"/-->

    <!-- Development-->
    <add key="Marine-Connector.MarineServices.Repository"
    value="http://172.16.64.204/Marine-WebServices/WebServices/Data/Repository.asmx"/>
    <add key="Marine-Connector.MarineRating.RatePolicy"
    value="http://172.16.64.204/Marine-WebServices/WebServices/RatingEngine/RatePolicy.asmx"/>
    <add key="Marine-Connector.MarineTam.TAM"
    value="http://172.16.64.204/Marine-WebServices/WebServices/TAM/TAM.asmx"/>
    <add key="Marine-Connector.MarineValidation.ValidatePolicy"
    value="http://172.16.64.204/Marine-WebServices/WebServices/Validation/ValidatePolicy.asmx"/>
    <add key="Marine-Connector.MarineEDI.ElectronicDataInterchange"
    value="http://172.16.64.204/Marine-WebServices/WebServices/EDI/ElectronicDataInterchange.asmx"/>

    <!--Production-->
    <!--add key="Marine-Connector.MarineEDI.ElectronicDataInterchange"
    value="http://172.16.0.249/Marine/MarineWeb/WebServices/EDI/ElectronicDataInterchange.asmx"/>
    <add key="Marine-Connector.MarineRating.RatePolicy"
    value="http://172.16.0.249/Marine/MarineWeb/WebServices/RatingEngine/RatePolicy.asmx"/>
    <add key="Marine-Connector.MarineServices.Repository"
    value="http://172.16.0.249/Marine/MarineWeb/WebServices/Data/Repository.asmx"/>
    <add key="Marine-Connector.MarineTam.TAM"
    value="http://172.16.0.249/Marine/MarineWeb/WebServices/TAM/TAM.asmx"/>
    <add key="Marine-Connector.MarineValidation.ValidatePolicy"
    value="http://172.16.0.249/Marine/MarineWeb/WebServices/Validation/ValidatePolicy.asmx"/-->

    </appSettings>
    </configuration>
    , Jan 12, 2006
    #1
    1. Advertising

  2. Hi.

    You should look in the proxy class generated. When you set a dynamic web
    reference, the proxy's constructor loads the url from the config file if it
    exists, if it doesn't exist, then loads the url you entered when the web
    reference was created.

    So, the problem could be:
    - You don't have the dynamic property set on your web reference
    - Or you have it set but the proxy has not been regenerated
    - Or the .config isn't in the good place
    - Or the key in web.config does not match the key looked up in the proxy's
    constructor

    I hope it helps

    "" wrote:

    > Hello All,
    > I have a program that uses web services, i added the webservice and
    > initially had been using the static URL but I now am changing back and
    > forth to the development environment and the production environment so
    > i've changed the URL to DYNAMIC and have added the appropriate keys in
    > my app.config .... The problem is that it doesn't work, when i change
    > from local host to development the web reference still tries to access
    > the local host. I thought that the basis behind the Dynamic option was
    > that this tells it to look at your config file to find the appropriate
    > reference, am i wrong?
    > I have attached my config file for your information, thanks SO MUCH in
    > advance!!
    >
    > <?xml version="1.0" encoding="utf-8"?>
    > <configuration>
    > <appSettings>
    > <!-- localhost -->
    > <!--add key="Marine-Connector.MarineEDI.ElectronicDataInterchange"
    > value="http://localhost/Marine-WebServices/WebServices/EDI/ElectronicDataInterchange.asmx"/>
    > <add key="Marine-Connector.MarineRating.RatePolicy"
    > value="http://localhost/Marine-WebServices/WebServices/RatingEngine/RatePolicy.asmx"/>
    > <add key="Marine-Connector.MarineServices.Repository"
    > value="http://localhost/Marine-WebServices/WebServices/Data/Repository.asmx"/>
    > <add key="Marine-Connector.MarineTam.TAM"
    > value="http://localhost/Marine-WebServices/WebServices/TAM/TAM.asmx"/>
    > <add key="Marine-Connector.MarineValidation.ValidatePolicy"
    > value="http://localhost/Marine-WebServices/WebServices/Validation/ValidatePolicy.asmx"/-->
    >
    > <!-- Development-->
    > <add key="Marine-Connector.MarineServices.Repository"
    > value="http://172.16.64.204/Marine-WebServices/WebServices/Data/Repository.asmx"/>
    > <add key="Marine-Connector.MarineRating.RatePolicy"
    > value="http://172.16.64.204/Marine-WebServices/WebServices/RatingEngine/RatePolicy.asmx"/>
    > <add key="Marine-Connector.MarineTam.TAM"
    > value="http://172.16.64.204/Marine-WebServices/WebServices/TAM/TAM.asmx"/>
    > <add key="Marine-Connector.MarineValidation.ValidatePolicy"
    > value="http://172.16.64.204/Marine-WebServices/WebServices/Validation/ValidatePolicy.asmx"/>
    > <add key="Marine-Connector.MarineEDI.ElectronicDataInterchange"
    > value="http://172.16.64.204/Marine-WebServices/WebServices/EDI/ElectronicDataInterchange.asmx"/>
    >
    > <!--Production-->
    > <!--add key="Marine-Connector.MarineEDI.ElectronicDataInterchange"
    > value="http://172.16.0.249/Marine/MarineWeb/WebServices/EDI/ElectronicDataInterchange.asmx"/>
    > <add key="Marine-Connector.MarineRating.RatePolicy"
    > value="http://172.16.0.249/Marine/MarineWeb/WebServices/RatingEngine/RatePolicy.asmx"/>
    > <add key="Marine-Connector.MarineServices.Repository"
    > value="http://172.16.0.249/Marine/MarineWeb/WebServices/Data/Repository.asmx"/>
    > <add key="Marine-Connector.MarineTam.TAM"
    > value="http://172.16.0.249/Marine/MarineWeb/WebServices/TAM/TAM.asmx"/>
    > <add key="Marine-Connector.MarineValidation.ValidatePolicy"
    > value="http://172.16.0.249/Marine/MarineWeb/WebServices/Validation/ValidatePolicy.asmx"/-->
    >
    > </appSettings>
    > </configuration>
    >
    >
    Rodrigo García, Jan 16, 2006
    #2
    1. Advertising

  3. Thanks! I was not having matching keys in reference.cs file and web.config and that is the reason dynamic references were not working for me. After I corrected the keys in web.config it works like a charm

    Jagan
    ---
    Posted via www.DotNetSlackers.com
    Jagan Puttoju, Feb 3, 2006
    #3
    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. Ivan K
    Replies:
    0
    Views:
    444
    Ivan K
    Apr 28, 2004
  2. Brian
    Replies:
    0
    Views:
    1,788
    Brian
    Jun 19, 2004
  3. Jon paugh
    Replies:
    1
    Views:
    701
  4. Kannan
    Replies:
    1
    Views:
    3,801
    Kannan
    May 17, 2005
  5. Just D.
    Replies:
    0
    Views:
    415
    Just D.
    Aug 11, 2004
Loading...

Share This Page