WebService简介-02
WebService-面向服务编程SOA

WebService-远程通信
运行效果:

1:添加服务器引用http://www.webxml.com.cn/WebServices/WeatherWebService.asmx

添加表格

<?xml version="1.0" encoding="utf-8"?>
<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="WebService1Soap" />
<binding name="WeatherWebServiceSoap" />
</basicHttpBinding>
<customBinding>
<binding name="WeatherWebServiceSoap12">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://localhost:50382/WebService1.asmx" binding="basicHttpBinding"
bindingConfiguration="WebService1Soap" contract="ServiceReference1.WebService1Soap"
name="WebService1Soap" />
<endpoint address="http://www.webxml.com.cn/WebServices/WeatherWebService.asmx"
binding="basicHttpBinding" bindingConfiguration="WeatherWebServiceSoap"
contract="ServiceReference3.WeatherWebServiceSoap" name="WeatherWebServiceSoap" /> </client>
</system.serviceModel>
</configuration>
webConfig文件
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls; namespace BBFJ.WebFormApp
{
public partial class Index : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//ServiceReference1.WebService1SoapClient client = new ServiceReference1.WebService1SoapClient();
//int sum = client.Add(3,6);
//Response.Write(sum);
//Response.Write(client.LoadUserInfoList()); ServiceReference3.WeatherWebServiceSoapClient client = new ServiceReference3.WeatherWebServiceSoapClient(); DataSet ds = client.getSupportDataSet();
this.GridView1.DataSource = ds.Tables[0];
this.GridView1.DataBind();
}
}
}
Index
WebService简介-02的更多相关文章
- Webservice简介
一.序言 大家或多或少都听过WebService(Web服务),有一段时间很多计算机期刊.书籍和网站都大肆的提及和宣传WebService技术,其中不乏很多吹嘘和做广告的成分.但是不得不承认的是Web ...
- webservice简介以及简单使用
本文主要是简单的介绍webservice是什么.webservice的由来.webservice的作用,以及后面会介绍webservice的使用. webservice是什么? 目前,Web serv ...
- webservice简介及客户端搭建
在环境变量中,CLASSPATH添加D:\apache-cxf-2.4.2\lib 新建CXF_HOME D:\apache-cxf-2.4.2 在PATH中添加 D:\apache-cxf- ...
- 分布式系列六: WebService简介
WebSerice盛行的时代已经过去, 这里只是简单介绍下其基本概念, 并用JDK自带的API实现一个简单的服务. WebSerice的概念 WebService是一种跨平台和跨语言的远程调用(RPC ...
- WebService系列一:WebService简介
原文链接:http://www.cnblogs.com/xdp-gacl/p/4259109.html 一.WebService是什么 WebService是一种跨编程语言和跨操作系统平台的远程调用技 ...
- Restful WebService简介
RESTful Web Services已经渐渐開始流行, 主要是用于解决异构系统之间的通信问题.非常多站点和应用提供的API,都是基于RESTful风格的Web Services,比較就有Googl ...
- C#-WebService基础02
WebService WSDL是web service的交换格式 跨平台数据交互 什么是web服务 SOA 面向服务的体系结构 service-Oriented Architecture Servi ...
- 04 Spring:01.Spring框架简介&&02.程序间耦合&&03.Spring的 IOC 和 DI&&08.面向切面编程 AOP&&10.Spring中事务控制
spring共四天 第一天:spring框架的概述以及spring中基于XML的IOC配置 第二天:spring中基于注解的IOC和ioc的案例 第三天:spring中的aop和基于XML以及注解的A ...
- Android使用ksoap2调用C#中的webservice实现图像上传
目录: 一. android使用ksoap2调用webservice 二. 异步调用 三. Android使用ksoap2调用C#中的webservice实现图像上传参考方法 四. 图像传输中Base ...
随机推荐
- GoLang基础数据类型--->数组(array)详解
GoLang基础数据类型--->数组(array)详解 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.Golang数组简介 数组是Go语言编程中最常用的数据结构之一.顾名 ...
- myeclipse设置,提高开发效率
全局搜索,打开一个文件,却把另外一个给关掉. 解决办法: 在myeclipse中window-preferences-general-search找到第一行的一个选项reuse editors to ...
- Linux记录-重启后磁盘丢失问题解决方案
1.df -TH 查看挂载情况 2.fdisk -l 查看磁盘情况 3.blkid 查看磁盘文件系统 4.vim /etc/fstab 加入 /dev/xvdf ext4 defaults 0 ...
- Spark记录-Scala基础程序实例
object learn { def main(args:Array[String]):Unit={ println("请输入两个数字:") var a:Int=Console.r ...
- #线程池pool 【参考】
参考链接 http://www.open-open.com/lib/view/open1415453575730.html 参考配置 http://www.cnblogs.com/linjiqin/a ...
- mysql运行警告
警告信息: Fri Oct 28 09:33:35 CST 2016 WARN: Establishing SSL connection without server's identity verif ...
- c# 网络验证
#region 检查网络连接 static bool exitResult = false; /// <summary> /// 检查网络连接 /// add by wlzhang 201 ...
- Netty入门(4) - 附带的ChannelHandler和Codec
使用SSL/TLS创建安全的Netty程序 Java提供了抽象的SslContext和SslEngine,实际上SslContext可以用来获取SslEngine来进行加密和解密.Netty拓展了Ja ...
- Adroid反编译资料收集
Android反编译神器jadx的使用 https://blog.csdn.net/Fisher_3/article/details/78654450 Android 反编译利器,jadx 的高级技巧 ...
- 20165230田坤烨《网络对抗》Exp1 PC平台逆向破解
实践目标 本次实践的对象是一个名为pwn1的linux可执行文件. 该程序正常执行流程是:main调用foo函数,foo函数会简单回显任何用户输入的字符串. 该程序同时包含另一个代码片段,getShe ...