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

  1. Salesforce 使用Js 调用Webservice实例

    1,创建 Custom Button 在页面上 2, 创建CustomJs 代码调用Webservice <!--参数名区分大小写,对于跨层object直接在Object名后直接加参字段名即可- ...

  2. PHP调用Webservice实例

    原文 PHP调用Webservice实例 NuSoap是PHP环境下的WebService编程工具,用于创建或调用WebService.它是一个开源软件,是完全采用PHP语言编写的.通过HTTP收发S ...

  3. JS调用WebService,发布到IIS,网页提示WebService未定义[已解决]

    VS2013中,JS调用WebService,一直运行正常.部署到WindowsServer2008之后,在网页中访问,始终提示网页中有错误,点开之后发现是WebService未定义. 于是上网查解决 ...

  4. asp.net 练习 js 调用webservice

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  5. NET-使用Js调用WebService

    注:JsWebServiceObject 此类是我做测试示例时为了测试js是否能调用webService中的复合类型而单独新建的一个类 此类中只有名字与年龄的属性. 最近身边的一个朋友做项目,其中有一 ...

  6. 使用JS调用WebService接口

    <script> $(document).ready(function () { var username = "admin"; var password = &quo ...

  7. js调用Webservice接口案例

    第一步:新建Webservice接口 主文件方法 using System;using System.Collections.Generic;using System.Web;using System ...

  8. JS调用webservice服务

    webservice服务 webservice服务代码 using System; using System.Collections.Generic; using System.Linq; using ...

  9. asp.net 通过js调用webService注意

    通过JavaSrcipt调用WebService格式: //通过SricptManager 的,services标签添加web服务引用 <asp:ScriptManager runat=&quo ...

随机推荐

  1. ubuntu上安装adt时无法在线安装的问题

    安装了新的ubuntu系统之后,就得重新布置android开发环境了. 找了网上的教程,一步一步做,到了在eclipse上在线下载adt总是出现 Unable to connect to reposi ...

  2. Sudoku Killer

    Problem Description 自从2006年3月10日至11日的首届数独世界锦标赛以后,数独这项游戏越来越受到人们的喜爱和重视. 据说,在2008北京奥运会上,会将数独列为一个单独的项目进行 ...

  3. 初入servlet:Allocate exception for servlet

    老板,来一碗错误垫垫肚子! 如果以下几个错误都符合,估计就是这个原因了. 页面报错如下: java.lang.NoClassDefFoundError:IllegalName: firstDemo/T ...

  4. no device found for connection ‘ System eth0′问题

    我用的是centos6 在ping 百度的时候ping不通 提示错误no device found for connection ' System eth0′ 解决方法:虚拟机右上角有一个小电脑的标志 ...

  5. 【经验分享】Trachtenberg system(特拉亨伯格速算系统)

    二战期间,俄国的数学家Jakow Trachtenberg(1888-1953)被关进纳粹集中营,在狱中,他开发出了一套心算算法,这套算法后来被命名为Trachtenberg(特拉亨伯格)速算系统. ...

  6. javaScript中的return,break,continue的区别

    导语: javaScript中有三种方法可以跳出循环或者终止循环.分别为break.return.continue. 正文: 一.break break 会使得整个程序终止执行或者包含了最内层的循环或 ...

  7. [译]ASP.NET Core 2.0 系列文章目录

    基础篇 [译]ASP.NET Core 2.0 中间件 [译]ASP.NET Core 2.0 带初始参数的中间件 [译]ASP.NET Core 2.0 依赖注入 [译]ASP.NET Core 2 ...

  8. airodump-ng使用手册

    选项: -i, --ivs 捕捉WEP加密的包,忽略出IV之外的所有的包,保存为.ivs格式 airodump-ng wls35u1 -i -w captures airodump-ng wls35u ...

  9. 五:用JAVA写一个阿里云VPC Open API调用程序

    用JAVA写一个阿里云VPC Open API调用程序 摘要:用JAVA拼出来Open API的URL 引言 VPC提供了丰富的API接口,让网络工程是可以通过API调用的方式管理网络资源.用程序和软 ...

  10. [转载] 高性能IO模型浅析

    转载自http://www.cnblogs.com/fanzhidongyzby/p/4098546.html 服务器端编程经常需要构造高性能的IO模型,常见的IO模型有四种: (1)同步阻塞IO(B ...