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

    How to create & consume webservice for Asp.net website

    Hi,

    I am working on asp.net using c# website project.Now company wants to use webservice for insert,update,delete and select datas.I have created folder called Webservices in root.I want to add Webservice to this folder.After writing the code,i will use in code behind file to insert the records.I want the entire steps for the webservice create and consumption for my assigned project.

    Regards
    Rama
  • #763652
    Hi Rama,

    Have you refer below link "c-sharpcorner.com/UploadFile/0c1bb2/consuming-web-service-in-Asp-Net-web-application/", this will help you to create and consume your web service, try it out this will help you to move further in your project.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #763653
    Hi Rama.

    Select new asp.net empty wesite and name as yourService the right click on website path and select add new item.
    Secelct webservice from list and name as sampleService, clik ok.
    Visual studio creates sampleservice.asmx and sampleservice.cs files.
    Write methods in class file, the methods like insert, update and delete
    Write the necessary code to perform the insert,update and delete operations build the project thus your service is is ready to be consumed.
    Now you should have a client application to consume the service created by you.
    In order to call the service methods you should create a proxy class then call the methods of service with the object.

    Refer the below article which shows you clearly step by step to create and consume the webservice.

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

    You can post your doubts if you have any, after reading that article.

    Sridhar Thota.
    Editor: DNS Forum.

  • #763655
    I want to add webservice files to my created folders i.e
    WebServices.Is the Add serviceReference is mandatory?

  • #763656
    Hi Rama,

    If you want to consume your Webservice in your project that is mandatory to add ServiceReference, without that you can't access your webservice into your project.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #763692
    To create or use web service for Asp.net website, you need to follow three steps;

    • With all employee details method, create ASP.Net web service
    • With the help of database, Web service method will get employee details
    • Make web application to access and bind the response details to the grid

  • #766508
    Nice discussion. Sorry to say that I have no idea, but after reading this discussion, I know How to create & consume webservices for Asp.net website. Actually I am a web hosting user and I hosted my website on Mywindowshosting.com,which provides free as well as paid hosting services. Continue discussion so that those who have no idea can get something. Thanks a lot.

  • #766574
    web service is an application that connects to other web based application through HTTP, WebService is language independent and Web Services communicate by using standard web protocols and data formats it communicates with HTTP, XML, SOAP
    Web Service messages are formatted as XML, a standard way for communication between two incompatible system. And this message is sent via HTTP, so that they can reach to any machine on the internet without being blocked by firewall.
    you need to write a web method in class file and run its ASMX file
    then you need to create a web site and its reference using add 'web reference'
    see below link for more details
    http://www.aspdotnet-suresh.com/2011/05/aspnet-web-service-or-creating-and.html

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #766578
    Just install/create web app for you web service in the IIS.
    What kind of web service you are using, SOAP or REST?.

    If it is the SOAP you have to refer that web service in your application. Once you refer the web service you will get the proxy classes for your web service. So you can access all the methods available in that web service. This is the way to consume the SOAP web service in your application.

    If it is the REST kind of web service it is very simple to consume. Just make HTTP call and consume the web service. You can to create the HTTPClient, specify the URL send the input string.

    By Nathan
    Direction is important than speed

  • #766625
    Hi,

    Kindly Go through the below mentioned Links for your Reference. It may helps you lot.

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

    2.http://www.c-sharpcorner.com/UploadFile/0c1bb2/consuming-web-service-in-Asp-Net-web-application/

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


Sign In to post your comments