I wanted to create and use a Web Service in VisualStudio2010.
So, all I did was:
File->New Project->(.Net Framework3.5)Asp.NET WebService Application.
The hello world source page opened, I set visual studio development server, and the desired port, from properties and then I hit run. The problem is the page it is not opening. It is a connection problem or something.
Can you please tell me what do I have to do to make this webservice to run??
There are no error reports in visual or anything. It is just there is no display.
File->New Project->(.Net Framework3.5)Asp.NET WebService Application.
1.dont setup startup page.
2.run your webservice using green icon .
3.directory will be listed in browser.
4.select .svc file.
5.Your service is ready to execute.
Related
I am trying to test the possibility to convert all my WCF service to WebAPI but so far it's a mess. WCF is easy because you create a default project and add 1 or 2 sample method that return anything then add as a service by using the http address and it works out of the box.
On WebAPI you add connected service and type the address and it throw errors so obviously out of the box it has errors and is missing stuff to actually work.
My question is what is missing to WebAPI made with .NET6 to be able to be connected to ?
Following Microsoft example what i should do is to run the service obviously. Then use the path of the json file generated by swagger and input that in the URL of the connected services, give it a namespace and a classname and your good to go.
Step 1 : Running the service
This works i can call the basic 3 method i made for test purpose that return string, List<string> and List<List<string>> and i can execute the "tryout" button and they output everything that it needs
Step 2 : Copy the json file path provided by Swagger
I assumed that this url is good by default. I can click it and i see the definition which seems good.
Step 3 : Create and empty console app and add the connected service
When adding the connected service i pick OpenAPI as it's the only option anyway.
Then it asks for File or URL that i put my value form the service that is running. In this case this is : https://localhost:44341/swagger/v1/swagger.json. I then choose the namespace of WebTest1 and classname of WebTest2 as i dont care and click next
Step 4 : Configuration progress
This is where i have the error which is where i see that the service that can actually run cannot be connected to
Checking project for required NuGet packges... Downloading service
reference from https://localhost:44341/... ErrorFailed adding service
reference(s). Failed to download metadata file from :
https://localhost:44341/.
I finally figured out the temporary fix. I was also able to copy this project over to a colleague and the issue is the same. The problem lies into Visual Studio defaulting for some reason on the debug option of IIS Express which does properly run the service when you press F5 and your browser open normally and you can test things out. The problem is that when you project runs under IIS (actually configured like it would be the real deal) or IIS Express (the only IIS option in the debug setting) you cannot from another application connect to that service.
However if you switch the debug option to the project name and run your WebApi with that instead it also works as expected from the browser that it open but you now can actually add that service from another application without any error.
Personally i have a third option which is WSL which i "guess" is the linux sub system i can't tell as this crash when i try to start and there is no help for the UI of Visual Studio to help understand these menu options.
Now i still have a problem to attach to one running in a real IIS which is probably linked to the same reason why IIS Express debug doesn't work. So i now know that the base code works and now it's an issue of finding why the default doesn't let other application consume from IIS / IIS Express.
For reference purpose this is the debug menu in question where the IIS Express option is not working but selecting the project name like pointed out on the picture actually works.
I'm developing a WebApp in Blazor where i need to use SignalR.
All works (including debugging with visual studio) until i try to test it on IIS, where the page start to loading and never stop.
No error, no timeout to the request, only a blank page and the icon of loading on the browser.
I've already try the web socket issues on IIS and no changes happened.
Thanks in advance for yours solutions
In my VS solution, there are 3 projects as below:
1) Bot2015
2) Bot2015_2 (Startup Project)
3) DB
Bot2015_2 is my Startup Project but whenever I try to test the Bot2015_2 bot application via emulator, it calls the Message Controller of the first project i.e. Bot2015 (that is the issue here). It should access the Message Controller of the start up project i.e. Bot2015_2. Even if I unload the Bot2015 and test the application, same thing is happening, it never calls the correct Message Controller i.e. of Bot2015_2.
Please help me on this!
Thank You.
Double check what port are you using to communicate with your emulator. This is what the emulator use to communicate with your controllers.
To specify a port for a Web application project that uses IIS Express
In Solution Explorer, right-click the name of the application and then select Properties.
Click the Web tab.
In the Servers section, under Use Local IIS Web server, in the Project URL box change the port number.
To the right of the Project URL box, click Create Virtual Directory, and then click OK.
In the File menu, click Save Selected Items.
To verify the change, press CTRL+F5 to run the project.
The new port number appears in the address bar of the browser.
You can check more info here: MSDN
I built a Web API service that's hosted locally on my machine in IIS. I have an iOS app that I'm running via XCode that makes the call to the web service. The connectivity is there, and works. The iOS app successfully makes the connection to my published web service.
The problem is my web service is returning a non descriptive error to the client (iOS), so what I need to be able to do is step through the web service code while running my iOS app.
So, in summary:
I run an iOS app via my MacBook, and it connects to my .NET Web API service.
My Web API service is published to my local IIS, and is returning an error back to the client.
Breakpoints aren't being hit in Visual Studio - do I need to attach my Visual Studio debugger to a specific process? I've tried running my web service in debug mode while running my iOS app, to no avail.
How can I step through my web service code when running the client app (iOS) that accesses the web service?
Attach to process - http://msdn.microsoft.com/en-us/library/vstudio/3s68z0b3.aspx
Make sure "Show processes from all users" is checked, and pick w3wp.exe
You may need to hit the service once first to make sure its started.
To debug an app that's hosted by IIS, you want to attach to process (in Visual Studio it's Tools->Attach to Process or Ctrl+Alt+P) and pick w3wp.exe from the list (you might have to check a few boxes for the process to show up).
Another option is to use our free VS Extension called Conveyor
https://marketplace.visualstudio.com/items?itemName=vs-publisher-1448185.ConveyorbyKeyoti
With it you open up IIS Express to remote connections on your network (or even the web through tunnelling).
Once you've done that you can debug the project directly from VS and connect to the Conveyor port number (or domain name via tunnelling) and debug as you would locally.
you can use Postman client.
First : run the API FROM visual studio
Second : go to postman put the url and add the parameter in body
More information : http://www.tutorialsteacher.com/webapi/test-web-api
this often works for me i generally list all of the processes in IIS with appcmd command
appcmd list wp
and pretty much you know which process to attach by seeing the names of the web services
if appcmd is not available please visit
Here for configuring this
i am connected to my clients network using vpn.
I need to use a exposed webservice of the Project server in their network.
when i tried the url http://server:port/service.asmx?wsdl in browser i get the wsdl.
But when i try to add web refrence in visual studio i says There is a error downloading the http://server:port/service.asmx?wsdl.could not resolve proxy.MycompanyDomain.com.
Why it is not by passing my company's domain. How to resolve it.
You could create a concrete WSDL by downloading the file from your browser and crating your web reference against the WSDL file rather than against the URL. This can be useful when you want to be sure you have a copy of the service interface at a point in time (particularly if the service is third party and may have unexpected changes that you want to flag back to them).