鍒╃敤ASP鍙戦佸拰鎺ユ敹XML鏁版嵁鐨勫鐞嗘柟娉
鍙戝竷: 2008-6-27 11:51 | 浣滆: admin | 鏌ョ湅: 9娆
銆銆鍥犱负瑕佸仛绉诲姩姊︾綉WAP鐨勪竴浜涙帴鍙o紝鎵浠ヨ鐢ㄥ埌杩欑鏂瑰紡锛屾帴涓嬫潵浼氭湁ASP.net鐗堟湰鐨勶紝杩欎釜鏄疉SP鐗堟湰鐨勶紝鍒╃敤浜哅SXML2.XMLHTTP瀵瑰儚銆
銆銆 request.asp
dim Https
set Https=server.createobject("MSXML2.XMLHTTP")
'瀹氫箟涓涓猉MLHTTP瀵瑰儚
Https.open "POST","http://127.0.0.1/testpost/response.asp",false
Https.send "
if Https.readystate=4 then
銆response.write "鎻愪氦鎴愬姛"
銆'readstate璇诲彇鐘舵佷负4鍒欐垚鍔燂紝缁х画鍚庨潰鐨勶紝涓嶆垚鍔熷綋鐒跺氨涓嶇敤缁х画澶勭悊浜
銆dim objstream
銆set objstream = Server.CreateObject("adodb.stream")
銆'瀹氫箟涓涓猻tream锛屽洜涓鸿杩囨潵鐨勭洿鎺ユ嬁鍑烘潵鏄贡鐮佺殑锛屾墍浠ュ緱澶勭悊涓涓
銆objstream.Type = 1
銆objstream.Mode =3
銆objstream.Open
銆objstream.Write Https.responseBody
銆objstream.Position = 0
銆objstream.Type = 2
銆objstream.Charset = "GB2312"
銆html = objstream.ReadText
銆'杞ソ鐮侊紝灏辨斁鍒癶tml閲岋紝濂藉叧闂繖浜涘鍍
銆objstream.Close
銆set objstream = nothing
銆set https=nothing
end if
response.write html
response.asp
'鍒涘缓DOMDocument瀵硅薄
Set xml = Server.CreateObject ("msxml2.DOMDocument")
xml.async = False
'瑁呰浇POST鏁版嵁
xml.Load Request
If xml.parseError.errorCode <> 0 Then
銆response.write "涓嶈兘姝g‘鎺ユ敹鏁版嵁" & "Description: " & xml.parseError.reason & "锛渂r锛濴ine: " & xml.parseError.Line
End If
set blogchild=xml.getElementsByTagName("misc_command")
'the_text=blogchild.item(0).childnodes(1).text
'the_text=blogchild.item(0).text
'for i=0 to blogchild.length-1
response.write the_text
銆銆鍒╃敤杩欑鏂规硶锛孉SP閲岃皟鐢⊿ervlet鎴朩eb Service閮芥槸寰堣交鏉剧殑锛




发表于 2009-1-5 19:48
| 











