- 2
- 0
- 约5.01千字
- 约 12页
- 2017-02-16 发布于江苏
- 举报
Building_a_Simple_Web_Service【DOC精选】
21/11/2007 Building a Simple Web Service
Distributed Enterprise Applications Stephen Hole
Simple Web Service
Distributed Enterprise Applications
Introduction
This tutorial is meant to illustrate the ease with which a Web Service can be constructed.
Creating the Service
Create a new Visual Studio 2005 Web Site named MoneyConverter. The service needs to provide functions for the following:
Converting Dollars To Euros
Converting Euros To Dollars
The new project should use the:
ASP.NET Web Service Template
HTTP as location (http://localhost/MoneyConverter)
Visual Basic as the language
When the ASP.NET Web Service template open the Solution Explorer should look similar to Figure 2.
The default code created is shown below.
Please note that there is a Hello World WebMethod created as a template for guidance on how to create programmer defined WebMethods.
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
WebService(Namespace:=/) _
WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1) _
Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated() _
Public Class Service
Inherits System.Web.Services.WebService
WebMethod() _
Public Function HelloWorld() As String
Return Hello World
End Function
End Class
In the Solution Explorer rename Service.asmx to MoneyConverter.asmx.
In the Code Window rename the Class from Service to MoneyConverter.
Change the tag code in MoneyConverter.asmx to reflect the change in class name.
Default MoneyConverter.asmx code %@ WebService Language=vb CodeBehind=~/App_Code/Service.vb Class=Service % MoneyConverter.asmx code after change in class name %@ WebService Language=vb CodeBehind=~/App_Code/Service.vb Class=MoneyConverter %
You can test the Web Service by running your project. This is ok if you want a simple test but you will need to run without debugging.
When the service runs it will open up in the default web browser.
Click HelloW
您可能关注的文档
- book、reader和borrow表练习题【DOC精选】.doc
- Book_Unit__healthy_eating_导学案教师版【DOC精选】.doc
- BookZ Text Reader图书上传教程【DOC精选】.doc
- Boolean数据类型 真假【DOC精选】.doc
- boolean的使用方法【DOC精选】.doc
- bootstrap-frame【DOC精选】.doc
- bootstrap_table_document【DOC精选】.docx
- Boosting by weighting critical and erroneous samples【DOC精选】.doc
- bootstrap中CSS的学习【DOC精选】.docx
- bootstrap学习文档【DOC精选】.doc
- BUnitInthelibrary译林新版小学英语三级下册单元集体备课教案【DOC精选】.doc
- bunit_welcome_to_sunshine_town单元测验【DOC精选】.doc
- Bunit-unit短语【DOC精选】.doc
- business card etiquette 跨文化交际中的名片礼仪【DOC精选】.doc
- bv-xiaoj高中地理新教材图表解读【DOC精选】.doc
- B_Unit - 副本【DOC精选】.doc
- BUnit 教案【DOC精选】.doc
- B【DOC精选】.doc
- Business Scenario - 订单受理 Service Process v.【DOC精选】.doc
- b_王伽伯-药物安全【DOC精选】.doc
最近下载
- 村级人民调解员培训.pptx VIP
- 《人工智能发展前沿》 何友教材 ppt课件 第8章 元宇宙.pptx VIP
- 数学一年级下册认识平面图形的练习题..doc VIP
- 浙江省推广应用、禁止和限制使用技术公告【2014-284号文】.doc VIP
- 大公变频器说明书DG800.docx VIP
- 量子通信卫星核心部件行业市场供需全域解析及投资创新前瞻报告.docx
- 危重病人安全管理危病人安全管理.doc VIP
- 六年级下册美术教案-第8课《我设计的服装》人教新课标(2014秋).doc VIP
- 新时代好队员的社会责任与担当精神ppt课件(优质ppt).pptx
- 人教版二年级劳动下册全册教案教学设计.pdf VIP
原创力文档

文档评论(0)