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 ...
随机推荐
- Python基础【day02】:数据运算(二)
本节内容 数据运算 表达式while 循环 一.数据运算 算数运算: 比较运算: 赋值运算: 逻辑运算: 成员运算: 身份运算: 位运算: #!/usr/bin/python a = 60 # 60 ...
- JavaScript中的栈和堆内存,作用域
1.栈 stack”和“堆 heap” 简单的来讲,stack上分配的内存系统自动释放,heap上分配的内存,系统不释放,哪怕程序退出,那一块内存还是在那里.stack一般是静态 ...
- cdqz2017-test10-柚的策略(期望DP & 组合数学)
根据期望的可加性,我们可以算出每一位客人的期望等待时间,将他们累加 即 每一位客人所有可能情况的时间之和 / n! 设S= 每一位客人所有可能情况的时间之和 如果有f(i,p)种方案使客人i是恰好第p ...
- Kruskal算法:最小生成树
//Kruskal算法按照边的权值从小到大查看一遍,如果不产生圈(重边等也算在内),就把当前这条表加入到生成树中. //如果判断是否产生圈.假设现在要把连接顶点u和顶点v的边e加入生成树中.如果加入之 ...
- Python中的包ImportError
前言 Python中的包给我提供了很好的代码组织,相似的功能模块放在同一个包内,不仅代码结构清晰,而且调用起来也比较方便(可以用*导入) 但是,我们在刚开始使用Python包的时候总是会遇到导入错误& ...
- 绕过CDN查看网站真实IP的一些办法
验证是否存在CDN最简单的办法 通过在线的多地ping,通过每个地区ping的结果得到IP. 看这些IP是否一致,如果都是一样的,极大可能不存在cdn,但不绝对. 如果这些IP大多数都不太一样或者规律 ...
- python技巧 列表推导
val = [expression for value in collection if condition] 等价于 val = []for value in collection: if c ...
- 网易云课堂--妙味 《js基础课程》
==小例子1 ==JS中允许将"." 替换成 “[ ]” document.getElementById('btn1') 写成 document['etElementById' ...
- android 常见分辨率与DPI对照表
分辨率对应DPI ldpi QVGA (240×320) mdpi HVGA (320×480) hdpi WVGA (480×800),FWVGA (480×854) xhdpi 720P( ...
- 深入理解 RecyclerView 系列之:ItemDecoration
https://blog.piasy.com/2016/03/26/Insight-Android-RecyclerView-ItemDecoration/?utm_source=tuicool&am ...