Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Web Service Project (.NET) Dr. Dante Ciolfi (chawl fee)"— 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.txtcode.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)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)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


Download ppt "Web Service Project (.NET) Dr. Dante Ciolfi (chawl fee)"

Similar presentations


Ads by Google