1 / 9

Web Service Project (.NET)

Web Service Project (.NET). Dr. Dante Ciolfi ( chawl fee). Overview. Materials required Create a Web Forms site Expose a Web service – temperature converter Create a data consumer for above service Adjustments to code provided by Visual Studio. Materials required.

tamal
Download Presentation

Web Service Project (.NET)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web Service Project (.NET) Dr. Dante Ciolfi (chawl fee)

  2. Overview • Materials required • Create a Web Forms site • Expose a Web service – temperature converter • Create a data consumer for above service • Adjustments to code provided by Visual Studio

  3. Materials required • Visual Studio 2013 (2012 may work) • File named code.txt

  4. Create a Web Forms site • Create a ASP.NET Web Forms site (VB) called TempConvert • Add item: TempConvert.asmx • TempConvert.asmx: add code: Imports System.Web • Add reference to project: Debug > TempConvert Properties > add System Web

  5. Expose a Web service • Add code to TempConvert.asmx.vb (see code.txt)

  6. Create a data consumer for above service • Add item: WebForm1.aspx (with WebForm1.aspx.vb) • Add code to above file (use code.txt)

  7. Adjustments to code provided by Visual Studio • TempConvert.asmx.vb: • Change Namespace reference: instead of “uri”, use tempconvert + your initials, e.g., tempconvertdc.org (a unique name is needed here) • WebForm1.aspx: • Value of action attribute: use file name and function, e.g., ‘TempConvert.asmx/FahrenheitToCelsius’ • WebForm1.aspx.vb: • rURL line: use complete address, e.g., http://localhost:17388/TempConvert.asmx (hint: run your app to check the port) • Button1.CommitTransaction (use CommitTransaction, not Click) • Error: “Handles clause requires a WithEvents…”: place the following code above Protected Sub Button1_Click…: Public WithEvents Button1 As UserControl

  8. Summary • Materials required • Create a Web Forms site • Expose a Web service – temperature converter • Create a data consumer for above service • Adjustments to code provided by Visual Studio

  9. Credits Resources: (accessed 11/11/2013) ----------------------- Web service example: http://wwwht.w3schools.com/webservices/ws_example.asp Redirect to a URL via VB: http://www.infopathdev.com/forums/p/11646/41098.aspx Handles clause requires a WithEvents...: http://social.msdn.microsoft.com/Forums/vstudio/en-US/45889a1c-b14e-45ba-99e1-ee87c8b1facd/handles-clause-requires-a-withevents-variable-defined-in-the-containing-type-or-one-of-its-base?forum=vbgeneral

More Related