Basically, I have a web Service which I developed. I then went down to the installation site to install the web Service and a handheld app which uses it.
Problem is, I came back off site, and now need to change some things with the handheld app and web Service, and send it to them (site is hundreds of miles away).
I can change the web service fine, but how can I change the web reference to that web service, on the handheld app? its pointing to a location that does not exists as there is no remote access to their servers.
How can I trick Visual Studio into updating the web reference to get my LOCAL objects, but compiling to keep the web reference that only exists on THEIR local servers?
You can configure the url that the webreference is using by setting it to dynamic. It will add the url to the config.
Also see: http://www.codeproject.com/KB/XML/wsdldynamicurl.aspx
Related
I published a simple Hello World web service in an ASP.Net web service project.I closed this project and opened another console based project to consume this web service. The problem is I cannot discover this web service to add reference.When I paste the url, I get the following error
There was an error downloading 'http://localhost:65436/Service1.asmx/_vti_bin/ListData.svc/$metadata'.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:65436
I am using Visual Studio Ultimate 2013, I don't have IIS server installed.
UPDATE- : I created a new Console based project in the existing solution and it works fine.But the problem is how do I run this console project,when I click the debug button, it deploys it on browser.I simply printed the string output returned by web method,I need to see this output on console.
I closed this project and opened another console based project to consume this web service. The problem is I cannot discover this web service to add reference.
Because the web service is not running. Web service references can only be generated when the metadata is available.
You can either:
Run two instances of Visual Studio, one for the web service and one for the client
Put a service and client project in one solution.
Also, you shouldn't use ASMX for new development. Take a look at WCF and WebAPI.
Sometimes it happens to me too. I press F5 to start debugging the web service, immediately stop debugging, and then try to update the web reference again. Usually it helps.
you can deploy the web service on IIS then consume it in console application.
I've created a basic WCF service library project and deployed it to my local IIS installation (7.5).
Whenever I try to navigate to it via localhost/TestWcfServiceLibrary/ I just get a directory view.
However, if I start the service in debug mode from visual studio, I get the system tray popup telling me that it's been hosted, and then when I go back to localhost/TestWcfServiceLibrary/, I'm able to see the wsdl.
As soon as I stop debug mode and refresh the browser, I'm back to the directory view.
The base address in the config file is localhost/TestWcfServiceLibrary/ so I don't understand why I'm seeing this behavior.
Interestingly, if I navigate to localhost/TestWcfServiceLibrary/service.service1.svc (A file that doesn't exist) I get the wsdl even when debug mode is off.
So I have 2 questions.
1) Why does debug mode in visual studio have any affect at all on whether or not I can access the wsdl from the path localhost/TestWcfServiceLibrary ? (I suspect it's because the wcf service is not technically hosted at "localhost", it's hosted at , so the address doesn't really exist until debug mode is turned on, so I'm actually connected to the temporarily hosted version that visual studio provides and NOT the real IIS hosted webservice?)
2) When deploying a WCF service library directly to IIS, is it always correct to point to the .svc file with a the namespace and class name of your service contract, even though that file doesn't really exist (I'm guessing that's the magic that IIS performs for you)?
1) You can see where your webservice is hosted in the Web tab of the properties of your WCF project. Default behavior in VS.NET is to host your project in IISExpress, a mini IIS that comes with Visual Studio.NET and that is automatically started when you run a service. So, if you haven't changed the default then yes, your service is technically hosted at "localhost", but not on port 80 in IIS but on another port in IISExpress (The exact port varies)... I guess it's IISExpress that decides to give you the wsdl when you browse to the service address. That is not default behaviour of IIS. That will show the folder contents if directory browsing is enabled in the web.config, and otherwise gives you a 404 (not found) error.
2) There are 2 ways to activate a WCF service in IIS. Either you provide a real .svc file that lists what service implementation IIS should start. Either you indicate that in the node in your web.config file. It is the .svc part of the URL that triggers IIS to start the service.
my problem is I want to install the copy of the web service which is currently running on the server. I built the copy of the web service again and got a setup file. But if we tried to install that service on the server, it shows an error, saying a version is already installed in the system. I changed the name of the service, but doesn't work
Newbie here. I have created a Silverlight App which retrieves data via WCF RIA Services. Now I would like test it to another PC so I did a Publish. The folder contains bin, ClientBin (with xap), .html, .config, etc.
I then copied the folder to the other PCe and opened the *.html file
My silverlight app didn't run. Do I really need to configure the IIS for the other machine and deploy the binaries there to see my silverlight application in action?
Thanks!
If you want simply to watch Silverlight UI (without using WCF) you can, of cource, open *.html page with the application. But if your application needs in WCF service, the service should be runned.
If your machines in domain group and you have IIS installed for one of them, you can in Visual Studio in project properties configure use local IIS insted of developers web-server, then you should update service references and then you can browse silverlight app. from within any computer in domain network.
I have a web service project and simple test application. I can debug the web service from Visual Studio 2008. However, there exist a real client application, but it is on another machine. ASP.NET Development Server does not allow connections if they are not from localhost, or so it seems. Is there a way to debug a web service, if client application is on another machine?
Edit
The tool that I used is Trace Utility from Microsoft SOAP Toolkit. Further explanation can be found here (works on XP; see continuation story for Windows 7 solution). There was problem with it though. My remote client fetches the WSDL first, and then creates URL based on values in soap tags found at the end of WSDL. So client gets redirected to localhost, which is not good.
I found my problem though, but I'll leave the question open until I find the time to try debugging via IIS.
Install a virtual directory into the IIS on your local machine. If you don't have IIS, install it. Once IIS is installed and configured on your local machine, you should be able to use either the IP or create a dns alias for that IP to access the web service that way.
I'm using SoapUI basic version to fake the SOAP requests to the web service, which is running in debug mode in Visual Studio, from the local computer.
You can use IIS (or Cassini Web server) - for debugging, attach VS 2008 to correct process (for example w3p.exe(IIS6 or greater) or aspnet_wp.exe(IIS 5)).