Js 调用 WebService 实例
Html页面代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Js调用WebService</title>
<script type="text/javascript">
function RequestWebService() {
//这是我们在第一步中创建的Web服务的地址
var URL = "http://192.168.210.51:8012/Service.asmx";
var fun = "getAllData"; //在这处我们拼接
var data;
data = '<?xml version="1.0" encoding="utf-8"?>';
data = data + '<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">';
data = data + '<soap12:Body>';
data = data + '<' + fun + ' xmlns="http://tempuri.org/" >';
data = data + '<view>V_Gis_Mid_WasteWaterYearData</view>';
data = data + '<condition>EnterpriseCode = 520100000238</condition>';
data = data + '</' + fun + '>';
data = data + '</soap12:Body>';
data = data + '</soap12:Envelope>'; //创建异步对象
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.Open("POST", URL, false);
xmlhttp.SetRequestHeader("Content-Type", "application/soap+xml");
xmlhttp.Send(data); document.getElementById("data").innerHTML = xmlhttp.responseText;
} </script>
</head>
<body>
<div>
<input id="One" type="button" value="JsCallWebService" onclick="RequestWebService()" />
</div>
<div id="data">
</div>
</body>
</html>
Js 调用 WebService 实例的更多相关文章
- Salesforce 使用Js 调用Webservice实例
1,创建 Custom Button 在页面上 2, 创建CustomJs 代码调用Webservice <!--参数名区分大小写,对于跨层object直接在Object名后直接加参字段名即可- ...
- PHP调用Webservice实例
原文 PHP调用Webservice实例 NuSoap是PHP环境下的WebService编程工具,用于创建或调用WebService.它是一个开源软件,是完全采用PHP语言编写的.通过HTTP收发S ...
- JS调用WebService,发布到IIS,网页提示WebService未定义[已解决]
VS2013中,JS调用WebService,一直运行正常.部署到WindowsServer2008之后,在网页中访问,始终提示网页中有错误,点开之后发现是WebService未定义. 于是上网查解决 ...
- asp.net 练习 js 调用webservice
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- NET-使用Js调用WebService
注:JsWebServiceObject 此类是我做测试示例时为了测试js是否能调用webService中的复合类型而单独新建的一个类 此类中只有名字与年龄的属性. 最近身边的一个朋友做项目,其中有一 ...
- 使用JS调用WebService接口
<script> $(document).ready(function () { var username = "admin"; var password = &quo ...
- js调用Webservice接口案例
第一步:新建Webservice接口 主文件方法 using System;using System.Collections.Generic;using System.Web;using System ...
- JS调用webservice服务
webservice服务 webservice服务代码 using System; using System.Collections.Generic; using System.Linq; using ...
- asp.net 通过js调用webService注意
通过JavaSrcipt调用WebService格式: //通过SricptManager 的,services标签添加web服务引用 <asp:ScriptManager runat=&quo ...
随机推荐
- 理解typename的两个含义
理解typename的两个含义 问题:在下面的 template declarations(模板声明)中 class 和 typename 有什么不同? template<class T> ...
- Bridging signals(NlogN最长上升子序列)
Bridging signals Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- css超过一定长度显示省略号
overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
- Android 开发笔记___RadioButton
horizontal <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" and ...
- vue实现仿淘宝结账页面
这个demo,是小颖基于之前的 vue2.0在table中实现全选和反选 文章进行更新后的demo,主要功能呢,是仿照淘宝页面的结算购物车商品时自动算出合计价格的页面,具体页面效果请看下面的动图: ...
- 【最新版】从零开始在 macOS 上配置 Lua 开发环境
脚本语言,你可能更需要的是 Lua 不同的脚本语言有不同的特性,第一接触的脚本语言,可能会影响自己对整个脚本语言的理解和认知.我以前接触最多的脚本语言是 JavaScript.后果就是:我一度以为脚本 ...
- 关于ThinkPHP中的时间自动填充
<?php class NewsModel extends Model{ protected $_auto = array( array('time_at','mydate','1','call ...
- 闲聊select和input常用的小插件
前言 在pc端的项目中,经常会用到表单标签,莫过于是select和input这两种,这两种相当常用.但往往原生的功能不尽人意,即使 input中type有n多属性,甚至连时间控件都有,但仍旧满足不了我 ...
- Python之上下文管理
http://www.cnblogs.com/coser/archive/2013/01/28/2880328.html 上下文管理协议为代码块提供包含初始化和清理操作的上下文环境.即便代码块发生异常 ...
- ionic开发环境搭建之android及问题
1. 准备工作: a) 配置java开发环境 b) 配置安卓开发环境 注:下载android-studio后,可能会出现android一直在编译,出现这种情况,关掉你的as ,找到你的路 ...