- 1、本文档共12页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
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
文档评论(0)