First web service on ASP.Net
-
Hi all, I've start to learn web services. So I search a simple application and start work on it. http://support.microsoft.com/kb/308359[^] First of all I simply try to run the HelloWorld application. It compiled fine, but when I press the F5 to run the project gives an error message saying, Error while trying to run project; Unable to start debugging on the web server. Can someone tell me how to fix this. I'm wired with this. Thanks
I appreciate your help all the time... CodingLover :)
-
Hi all, I've start to learn web services. So I search a simple application and start work on it. http://support.microsoft.com/kb/308359[^] First of all I simply try to run the HelloWorld application. It compiled fine, but when I press the F5 to run the project gives an error message saying, Error while trying to run project; Unable to start debugging on the web server. Can someone tell me how to fix this. I'm wired with this. Thanks
I appreciate your help all the time... CodingLover :)
First, you need to ensure that you have
<compilation debug="true"> ... </compilation>
in the web.config. Secondly, if you are running VS on a Vista Operating System, do it as Administrator - Right click on the Visual Studio from Programs menu and click "Run as Administrator" -
Hi all, I've start to learn web services. So I search a simple application and start work on it. http://support.microsoft.com/kb/308359[^] First of all I simply try to run the HelloWorld application. It compiled fine, but when I press the F5 to run the project gives an error message saying, Error while trying to run project; Unable to start debugging on the web server. Can someone tell me how to fix this. I'm wired with this. Thanks
I appreciate your help all the time... CodingLover :)
You can not run a web service....... To test the web service you have to create one client application and need to refer this webservice Happy Programming
-
First, you need to ensure that you have
<compilation debug="true"> ... </compilation>
in the web.config. Secondly, if you are running VS on a Vista Operating System, do it as Administrator - Right click on the Visual Studio from Programs menu and click "Run as Administrator"Yes, it's set as true. I'm working on WinXP with .Net 2003 Still not working lol. Any idea. IIS also running.
I appreciate your help all the time... CodingLover :)
-
You can not run a web service....... To test the web service you have to create one client application and need to refer this webservice Happy Programming
Can you guide me how to do it. And I'm confusing, on this. Once I create the project I see this.
// WEB SERVICE EXAMPLE // The HelloWorld() example service returns the string Hello World // To build, uncomment the following lines then save and build the project // To test this web service, press F5 // [WebMethod] // public string HelloWorld() // { // return "Hello World"; // }
What that mean.I appreciate your help all the time... CodingLover :)
-
Can you guide me how to do it. And I'm confusing, on this. Once I create the project I see this.
// WEB SERVICE EXAMPLE // The HelloWorld() example service returns the string Hello World // To build, uncomment the following lines then save and build the project // To test this web service, press F5 // [WebMethod] // public string HelloWorld() // { // return "Hello World"; // }
What that mean.I appreciate your help all the time... CodingLover :)
Like surender939 said, a Web Service has to be consumed by a client. You should add a web (or window) project that consumes you web service. Add a project and add a web reference (to your web service). Then, you can call the HelloWorld() WebMethod. I dont know which book you might be using but I dont think an introductory web service example would be complete without a sample client.
-
Like surender939 said, a Web Service has to be consumed by a client. You should add a web (or window) project that consumes you web service. Add a project and add a web reference (to your web service). Then, you can call the HelloWorld() WebMethod. I dont know which book you might be using but I dont think an introductory web service example would be complete without a sample client.
Actually I'm referring that MS page, link I post on my first post. I'll try what you suggest and if I stuck, be here again. :)
I appreciate your help all the time... CodingLover :)
-
Can you guide me how to do it. And I'm confusing, on this. Once I create the project I see this.
// WEB SERVICE EXAMPLE // The HelloWorld() example service returns the string Hello World // To build, uncomment the following lines then save and build the project // To test this web service, press F5 // [WebMethod] // public string HelloWorld() // { // return "Hello World"; // }
What that mean.I appreciate your help all the time... CodingLover :)
To give you a pointer, once you have added a Web Reference to your project, you can call the HelloWorld WebMethod, say from Page_Load, as follows:
protected void Page\_Load(object sender, EventArgs e) { localhost.Service1 hello = new localhost.Service1(); lblHello.Text = hello.HelloWorld(); }
where, localhost is your Web reference name, lblHello is a label on your web form, and Service1 is the name of your web service
-
Actually I'm referring that MS page, link I post on my first post. I'll try what you suggest and if I stuck, be here again. :)
I appreciate your help all the time... CodingLover :)
I had a look at the link you quoted. The console application is the client. It should work. Make sure that your console project is the start up project. Right click on the project from Solution Explorer and click "Set as Startup Project".
-
To give you a pointer, once you have added a Web Reference to your project, you can call the HelloWorld WebMethod, say from Page_Load, as follows:
protected void Page\_Load(object sender, EventArgs e) { localhost.Service1 hello = new localhost.Service1(); lblHello.Text = hello.HelloWorld(); }
where, localhost is your Web reference name, lblHello is a label on your web form, and Service1 is the name of your web service
Thanks a lot. Before that I want to know one thing. Now I have two project in my solution, a web application and a web service. How can I add a reference to the web service in the web application. And how I add your code there.
I appreciate your help all the time... CodingLover :)
-
I had a look at the link you quoted. The console application is the client. It should work. Make sure that your console project is the start up project. Right click on the project from Solution Explorer and click "Set as Startup Project".
Actually in my solution I have only one project, web service project. Actually I don't know, until you guys mentioned it, that a web service need a web application to start work.
I appreciate your help all the time... CodingLover :)
-
Thanks a lot. Before that I want to know one thing. Now I have two project in my solution, a web application and a web service. How can I add a reference to the web service in the web application. And how I add your code there.
I appreciate your help all the time... CodingLover :)
Just right-click on the project (Web Application) from Solution Explorer, click on Add Web Reference. You will get a dialog box. Under a label: [Browse to:] click [Web services in this solution]. VS will discover all the web services in your solution and they will be presented in a list. Click on the one you want to use and, after giving it an appropriate web reference name add it (VS might suggest something like 'localhost'). You will then be ready to go. You can add the sample code on the Page_Load of a web form in your web application.
-
Just right-click on the project (Web Application) from Solution Explorer, click on Add Web Reference. You will get a dialog box. Under a label: [Browse to:] click [Web services in this solution]. VS will discover all the web services in your solution and they will be presented in a list. Click on the one you want to use and, after giving it an appropriate web reference name add it (VS might suggest something like 'localhost'). You will then be ready to go. You can add the sample code on the Page_Load of a web form in your web application.
Thanks lol, I'll try and let you know what happen in my side. :)
I appreciate your help all the time... CodingLover :)
-
Just right-click on the project (Web Application) from Solution Explorer, click on Add Web Reference. You will get a dialog box. Under a label: [Browse to:] click [Web services in this solution]. VS will discover all the web services in your solution and they will be presented in a list. Click on the one you want to use and, after giving it an appropriate web reference name add it (VS might suggest something like 'localhost'). You will then be ready to go. You can add the sample code on the Page_Load of a web form in your web application.
Ok, As you said I add reference into the web application of the web service. I can build the solution fine, but I cannot run it. How can I run the web application? Please help me.
I appreciate your help all the time... CodingLover :)
-
Ok, As you said I add reference into the web application of the web service. I can build the solution fine, but I cannot run it. How can I run the web application? Please help me.
I appreciate your help all the time... CodingLover :)
Wow, nice work lol. I've figured what the mistake I've done. Seems to me using the IDE, just pressing F5, cannot run the web application. I have to type the URL and run the browser. It's working fine. Is that right lol.
I appreciate your help all the time... CodingLover :)