Debug C# web service - c#

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)).

Related

'ERROR_DESTINATION_NOT_REACHABLE:' Error When Trying to Deploy to Google Cloud Platform

I'm trying to get to grips with Google Cloud for a University Project.
I have created a .NET Google Cloud project on VS 2019 and I'm trying to deploy it to my Windows 2016 server on Google Cloud Platform.
However I keep getting the error:
D:\Program Files\Microsoft Visual Studio\MSBuild\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.targets(4284,5): msdeploy error ERROR_DESTINATION_NOT_REACHABLE: Web deployment task failed. (Could not connect to the remote computer ("35.235.58.62"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.
What I've tried so far:
Checking server's firewall is open for inbound 8172
Disabled home PC firewall to make sure that wasn't the issue
Installed Web Platform Installer on the server
Added ISS Management Service through Web Platform Installer
Enabled remote connections on ISS
Any advice or help on the solution would be greatly appreciated.
Have you installed web deploy on your remote server?
Remote deployment also rely on Web deploy Agent service or Web management Service . Please ensure they have been started. Then you could check whether port number has been opened by making test with Tcping.exe from remote server.
The link provide the steps about how to publish with Management service from remote server:
Web Deploy from Visual Studio 2012 to a remote IIS 8 server
Just remember to set firewall rule like this:
Please ensure port 8172 has been enabled in both windows firewall and Google cloud external firewall.
If the management service is not working, you could try remote agent
https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/configuring-server-environments-for-web-deployment/configuring-a-web-server-for-web-deploy-publishing-remote-agent
The second part from Jokies Ding got it to work for me. (I'm unable to leave a comment on his post due to my stackoverflow reputation points not being 50 yet) I feel like I correctly followed google's instructions for getting web deploy to work with visual studio, but I was unsuccessful.
This below worked for me.
If the management service is not working, you could try remote agent
https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/configuring-server-environments-for-web-deployment/configuring-a-web-server-for-web-deploy-publishing-remote-agent
Following the online steps from google instructions to setup web deploy it should be something like this:
install web deploy
add user to IIS Manager Permissions
[skip] check google's firewall rules (VPC network>firewall rules) port 8172 (this won't be necessary since this remote agent route uses port 80)
start using https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/configuring-server-environments-for-web-deployment/configuring-a-web-server-for-web-deploy-publishing-remote-agent
(this is from step 5 instructions) add server name as host name in Site Bindings
(this is from step 5 instructions) ensure "Web Deployment Agent Service" service is running
configure visual studio publish profile using attached screenshot example (I was unable to get "Visual Studio > Build > Publish [Project Name] to Google Cloud..." to work.)
When you install Web Deploy, make sure to select Custom Setup and check all components. This is what solved the issue for me. IIS Deployment Handler wasn't selected
Source: Could not reach the Web Deploy endpoint on the specified virtual machine

Add service reference error in vs2012

I have created WCF service and hosted it on remote server. i am able to browse the said service from remote as well as on my local machine (firefox)
But when i copy the same url and say "add service reference" to my vs 2012 project file it gives me error
You may want to check the MSDN link. I had a similar issue and it turned out that I wasn't having the right Handler Mappings in local IIS.
Extract from the above link:
If you installed IIS after Windows Communication Foundation (WCF) was installed you must run the following command.
"%WINDIR%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r
This registers the required script maps in IIS.

Hosting WCF service created in VS2010 on IIS

I have been through tons of threads and am unable to find the correct answer for my question. I have created a very simple WCF service on my development machine using visual studio 2010. The service works correctly when using VS to host it. I have even had success creating a small c# application to consume this service. However I now need to move this service to IIS on my work's development server. I have tried following several guides online but nothing has worked so far. Any help would be greatly appreciated.
if you are able to execute your wcf service using WCFTestClient successfully and not on IIS
that means problem is in endpoint configuration. I suggest have a look once again endpoint suggestions.
Using Web Deploy to publish from Visual Studio to a remote web server requires additional installation of Web Deploy on the server http://www.iis.net/learn/install/installing-publishing-technologies/installing-and-configuring-web-deploy
Visual Studio generates an output log during the web deploy publish that may have additional information on why it is failing. Sometimes there are permission issues to work through as well http://blogs.iis.net/krolson/archive/2009/11/04/using-iis-manager-accounts-for-web-deployment-tool-msdeploy-delegation.aspx
You can also generate a Web Deploy Package with Visual Studio and manually deploy it to the server http://msdn.microsoft.com/en-us/library/dd465323(v=vs.110).aspx

run my Asp.Net Web application on another machine

How can I run my application on another machine, my team member wants to view the webpage in his computer. He doesn’t want to install visual studio but just wants to see the webpage in the browser.
I am using a Mac book
Publish it to a web server, or have him install IIS on his machine and set it up.. wait. That would be publishing to a web server.
In short, an ASP.NET website needs a web server to run. Usually it's IIS, but if you have Visual Studio, it uses the built-in Cassini web server. Either way, you need to have it in a web server of some kind. You can't just run it as a stand-alone program.
I haven't' done this, but I think you COULD have it running in your computer in Visual Studio and still have him see it. If you run it, you'll see that the address is in the format:
http://localhost/:[some port number]/YourWebAppName
If you have it running in Visual Studio on YOUR machine, your team member MAY be able to access it by changing "localhost" to your PC name. It's worth a shot.
Otherwise, here are a bunch of links to how to publish your site, in case you're not sure.
http://www.google.com/search?q=publishing+asp.net+web+sites&sourceid=ie7&rls=com.microsoft:en-us:IE-Address&ie=&oe=
Create a new virtual directory in IIS
Set the directory root to your project root folder.
allow anonymous access.
Your team member can then access it at http://yourmachinename/virtualdirectoryname
This looks like a good job for IIS express http://learn.iis.net/page.aspx/868/iis-express-overview/
For the majority of things, it's functionally equivilent to using regular IIS 7.5, with the exception that it's easier to start new websites with this. You simply use the command line to start IIS Express, point it to your physical path, set the CLR version, and the port, done!
http://learn.iis.net/page.aspx/870/running-iis-express-from-the-command-line/
There's some instructions for how to do that.

How do I setup IIS when debugging in Visual Studio 2010?

In Visual Studio 2010 I have created a WebService (WCF) Application and a client to consume said service.
My 3 options as far as what servers to use for debugging are: Visual Studio Development Server, Local IIS Web Server, Custom Web Server.
I know I can't use the VS Development Server if I want my service to be accessible outside of localhost. So I installed IIS (Control Panel>Add/Remove Programs>Add/Remove Features). When I select this option in Visual Studio 2010 it doesn't seem to work. I'm not sure what options I have to setup so that other machines can run the client to consume this service.
By default VS set the Project URL to: http://localhost/MyService. Oh, and I'm working with .svc files (not .asmx) if that makes any difference.
Common problem when you intall IIS after the framework.
Go to your Windows\Ms.Net\Framework\<version> folder and execute aspnet_regiis.exe. It's a commandline tool.
To save having to install IIS you can configure a proxy - such as Fiddler - to redirect certain incoming traffic to localhost.
Because these new requests are "appearing" (via the redirect) from inside your machine, Cassini will respond.
The process is covered in this answer: https://stackoverflow.com/a/4428747/1016183 under "Option #2: Write a FiddlerScript rule"
You can right click on Project and do publish. This will generate the required files for your deploy.
In order to debug your app, you can use the Visual Studio built-in host or IIS.
In your project properties, under Web, you can select "Use Local IIS Server".

Categories