(声明:魏滔序原创,转贴请注明出处。)
闲暇之余写了这个SOAP组件,下载试用的请回复一下。
请把你试用中遇到的问题告诉我,我完善后开源。
下载地址:http://www.chenoe.com/developer/library/soap.dll
示例代码:
Option Explicit
Private WithEvents SOAP As SOAPClient
Private Sub Command1_Click()
Dim url As String
Dim a As String, b As String, c As Integer
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
url = "http://www.chenoe.com/WebService/WS.asmx" '只为测试,本地址无效。
SOAP.Timeout = 10000
If SOAP.Initialize(url, , , 0) Then
MsgBox SOAP.CallWebService("GetProtocol", a, b, c)
End If
End Sub
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
Private Sub Form_Load()
Set SOAP = New SOAPClient
End Sub
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
Private Sub Form_Unload(Cancel As Integer)
Set SOAP = Nothing
End Sub
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
Private Sub SOAP_Error(ByVal Code As Long, ByVal Description As String, ByVal ServerResult As String)
MsgBox Description & vbCrLf & ServerResult '错误信息
End Sub
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
Private Sub SOAP_Progress(ByVal Value As Long)
Me.ProgressBar1.Value = Value '显示进度
End Sub
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)