Website on IIS7 - how can connect to web service on desktop?

Post Reply
User avatar
Trebor29
Lieutenant
Lieutenant
Posts: 75
Joined: Thu Apr 29, 2010 12:34 am

Website on IIS7 - how can connect to web service on desktop?

Post by Trebor29 » Sat Apr 28, 2012 2:17 am

Hi all,

I have got an asp.net website hosted on localhost (IIS7) and I want to use a web service I have made which is on my desktop... How can I connect / find it?

In Visual Studio 2010, if I open the website and web service in the solution explorer, I can add service reference by seaching for service in this solution, no roblem. But when I try to search for service on the local machine I can't find it, and I dont know how / or what the url might look like! :?

Can anyone help me out? Thanks :cry:
User avatar
Trebor29
Lieutenant
Lieutenant
Posts: 75
Joined: Thu Apr 29, 2010 12:34 am

Re: Website on IIS7 - how can connect to web service on desktop?

Post by Trebor29 » Sat Apr 28, 2012 4:08 am

Update:

When I start the application for the first time and run it, it often fails with the error (No connection could be made because the target machine actively refused it 127.0.0.1:49933)

This means the web references need refreshing and normally I delete and reconnect to the web services in the solution, and it works fine every time.

I have just done the same thing so that the application is running ok in VS, and then browsed to it on localhost and everyhting worked spot on... with VS still open in the background. But after I closed VS and browsed to the application on localhost again.. I get the same error as before:

No connection could be made because the target machine actively refused it 127.0.0.1:49933

:shock:
User avatar
Enigma
Lieutenant
Lieutenant
Posts: 74
Joined: Sun Jan 16, 2011 12:40 am
Location: Colombo, Sri Lanka

Re: Website on IIS7 - how can connect to web service on desktop?

Post by Enigma » Sat Apr 28, 2012 8:11 am

Hi

According to my understanding of this issue, When ever you run any asp.net or asp.net web service project from visual studio it creates it own IIS instance. So if you close the project that instance will get deleted. So that link become invalid.target machine actively refused it 127.0.0.1:49933 means no one is listening to 49933 port. Publish your service to the local IIS. Then reference that link to your website.


Thanks
User avatar
Trebor29
Lieutenant
Lieutenant
Posts: 75
Joined: Thu Apr 29, 2010 12:34 am

Re: Website on IIS7 - how can connect to web service on desktop?

Post by Trebor29 » Sat Apr 28, 2012 5:25 pm

Hi Enigma,

The problem I have when I upload the ws to IIS I have to give it a different port number from the hosted website, and I dont know how! The only port numbrs that it automatically provides are port 80 for http and 443 for https.

Could I just use the port number thats in the url when I run it from VS, like the 49933..?
User avatar
Enigma
Lieutenant
Lieutenant
Posts: 74
Joined: Sun Jan 16, 2011 12:40 am
Location: Colombo, Sri Lanka

Re: Website on IIS7 - how can connect to web service on desktop?

Post by Enigma » Sat Apr 28, 2012 10:22 pm

Why do you want to change the port number? Create a web setup project to your web service. Install it in your local IIS. Then browse the .asmx file from the IIS window. Get that link and reference it to your web site. You can reference it by changing the web.config file or you can use the IDE for it.

If this not solves your issue then may be I'm not getting your problem. Please do explain more.

Thanks
Post Reply

Return to “ASP & ASP.Net”