Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / February 2006

Tip: Looking for answers? Try searching our database.

Dynamic URL not working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
erin.sebastian@cowaninsurancegroup.com - 12 Jan 2006 19:02 GMT
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/ElectronicDataInterchang
e.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 - 16 Jan 2006 14:49 GMT
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

> Hello All,
> I have a program that uses web services, i added the webservice and
[quoted text clipped - 50 lines]
>     </appSettings>
> </configuration>
Jagan Puttoju - 03 Feb 2006 19:28 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.