我希望這有助於...
Dim strSoap, strSOAPAction As String
Dim strURL As String ' WEB SERVICE URL
Dim DataToSend as String
strSoap = "<?xml version=""1.0"" encoding=""utf-8""?><s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
"<s:Body>" & _
"<YOURMethodName xmlns=""http://tempuri.org/"">" & _
"<YOURMethodParameterName>DataToSend</YOURMethodParameterName>" & _
"</YOURMethodName>" & _
"</s:Body></s:Envelope>"
'REPLACE WITH YOUR DATA
strSOAPAction = "http://tempuri.org/YOURContractName/YOURMethodName" ' REPLACE HERE
Dim xmlhttp As MSXML2.XMLHTTP30
Set xmlhttp = New MSXML2.XMLHTTP30
xmlhttp.open "POST", strURL, False 'HERE YOU OPEN THE CONECTION WITH THE WebService
xmlhttp.setRequestHeader "Man", "POST " & strURL & " HTTP/1.1" ' DEFINE THE COMUNICATION TYPE
xmlhttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8" 'DEFINE CONTENT TYPE
xmlhttp.setRequestHeader "SOAPAction", strSOAPAction ' ASSOCIATE THE SOAP ACTION
DoEvents
Call xmlhttp.send(strSoap) ' SEND THE REQUEST
DoEvents
If xmlhttp.Status = 200 Then
' IT WORKED
Else
'ERROR
End If
可能重複[如何調用WCF服務並將其配置中使用VB6(http://stackoverflow.com/questions/ 14720704/how-to-call-wcf-service-and-set-its-configuration-using-vb6) – 2014-09-02 13:01:52
This [鏈接](http://www.drdobbs.com/web-development/integrating-xml-web-services-with-vb6-ap/184405550)可能有幫助 – 2014-09-02 13:03:39