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
%>
查看全文
相关阅读:
测试常用的sql语句总结
测试常用的Linux命令总结
【转载】vim 中如何替换选中行或指定几行内的文本
1074 Reversing Linked List
1077 Kuchiguse
LC 355. Design Twitter
LCP 5. 发 LeetCoin
LC 1409. Queries on a Permutation With Key
1095 Cars on Campus
LC 1369. Get the Second Most Recent Activity
原文地址:https://www.cnblogs.com/hanguoji/p/1131352.html
最新文章
list元素按照日期排序
yum 时一直停在Determining fastest mirrors 界面
linux防火墙
解决百度地图中心偏移到左上角
js携带参数跳转controller返回页面
发送http请求和https请求的工具类
微服务根据时间段查询
springboot三种配置文件上传下载大小的配置
解决autowaired注入时机问题
python开启web服务
热门文章
手工注入
360crawlergo动态爬虫+xray被动扫描
burpsuite插件Passive Scan Client加xray进行被动扫描
python安装模块
【转载】大连商品交易所-新套利撮合算法FAQ
软考高项总结
Linux中.rar文件解压
普通话考试易错字
常用的软件工程相关技术标准
tcpdump使用方法
Copyright © 2011-2022 走看看