WebService(一)Hello world!和IIS配置
来源:互联网 发布:每月数据统计分析报表 编辑:程序博客网 时间:2024/06/16 05:41
一:win7中IIS安装配置
1.打开控制面板/程序/打开或关闭widows功能
2.把Internet信息服务按照以下勾选,稍等片刻就安装完成。
3.回到控制面板,打开小图标模式。
找到管理工具,打开
找到IIS并打开
3.配置IIS
可以新建一个网站,然后配置绑定信息:
这样还打不开,除了两个错,一个是说什么父路径被锁定,是因为安装IIS的时候没有勾选到ASP.NET选项,所以最后全选上。然后还有个问题就是,说Web服务器被配置为不列出此目录的内容,这个就要启用目录浏览。
然后就可以在浏览器打开了。。。
这样打开的是应用程序的目录,点击入口文件Service1.asmx就可以打开webservice页面了
二:vs2010开发webservice
如果装了.net framework 4.0 要选择4.0以下的才有webservice模版。
这里并没有发现,选择4.0一下版本就会有了
项目建好后,会自动生成一个helloworld方法
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Services;namespace WebService3{ /// <summary> /// Service1 的摘要说明 /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。 // [System.Web.Script.Services.ScriptService] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { return "Hello World"; } }}
运行:
这是展示用各种语言使用webservice的示例,我们点击调用就可以测试了
这里展示的是webservice支持的几种请求的实例
post方法
soap方式请求
- WebService(一)Hello world!和IIS配置
- webService学习(一)—— hello world
- python webservice hello world
- webservice hello world
- Lucene(一)hello world
- Objective-C 学习笔记(一)hello world和基础
- myeclipse 开发webservice hello world
- WebService学习笔记-Hello world
- Eclipse插件开发(一)Hello World
- Python Embedding 开发 - Hello World (一)
- iPhone 开发(一) Hello World 初试
- iPhone 开发(一) Hello World 开始
- Python学习笔记(一)Hello World
- maven学习笔记(一)hello world
- Web Service(一):Hello World
- Android开发历程(一) hello world
- springMVC学习笔记一(hello world)
- Python3基础(一) Hello World
- Win8应用开发 入门篇(一) Hello world!
- [windows phone自学笔记] 第二篇 Button控件
- Win8应用开发 入门篇(二)富文本和消息框
- 【ios6.0 自学瞎折腾】(二)控件交互和对话框
- 【ios6.0 自学瞎折腾】(三)表示图填充数据
- WebService(一)Hello world!和IIS配置
- AndroidのBitmap之大图片优化
- AndroidのIntent之传递List
- AndroidのActivity之退出返回栈(二)
- AndroidのBitmap之圆形头像
- Myeclipse 8.5安装Python插件PyDev
- AndroidのBitmap之Scaletype
- Androidの网络通信之TDP
- AndroidのContentProvider之数据库更新UI