Code for invoking WebService from VB6.0
txtReq.Text has complete SOAP enevlope (including SOAP body)
txtWSSchema.Text 'SOAP action URI (look WS test page for URI)
-------------------------------------------
Private Sub cmdRequest_Click()
Dim o As New MSXML2.XMLHTTP
On Error GoTo err_handler
o.open "POST", "http://localhost/MYWebServices/myws.asmx", False
o.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
o.setRequestHeader "Connection", "close"
o.setRequestHeader "SOAPAction", txtWSSchema.Text 'SOAP action URI (look WS test page for URI)
o.send txtReq.Text
txtResponseHeaders.Text = o.getAllResponseHeaders
txtResponse.Text = o.responseText
err_handler:
If Err.Number <> 0 Then MsgBox "Error " & Err.Number &amp; ": " & Err.Description
End Sub
September 04, 2004
Calling Web Service from VB6.0
at 9/04/2004
Tags: VB6 , Web Services