Am i hardcoding the web service ?

M

moko

I have a C# webservice file, which i compile , make a corresponding .asmx
file, then create a proxy .cs file using WSDL, compile this proxy, and
consume it from a windows form, which is hosted in an IE browser. Now, the
proxy file refers to http://localhost/somevirtualfolder/something.asmx. All
works well, when i use it from the same PC where the web-service is hosted.

However, when i try to access the same web-service across the intranet, i
get some security error. Is it because the "localhost" in the proxy needs to
be set to the name of the server , or is there some other hidden problem ?

Any guesses ?
 
J

Jan Tielens

You can use Dynamic properties to solve this issue. By doing so the location
of the webservice is stored in the app.config file (xml) which you can edit
with notepad for example (without recompiling the project!).

To do so, just set the URL Behavior property of the webreference to
Dynamic. The app.config file will ve created automatically!

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
 
M

Mas Jabier

In the server side, open IE
and get to Tools-Internet Options-Connection-LAN Settings-
Advanced, add http://localhost in the Exceptions : Do not
use proxy server with....

Now try to access again. You should get this smoothly.


Jody Ananda,MCAD,MCSD.Net



-----Original Message-----
I have a C# webservice file, which i compile , make a corresponding .asmx
file, then create a proxy .cs file using WSDL, compile this proxy, and
consume it from a windows form, which is hosted in an IE browser. Now, the
proxy file refers to
http://localhost/somevirtualfolder/something.asmx. All
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top