Asp .net 2.0 Unable to Connect to Remote Server

H

haroldbk

I have a small Asp .net 2.0 application with a web reference to a
Webservice.
Running locally works fine, but when I run it from the Web Server the
exception Unable to Connect to Remote Server is returned.

Tried 2 different Web Services - both locally on from the Web server.
This is a code snippet:
try

{

net.webservicex.www.CurrencyConvertor cc = new
net.webservicex.www.CurrencyConvertor();

cc.Url = "http://www.webservicex.net/CurrencyConvertor.asmx?WSDL";

net.webservicex.www.Currency dollar = net.webservicex.www.Currency.USD;

net.webservicex.www.Currency shekel = net.webservicex.www.Currency.ILS;

string rate = cc.ConversionRate(dollar, shekel).ToString();

Label4.Text = rate;

}

catch (Exception ex)

{

Label4.Text = ex.Message.ToString();

}



Any ideas?

Thanks,

Harold
 
D

Dale

When you set the URL property, you should probably leave off the ?WSDL. To
be more sure of what you should set the URL to, check the WSDL file for the
soap:address element.

Generally, for a .net web service, this is the asmx address but for other
web service providers, the WSDL address is used for setting the web reference
but when setting the URL you will use a completely different address - that
specified in the soap:address element.

HTH

Dale
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top