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
%>
查看全文
相关阅读:
Samba配置文件常用参数详解-OK
SVN Server配置详解 及备份
secure crt 基本设置***
ultraedit15.00.0.1046注册码
makefile中的shell语法 ***
Spring (一) IOC ( Inversion Of Control )
软件开发过程中会出来的几个版本
poj3070
Python基础 3----文件和网络
HDU 4720 Naive and Silly Muggles (外切圆心)
原文地址:https://www.cnblogs.com/hanguoji/p/1131352.html
最新文章
【转】提示框第三方库之MBProgressHUD iOS toast效果 动态提示框效果
【转】iOS 宏(define)与常量(const)的正确使用-- 不错
【转】iOS中16进制转10进制
【转】MAC使用adb工具
【转】Parallels Desktop 11.2.0 破解版 最佳Mac虚拟机软件
大型网站的架构设计与演进
大型网站的架构设计与演进
阿姆达尔定律(Amdahl's law)
阿姆达尔定律(Amdahl's law)
Multiple CPUs,Multiple Cores、Hyper-Threading
热门文章
Multiple CPUs,Multiple Cores、Hyper-Threading
【编程】概念的理解 —— socket
【编程】概念的理解 —— socket
学习之法 —— 概念、名词、术语与定义的学习
学习之法 —— 概念、名词、术语与定义的学习
HDMI EDID解读
windows7使用Source insight上远程修改ubuntu共享内核源码
Linux LVM简明教程
Ubuntu Server上的LVM配置
RDA 编译器的搭建
Copyright © 2011-2022 走看看