You must Sign In to post a response.
  • Category: Webservices

    How to create web services

    Hi

    i am using VS2010 WITH C#..... i am new in web services..... please tell me step by step process of how to create web services and how can install it and how can access it.......... i know windows services...... i am working in windows services but i dont know web services...... please help me

    Thanks
    Ramya
  • #758741

    Hi Ramya,

    To create the Web service
    1. In Solution Explorer, right-click the Web site name (http://localhost/TemperatureWebService), and then click Add New Item.
    2. Under Visual Studio installed templates, click Web Service, and then in the Name box, type Convert.
    3. Make sure that the Place code in separate file check box is selected, and then click Add.

    1. Add the following code inside the class, after the HelloWorld method:
    [System.Web.Services.WebMethod()]
    public double FahrenheitToCelsius(double Fahrenheit)
    {
    return ((Fahrenheit - 32) * 5) / 9;
    }

    [System.Web.Services.WebMethod()]
    public double CelsiusToFahrenheit(double Celsius)
    {
    return ((Celsius * 9) / 5) + 32;
    }

    2. After you have entered the functions, save the file.

    To test the Web service:

    1. In Solution Explorer, click Convert.asmx, and then press CTRL+F5.
    The Web service is invoked and a page appears in the browser that shows the methods that are exposed by the Web service.
    2. Click CelsiusToFahrenheit, which invokes that method.
    A page appears that prompts you for parameter values for the CelsiusToFahrenheit method.
    3. In the Celsius box, type 100, and then click Invoke.
    A new window appears that displays the XML that the Web service returns when the CelsiusToFahrenheit method is invoked. The value 212 appears in the XML.
    4. Close the browser that contains the method results.
    5. In the original browser, click Back to return to the list of methods.
    6. Click FahrenheitToCelsius and test to make sure that the method is returning the results that you expect.
    If you type 212, the FahrenheitToCelsius method will return 100.
    7. Close the browser.

    You have finished creating the Web service; the next step is to use it.

    For more reference follow the below link:
    https://msdn.microsoft.com/en-us/library/8wbhsy70(v=vs.80).aspx

    Hope this will help you.
    Mark the answer if it helps you.


    Regards,
    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • #758742

    Hi Ramya.

    I have written one nice article on webservices for beginners like you.
    You can even create by yourself if you go through the below article.
    In the article I have explained clearly step by step how to create a webservice and how to consume the created webservice with the help of client application.
    Refer the below link to read the article.

    www.dotnetspider.com/resources/46129-Creating-and-consuming-webservice.aspx

    If you have any doubts you can comment below of the article.

    Regards

    Sridhar.
    DNS Member.
    "Hope for the best.. Prepare for the worst.."


    Sridhar Thota.
    Editor: DNS Forum.

  • #758768
    Hi,

    To create web services, check the following links

    http://www.aspdotnet-suresh.com/2011/05/aspnet-web-service-or-creating-and.html

    http://www.c-sharpcorner.com/UploadFile/0c1bb2/converting-from-to-to-current-date-into-days-using-Asp-Net/

    http://www.tutorialspoint.com/asp.net/asp.net_web_services.htm

    https://msdn.microsoft.com/en-us/library/8wbhsy70(v=vs.80).aspx

    http://www.codeproject.com/Articles/863/Your-first-C-Web-Service

    http://www.webreference.com/programming/asp_net/web_service/index.html

    Thanks & Regards,
    Mahesh Durgam

  • #763135
    Hi, Sorry to say that I have no idea regarding web services because I also use windows service from Mywindowshosting.com.But After reading this discussion, I got some idea about web services. So Thanks a lot to all for sharing ideas about web services and how to create it.


  • Sign In to post your comments