ASP调用带验证的XFire(soap Header)
2009-10-24 10:41:26 来源:WEB开发网核心提示:<% 'response.ContentType = "text/html" 'Response.Charset = "utf-8" url = "http://172.17.99.94:8080/rishis/services/QuerySe
<%
'response.ContentType = "text/html"
'Response.Charset = "utf-8"
url = "http://172.17.99.94:8080/rishis/services/QueryService"
soapUserName = "ris"
soapPassWord = "tzyyage542"
SoaPRequest="<?xml version="&CHR(34)&"1.0"&CHR(34)&" encoding="&CHR(34)&"gbk"&CHR(34)&"?>"& _
"<soap:Envelope xmlns:xsi="&CHR(34)&"http://www.w3.org/2001/XMLSchema-instance"&CHR(34)&" "& _
"xmlns:xsd="&CHR(34)&"http://www.w3.org/2001/XMLSchema"&CHR(34)&" "& _
"xmlns:soap="&CHR(34)&"http://schemas.xmlsoap.org/soap/envelope/"&CHR(34)&">"& _
"<soap:Header>"& _
"<AuthenticationToken xmlns="&CHR(34)&"http://spring.com"&CHR(34)&">"&_
"<Username>"& soapUserName &_
"</Username>"&_
"<Password>" & soapPassword &_
"</Password>"&_
"</AuthenticationToken>"&_
"</soap:Header>"& _
"<soap:Body>"& _
"<GetYjSqd_All xmlns="&CHR(34)&"http://spring.com"&CHR(34)&">"& _
"<in0>1</in0>"& _
"<in1>2007-06-01 00:00:00</in1>"& _
"<in2>2007-06-06 00:00:00</in2>"& _
"</GetYjSqd_All>"& _
"</soap:Body>"& _
"</soap:Envelope>"
Set xmlhttp = server.CreateObject("Msxml2.XMLHTTP")
xmlhttp.Open "POST",url,false
xmlhttp.setRequestHeader "Content-Type", "text/xml;charset=gbk"
xmlhttp.setRequestHeader "HOST","172.17.99.94:8080"
xmlhttp.setRequestHeader "Content-Length",LEN(SoapRequest)
xmlhttp.setRequestHeader "SOAPAction", "http://spring.com/GetYjSqd_All"
xmlhttp.Send(SoapRequest)
If xmlhttp.Status = 200 Then
Set xmlDOC =server.CreateObject("MSXML.DOMDocument")
Response.write xmlhttp.getResponseHeader("Content-Type")
xmlDOC.load(xmlhttp.responseXML)
xmlDOC.save("C:\1.xml")
Else
Response.Write xmlhttp.Status&" "
Response.Write xmlhttp.StatusText
End if
Set xmlDOC = nothing
Set xmlhttp = Nothing
%>
'response.ContentType = "text/html"
'Response.Charset = "utf-8"
url = "http://172.17.99.94:8080/rishis/services/QueryService"
soapUserName = "ris"
soapPassWord = "tzyyage542"
SoaPRequest="<?xml version="&CHR(34)&"1.0"&CHR(34)&" encoding="&CHR(34)&"gbk"&CHR(34)&"?>"& _
"<soap:Envelope xmlns:xsi="&CHR(34)&"http://www.w3.org/2001/XMLSchema-instance"&CHR(34)&" "& _
"xmlns:xsd="&CHR(34)&"http://www.w3.org/2001/XMLSchema"&CHR(34)&" "& _
"xmlns:soap="&CHR(34)&"http://schemas.xmlsoap.org/soap/envelope/"&CHR(34)&">"& _
"<soap:Header>"& _
"<AuthenticationToken xmlns="&CHR(34)&"http://spring.com"&CHR(34)&">"&_
"<Username>"& soapUserName &_
"</Username>"&_
"<Password>" & soapPassword &_
"</Password>"&_
"</AuthenticationToken>"&_
"</soap:Header>"& _
"<soap:Body>"& _
"<GetYjSqd_All xmlns="&CHR(34)&"http://spring.com"&CHR(34)&">"& _
"<in0>1</in0>"& _
"<in1>2007-06-01 00:00:00</in1>"& _
"<in2>2007-06-06 00:00:00</in2>"& _
"</GetYjSqd_All>"& _
"</soap:Body>"& _
"</soap:Envelope>"
Set xmlhttp = server.CreateObject("Msxml2.XMLHTTP")
xmlhttp.Open "POST",url,false
xmlhttp.setRequestHeader "Content-Type", "text/xml;charset=gbk"
xmlhttp.setRequestHeader "HOST","172.17.99.94:8080"
xmlhttp.setRequestHeader "Content-Length",LEN(SoapRequest)
xmlhttp.setRequestHeader "SOAPAction", "http://spring.com/GetYjSqd_All"
xmlhttp.Send(SoapRequest)
If xmlhttp.Status = 200 Then
Set xmlDOC =server.CreateObject("MSXML.DOMDocument")
Response.write xmlhttp.getResponseHeader("Content-Type")
xmlDOC.load(xmlhttp.responseXML)
xmlDOC.save("C:\1.xml")
Else
Response.Write xmlhttp.Status&" "
Response.Write xmlhttp.StatusText
End if
Set xmlDOC = nothing
Set xmlhttp = Nothing
%>
- ››asp.net页面弄成伪静态页面
- ››Asp.net 中将汉字转换成拼音的方法
- ››ASP.NET及JS中的cookie基本用法
- ››ASP.NET获取MS SQL Server安装实例
- ››asp.net实现调用百度pai 在线翻译英文转中文
- ››ASP.NET页面选项进行提示判断
- ››Asp.net定时执行程序
- ››ASP.NET中利用DataList实现图片无缝滚动
- ››ASP.NET验证控件RequiredFieldValidator
- ››ASP.NET中使用System.Net.Mail发邮件
- ››ASP.NET中获取用户控件中控件的ID
- ››ASP.NET中FileBytes写成文件并存档
更多精彩
赞助商链接