正在阅读:在VB6或ASP中调用webservice在VB6或ASP中调用webservice

2004-05-25 15:17 出处:CSDN 作者:guoyan19811021 责任编辑:linjixiong


'初始化http对象

Set h = New MSXML2.ServerXMLHTTP40

'向指定的URL发送Post消息

h.open "POST", "http://localhost/TestWebService/Service1.asmx", False

h.setRequestHeader "Content-Type", "text/xml"

h.send (strxml)

While h.readyState <> 4

Wend

'显示返回的XML信息

Text1.Text = h.responseText

'将返回的XML信息解析并且显示返回值

Set x = New MSXML2.DOMDocument40

x.loadXML Text1.Text

Text1.Text = x.childNodes(1).Text


         我们在TEXTBOX中输入“中国”,再点击BUTTON,于是就可以在下边的TEXTBOX中显示“Hello World, 中国” 。显示如图:





察看评论详细内容 我要发表评论
作者笔名简短内容 发表时间
:
键盘也能翻页,试试“← →”键

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品