Showing posts with label WEBSERVICE. Show all posts
Showing posts with label WEBSERVICE. Show all posts

Simple insert and Gridview in webservices

Simple Insert in webservices:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data;
using System.Data.SqlClient;

namespace webservices
{
    /// <summary>
    /// Summary description for sample
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 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
    {

WEB SERVICE IN ASP.NET

BASIC IN WEB SERVICES.


HOW TO ADD TWO VALUE IN WEB SERVICES USING ASP.NET IN C#


Visuval studio 2012àfile-ànew project-àsolution floder-àadd new item-àwebservices.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace ws
{
    /// <summary>
    /// Summary description for WebService1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 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 WebService1 : System.Web.Services.WebService
    {

        [WebMethod]
        public int Add(int a, int b)
        {
            return a + b;
        }
    }
}

INSERT,UPDATE,DELETE IN WINDOWS COMMUNICATION FOUNDATION

INSERT,UPDATE,DELETE IN WCF

Visual studio 2008àfileànewàprojectàwcfservicesà

WCF SERVICES HAVE TWO PAGES:
1.SERVICE.CS
2.ISERVICE

SERVICE.CS:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data;
using System.Data.SqlClient;

WINDOWS COMMUNICATION FOUNDATION

BASIC OF WINDOWS COMMUNICATION FOUNDATION.


            WCF communicate any technology and all channels(http,tcp).
             Wcf have services,endpoints and binding.

Services:

The services is basically written on .net language. which contain some methods.that are exposed through wcf services.

Endpoints:

       
A service may have one or more endpoints.endpoint is responsibe for communication for service to the client.
     endpoint is A,B,C