zoukankan
html css js c++ java
Asp调用WebService事例
ASP调用Web服务事例
<%
'
通过asp程序访问webService服务,取出议案并显示。
'
取出参数公司代码(code)
'
code = trim(Request("code"))
code
=
"
012345
"
'
定义变量,议案的内容
dim
strContent,strFlag
%>
<%
Set
objHTTP
=
Server.CreateObject(
"
MSXML2.XMLHTTP
"
)
Set
xmlDOC
=
Server.CreateObject(
"
MSXML.DOMDocument
"
)
'
strWebserviceURL="http://"+request.ServerVariables("SERVER_NAME")+":8008/CenterWS/CenterWS.asmx/Get_Blance"
'
strWebserviceURL="http://IP:端口/CenterWS/CenterWS.asmx/Get_Blance"
'
strWebserviceURL="http://IP:端口号/CenterWS/CenterWS.asmx/Get_Blance"
'
'strWebserviceURL="http://localhost:8008/CenterWS/CenterWS.asmx/Get_Blance"
strWebserviceURL
=
"
http://www.luckstock.net/CenterWS/CenterWS.asmx/Get_Blance
"
tmp
=
"
RegisterInfoXML=<?xml version='1.0' encoding='gb2312'?><CorpInfo><Authorization><User>BillSurveyJoin</User><Password>xxYtrq2v7Nmrsw1</Password><Role>BillSurveyJoin</Role></Authorization><AppInfo><UserInfo ActionFlag='1'><add key='codes' value='
"
&
code
&
"
' /></UserInfo></AppInfo></CorpInfo>
"
'
Response.Write tmp
objHTTP.Open
"
POST
"
, strWebserviceURL,
False
objHTTP.SetRequestHeader
"
Content-Type
"
,
"
application/x-www-form-urlencoded
"
objHTTP.Send(tmp)
on
error
resume
next
bOK
=
xmlDOC.load(objHTTP.responseXML)
on
error
resume
next
'
Response.Write objHTTP.Status
'
Response.Write xmlStr
if
objHTTP.Status
=
200
then
xmlStr
=
xmlDOC.xml
xmlStr
=
Replace
(xmlStr,
"
<
"
,
"
<
"
,
1
,
-
1
,
1
)
xmlStr
=
Replace
(xmlStr,
"
>
"
,
"
>
"
,
1
,
-
1
,
1
)
'
Response.Write xmlStr
'
Response.Write xmlDOC.documentElement.selectNodes("//string")(0).text
strFlag
=
xmlDOC.documentElement.childNodes.item(
0
).text
if
strFlag
=
""
or
strFlag
=
"
-1
"
then
strContent
=
"
本公司目前暂无发起新的信息!
"
else
strContent
=
strFlag
end
if
'
Response.Write strContent
else
strContent
=
"
提取信息失败!
"
'
Response.Write objHTTP.StatusText
end
if
%>
查看全文
相关阅读:
java实现报数游戏
java实现取字母组成串
java实现取字母组成串
java实现取字母组成串
java实现取字母组成串
java实现取字母组成串
java实现填写算式
java实现填写算式
java实现填写算式
java实现填写算式
原文地址:https://www.cnblogs.com/hanguoji/p/1131352.html
最新文章
Mean Shift具体介绍
hdu 1556 Color the ball(树状数组)
POJ 2031 Building a Space Station
XP的定时关机命令?
《windows核心编程系列》十八谈谈windows钩子
linux内核头文件 cdev.h 解析
Unity自带网络功能——NetworkView组件、Serialize、RPC
讨论:怎样加快android的开机时间
Git 基本使用方法
AngularJS:template2
热门文章
AngularJS:template
Vue.js:路由
Vue.js:自定义指令
Vue.js:组件
Vue.js:表单
Vue.js:事件处理器
Vue.js:样式绑定
Vue.js:监听属性
Vue.js:计算属性
shell脚本实例-游戏脚本
Copyright © 2011-2022 走看看