社区
网络编程
帖子详情
VB6如何向Webservice发送xml?
CPlusMan
2007-10-31 07:29:54
我已经安装了SOAP包,在VB中可以引用。现在需要将一xml发送到已知地址的webservice,如何实现?
以前没做过这个,望达人指点。简单几行代码最好了,谢谢!
...全文
199
6
打赏
收藏
VB6如何向Webservice发送xml?
我已经安装了SOAP包,在VB中可以引用。现在需要将一xml发送到已知地址的webservice,如何实现? 以前没做过这个,望达人指点。简单几行代码最好了,谢谢!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
samzheng99
2009-02-09
打赏
举报
回复
[Quote=引用 5 楼 winehero 的回复:]
首先工程引用MSXML库。将你的XML加上SOAP Envelope等,使用ServerXMLHTTP40的Send就行了。大致如下:
dim strXMLString As String '你的XML字串
dim strWebserviceURL as String 'WEBServic的URL
......
strSOAPMsg = " <?xml version='1.0' encoding='utf-8'?>"
strSOAPMsg = strSOAPMsg & " <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/' "
strSOA…
[/Quote]
GOOD
winehero
2007-11-12
打赏
举报
回复
首先工程引用MSXML库。将你的XML加上SOAP Envelope等,使用ServerXMLHTTP40的Send就行了。大致如下:
dim strXMLString As String '你的XML字串
dim strWebserviceURL as String 'WEBServic的URL
......
strSOAPMsg = "<?xml version='1.0' encoding='utf-8'?>"
strSOAPMsg = strSOAPMsg & "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/' "
strSOAPMsg = strSOAPMsg & "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' "
strSOAPMsg = strSOAPMsg & "xmlns:soapenc = 'http://schemas.xmlsoap.org/soap/encoding/' "
strSOAPMsg = strSOAPMsg & "xmlns:xsd='http://www.w3.org/2001/XMLSchema'>"
strSOAPMsg = strSOAPMsg & "<env:Body env:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>"
strSOAPMsg = strSOAPMsg & "<m:writeErrorInfo xmlns:m='http://webService.northking.net'>"
strSOAPMsg = strSOAPMsg & "<string xsi:type='xsd:string'>" & strXMLString & "</string>"
strSOAPMsg = strSOAPMsg & "</m:writeErrorInfo>"
strSOAPMsg = strSOAPMsg & "</env:Body>"
strSOAPMsg = strSOAPMsg & "</env:Envelope>"
With oXMLHttp
.open "POST", strWebserviceURL, False
.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
.setRequestHeader "Content-Length", Len(strSOAPMsg)
.setRequestHeader "SOAPAction", "writeErrorInfo" '"hk/GetBeta3"
.send strSOAPMsg
While .readyState <> 4
Wend
Debug.Print .responseText
End With
CPlusMan
2007-11-01
打赏
举报
回复
多谢楼上大虾答复,我现在问题是已知XML文件内容及WebService,如何将XML发送到WebService,如:
dim strXML as string, strWebServiceURL as string
strWebServiceURL="http://128.96.191.32/webapp/DataGetherService"
strXML="<?xml version="1.0" encoding="GBK"?>" & ....
现在是如何将strXML发送到WEBService上?第一次使用,不知道怎么处理,多谢!
supergreenbean
2007-11-01
打赏
举报
回复
obj.MSSoapInit "http://localhost/MyService.asmx?wsdl"
ret = obj.MyMethod()
supergreenbean
2007-11-01
打赏
举报
回复
dim obj as new SoapClient
obj.MSSoapInit "http://128.96.191.32/webapp/DataGetherService"
ret = obj.你的方法()
CPlusMan
2007-10-31
打赏
举报
回复
有人帮忙吗?多谢了。。。
vb.net写的
webservice
.docx
vb.net写的
webservice
接口,对端
发送
string形式的
XML
文件后,本程序进行相应的数据提取存储到数据库后,返回一个
XML
VB6
读写其他应用程序文本框的例子
VB6
调用WINAPI读写其他应用程序文本框内容,包含了一些访问数据库,调用
webservice
,读写
XML
文档,读写EXCEL文档的代码。
XML
从入门到精通(备java基础,javaee框架
webservice
必经之路)
XML
指可扩展标记语言
XML
被设计用来传输和存储数据。 在我们的
XML
教程中,你将了解什么是
XML
,以及
XML
与 HTML 之间的差异。
XML
很重要,也很容易学习。
vb6
常用功能性源码
我已调试过的功能,包括读写INI文件,连接数据库,读写
XML
文件,变长数组及访问
Webservice
.
利用wsdl.exe生成
webservice
代理类
利用wsdl.exe生成
webservice
代理类: 根据提供的wsdl生成
webservice
代理类 1、开始->程序->Visual Studio 2005 命令提示 2、输入如下红色标记部分 D:\Program Files\Microsoft Visual Studio 8\VC>wsdl /...
网络编程
1,502
社区成员
18,437
社区内容
发帖
与我相关
我的任务
网络编程
VB 网络编程
复制链接
扫一扫
分享
社区描述
VB 网络编程
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章