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的更多相关文章

  1. Webservice简介

    一.序言 大家或多或少都听过WebService(Web服务),有一段时间很多计算机期刊.书籍和网站都大肆的提及和宣传WebService技术,其中不乏很多吹嘘和做广告的成分.但是不得不承认的是Web ...

  2. webservice简介以及简单使用

    本文主要是简单的介绍webservice是什么.webservice的由来.webservice的作用,以及后面会介绍webservice的使用. webservice是什么? 目前,Web serv ...

  3. webservice简介及客户端搭建

    在环境变量中,CLASSPATH添加D:\apache-cxf-2.4.2\lib 新建CXF_HOME   D:\apache-cxf-2.4.2 在PATH中添加   D:\apache-cxf- ...

  4. 分布式系列六: WebService简介

    WebSerice盛行的时代已经过去, 这里只是简单介绍下其基本概念, 并用JDK自带的API实现一个简单的服务. WebSerice的概念 WebService是一种跨平台和跨语言的远程调用(RPC ...

  5. WebService系列一:WebService简介

    原文链接:http://www.cnblogs.com/xdp-gacl/p/4259109.html 一.WebService是什么 WebService是一种跨编程语言和跨操作系统平台的远程调用技 ...

  6. Restful WebService简介

    RESTful Web Services已经渐渐開始流行, 主要是用于解决异构系统之间的通信问题.非常多站点和应用提供的API,都是基于RESTful风格的Web Services,比較就有Googl ...

  7. C#-WebService基础02

    WebService WSDL是web service的交换格式 跨平台数据交互 什么是web服务 SOA 面向服务的体系结构  service-Oriented Architecture Servi ...

  8. 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 ...

  9. Android使用ksoap2调用C#中的webservice实现图像上传

    目录: 一. android使用ksoap2调用webservice 二. 异步调用 三. Android使用ksoap2调用C#中的webservice实现图像上传参考方法 四. 图像传输中Base ...

随机推荐

  1. sublime 成对括号高亮显示设置

    ctrl+shift+p/pcip(Package Control : Install Package)/ BracketHighlighter(括号高亮插件)

  2. POJ 2796[UVA 1619] Feel Good

    Feel Good Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 16786   Accepted: 4627 Case T ...

  3. Ubuntu下提示U盘没有权限--只能读不能写

    在Windows下,U盘能够正常地读写文件(能复制粘贴),但发现有个文件打不开.然后在Linux下,对U盘只能读不能写.提示:Read only system. 参考:https://bugs.lau ...

  4. 百度编辑器 Ueditor 如何增加模板 ?

    模板文件在这里: dialogs/template/config.js 参见:http://t.mreald.com/191 .

  5. toFixed方法的bug

    最近在工作过程中碰到一个隐藏的bug,经调试发现竟然是toFixed函数不可靠的结果引起的.后端同学在处理价格比较的时候,用foFixed进行价格的四舍五入之后,竟然发现比较的结果有问题: 大家都知道 ...

  6. WebStrom设置默认浏览器

  7. 腾讯云Unbuntu服务器安装桌面环境

    进入命令行 1.sudo apt-get install xinit 2.sudo apt-get install gdm 3.sudo apt-get install ubuntu-desktop ...

  8. 支付宝app支付流程

  9. ubuntu新建组合用户命令不管用

    当我们新建了组和用户的时候发现一些命令不管用了,这是什么问题呢. 一.解决方案. 通过以下命令添加组和用户,切换到新用户,发现命令不管用,只有一个$符号. groupadd 新组名 ----添加组 u ...

  10. UBUNTU18.4环境下使用更好用的搜索引擎(无奈,只能起这样的标题)

    初步安装 更新软件源 sudo apt-get update 安装pip (一个安装和管理 Python 包的工具) sudo apt-get install python-pip sudo apt- ...