Dynamic URL not working

E

erin.sebastian

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>
 
R

Rodrigo García

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
 
J

Jagan Puttoju

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top