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

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


Dim strxml As String

Dim str As String

str = Text2.Text

'定义soap消息

strxml = "<?xml version='1.0' encoding='utf-8'?><soap:Envelope

xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'

xmlns:xsd='http://www.w3.org/2001/XMLSchema'

xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'><soap:Body><getString xmlns='http://tempuri.org/TestWebService/Service1'><str>" & str &

"</str></getString></soap:Body></soap:Envelope>"



'定义一个http对象,一边向服务器发送post消息

Dim h As MSXML2.ServerXMLHTTP40

'定义一个XML的文档对象,将手写的或者接受的XML内容转换成XML对象

Dim x As MSXML2.DOMDocument40

 '初始化XML对象

Set x = New MSXML2.DOMDocument40

'将手写的SOAP字符串转换为XML对象

x.loadXML strxml





察看评论详细内容 我要发表评论
作者笔名简短内容 发表时间
:

键盘也能翻页,试试“← →”键

相关文章

关注我们

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