Question on Web serivce...
-
I have created simple Web serivce using C# for adding two integers and saved the file with "MyWebService.ASMX". I have copied this file to Inetpub/wwwroot IIS directory. When I call this service in browser(http://localhost/Webservices/Addservice.asmx), I am able to see the text boxes for entering the numbers and I am able to see the result in XML. I just write the file and even I didn't compile it, but I am able to use it. Probaly it's a dumb quesiton, I am new to .Net programming. Could somebody explain what is the program flow when I call the service from browser?
-
I have created simple Web serivce using C# for adding two integers and saved the file with "MyWebService.ASMX". I have copied this file to Inetpub/wwwroot IIS directory. When I call this service in browser(http://localhost/Webservices/Addservice.asmx), I am able to see the text boxes for entering the numbers and I am able to see the result in XML. I just write the file and even I didn't compile it, but I am able to use it. Probaly it's a dumb quesiton, I am new to .Net programming. Could somebody explain what is the program flow when I call the service from browser?
Siva Koyi wrote:
I just write the file and even I didn't compile it, but I am able to use it.
It is compiled on fly. You can precompile it if required.
Siva Koyi wrote:
Could somebody explain what is the program flow when I call the service from browser?
It will work only from your local system. If you try to access the web service from outside through browser, I guess you will not get the
Invoke
button. :)Navaneeth How to use google | Ask smart questions
-
Siva Koyi wrote:
I just write the file and even I didn't compile it, but I am able to use it.
It is compiled on fly. You can precompile it if required.
Siva Koyi wrote:
Could somebody explain what is the program flow when I call the service from browser?
It will work only from your local system. If you try to access the web service from outside through browser, I guess you will not get the
Invoke
button. :)Navaneeth How to use google | Ask smart questions
-
Thanks for yor reply. You are right, I am not able to access for outside what is the reason? and where the actual complilation happnes whether in Webserver or Browser(embeded with CLR) Tankful if you could explain the execution flow?
Siva Koyi wrote:
whether in Webserver or Browser(embeded with CLR)
It happens in the web server. Read this[^] to get an idea about what is happening. Also if you are developing web services which will be deployed to a public server, make sure you secure it. Easy way is to disable anonymous access. Web service consumers has to provide the credentials when they use it. :)
Navaneeth How to use google | Ask smart questions
-
I have created simple Web serivce using C# for adding two integers and saved the file with "MyWebService.ASMX". I have copied this file to Inetpub/wwwroot IIS directory. When I call this service in browser(http://localhost/Webservices/Addservice.asmx), I am able to see the text boxes for entering the numbers and I am able to see the result in XML. I just write the file and even I didn't compile it, but I am able to use it. Probaly it's a dumb quesiton, I am new to .Net programming. Could somebody explain what is the program flow when I call the service from browser?
-
Siva Koyi wrote:
I just write the file and even I didn't compile it, but I am able to use it.
It is compiled on fly. You can precompile it if required.
Siva Koyi wrote:
Could somebody explain what is the program flow when I call the service from browser?
It will work only from your local system. If you try to access the web service from outside through browser, I guess you will not get the
Invoke
button. :)Navaneeth How to use google | Ask smart questions
You can precompile trough desktop project too I give you example how you can compile trough webservice and desktop application Webserive :: on the service.cs [WebMethod] public int sum (int a , int b) { return a + b; } and now run the webservice on local host there you will see input textbox1 and input textbox 2 then invoke button you will see the result on xml page Compile trough desktop applicacion : public partial class Form1 : Form { applicationname.Service ws = new localhost.applicacionname.Service(); // this conect you to webservice but dont forget to add web reference (which display you when you will run the webservice) public Form1() { InitializeComponent(); } private void button2_Click(object sender, EventArgs e) // make button on your form and put three txtbox // { int a = int.Parse(textBox2.Text); int b = int.Parse(textBox3.Text); int result= ws.sum(a, b); textBox4.Text = result.ToString(); } Hope it will help you , good luck