- Back to Home »
- Webservices
Posted by : my solutions
Saturday, January 5, 2013
Basic Things Regarding web service
----------------------------------------------------------------------------
* What is Web service
* Why it is
* What we can do with this
Developer Environment
-----------------------------------------------------------------------------
* How to create Web service
* Consuming Web service
* Types of Web services ( Rest-ful and Simple)
Web Service :-
Is a kind of service which is act as globally.
Why it is :-
To Implement the Remote type service to your app
What we can do with this :-
"Language Independent" and Service oriented feature to your app
Simple Conceptual View
the figure represented minimal information regarding web service. but you will get several doubt's ofter seeing this picture . what is discomap file and how soap and uddi works in webservice . and how it will create service architectutre and remoting .
i will clear your doubts with an examples and i hope you will understand how to create , how to use and how to develop because which is very easy
sample Example :
Initial steps to configure web service template to your .net application .
select the solution explorer -> add new item ->down the scroll choose webservice.asmx
create a basic web service with parameters and with without parameters
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
/// <summary>
/// Summary description for sample
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class sample : System.Web.Services.WebService {
public sample () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
// with out parameter
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
// with parameters
[WebMethod]
public int add(int a, int b)
{
return a + b;
}
}
Right click of the "sample.asmx" view in browser
with out parametre
with parametre
with parameters means it will ask your inputs .
this is the basic version of web service next step consume and developing web service with dbconnections it is very useful for the developers, means how it helpful at real time environment.
"as per my working senareios i will explain how i used this webservice in where at project development"
"Happy coding with P.m@ruthi"