W
Worsty
Working with MS Access 2003 - using Web Service Toolkit to connect to web
service. Never done this particular thing before, but wanted to know what I
needed to add to my project vba to invoke the wsdl (code attached).
Thanks in advance
Option Compare Database
'*****************************************************************
'This class was created by the Microsoft Office 2003 Web Services Toolkit.
'
'Created: 8/23/2006 10:33:12 AM
'
'Description:
'This class is a Visual Basic for Applications class representation of the
Web service
'as defined by
http://cvgli0502.td.afg:4400/sst/runtime.asvc/com.actional.soapstation.SHSQuoteProcess?WSDL.
'
'To Use:
'Dimension a variable as new clsws_Service0, and then write code to
'use the methods provided by the class.
'Example:
' Dim ExampleVar as New clsws_Service0
' debug.print ExampleVar.wsm_Invoke("Sample Input")
'
'For more information, see Complex Types in Microsoft Office 2003
'Web Services Toolkit Help.
'
'Changes to the code in this class may result in incorrect behavior.
'
'*****************************************************************
'Dimensioning private class variables.
Private sc_Service0 As SoapClient30
Private Const c_WSDL_URL As String =
"http://cvgli0502.td.afg:4400/sst/runtime.asvc/com.actional.soapstation.SHSQuoteProcess?WSDL"
Private Const c_SERVICE As String = "Service_0"
Private Const c_PORT As String = "Port_Service_0"
Private Const c_SERVICE_NAMESPACE As String = "http://abc.org/abc"
Private Sub Class_Initialize()
'*****************************************************************
'This subroutine will be called each time the class is instantiated.
'Creates sc_ComplexTypes as new SoapClient30, and then
'initializes sc_ComplexTypes.mssoapinit2 with WSDL file found in
'http://cvgli0502.td.afg:4400/sst/runtime.asvc/com.actional.soapstation.SHSQuoteProcess?WSDL.
'*****************************************************************
Dim str_WSML As String
str_WSML = ""
Set sc_Service0 = New SoapClient30
sc_Service0.MSSoapInit2 c_WSDL_URL, str_WSML, c_SERVICE, c_PORT,
c_SERVICE_NAMESPACE
'Use the proxy server defined in Internet Explorer's LAN settings by
'setting ProxyServer to <CURRENT_USER>
sc_Service0.ConnectorProperty("ProxyServer") = "<CURRENT_USER>"
'Autodetect proxy settings if Internet Explorer is set to autodetect
'by setting EnableAutoProxy to True
sc_Service0.ConnectorProperty("EnableAutoProxy") = True
End Sub
Private Sub Class_Terminate()
'*****************************************************************
'This subroutine will be called each time the class is destructed.
'Sets sc_ComplexTypes to Nothing.
'*****************************************************************
'Error Trap
On Error GoTo Class_TerminateTrap
Set sc_Service0 = Nothing
Exit Sub
Class_TerminateTrap:
Service0ErrorHandler ("Class_Terminate")
End Sub
Private Sub Service0ErrorHandler(str_Function As String)
'*****************************************************************
'This subroutine is the class error handler. It can be called from any
class subroutine or function
'when that subroutine or function encounters an error. Then, it will
raise the error along with the
'name of the calling subroutine or function.
'*****************************************************************
'SOAP Error
If sc_Service0.FaultCode <> "" Then
Err.Raise vbObjectError, str_Function, sc_Service0.FaultString
'Non SOAP Error
Else
Err.Raise Err.Number, str_Function, Err.Description
End If
End Sub
Public Function wsm_Invoke(ByVal vnt_SHSQuoteDataReadReq As Variant) As
Variant
'*****************************************************************
'Proxy function created from
http://cvgli0502.td.afg:4400/sst/runtime.asvc/com.actional.soapstation.SHSQuoteProcess?WSDL.
'*****************************************************************
'Error Trap
On Error GoTo wsm_InvokeTrap
wsm_Invoke = sc_Service0.Invoke(vnt_SHSQuoteDataReadReq)
Exit Function
wsm_InvokeTrap:
Service0ErrorHandler "wsm_Invoke"
End Function
service. Never done this particular thing before, but wanted to know what I
needed to add to my project vba to invoke the wsdl (code attached).
Thanks in advance
Option Compare Database
'*****************************************************************
'This class was created by the Microsoft Office 2003 Web Services Toolkit.
'
'Created: 8/23/2006 10:33:12 AM
'
'Description:
'This class is a Visual Basic for Applications class representation of the
Web service
'as defined by
http://cvgli0502.td.afg:4400/sst/runtime.asvc/com.actional.soapstation.SHSQuoteProcess?WSDL.
'
'To Use:
'Dimension a variable as new clsws_Service0, and then write code to
'use the methods provided by the class.
'Example:
' Dim ExampleVar as New clsws_Service0
' debug.print ExampleVar.wsm_Invoke("Sample Input")
'
'For more information, see Complex Types in Microsoft Office 2003
'Web Services Toolkit Help.
'
'Changes to the code in this class may result in incorrect behavior.
'
'*****************************************************************
'Dimensioning private class variables.
Private sc_Service0 As SoapClient30
Private Const c_WSDL_URL As String =
"http://cvgli0502.td.afg:4400/sst/runtime.asvc/com.actional.soapstation.SHSQuoteProcess?WSDL"
Private Const c_SERVICE As String = "Service_0"
Private Const c_PORT As String = "Port_Service_0"
Private Const c_SERVICE_NAMESPACE As String = "http://abc.org/abc"
Private Sub Class_Initialize()
'*****************************************************************
'This subroutine will be called each time the class is instantiated.
'Creates sc_ComplexTypes as new SoapClient30, and then
'initializes sc_ComplexTypes.mssoapinit2 with WSDL file found in
'http://cvgli0502.td.afg:4400/sst/runtime.asvc/com.actional.soapstation.SHSQuoteProcess?WSDL.
'*****************************************************************
Dim str_WSML As String
str_WSML = ""
Set sc_Service0 = New SoapClient30
sc_Service0.MSSoapInit2 c_WSDL_URL, str_WSML, c_SERVICE, c_PORT,
c_SERVICE_NAMESPACE
'Use the proxy server defined in Internet Explorer's LAN settings by
'setting ProxyServer to <CURRENT_USER>
sc_Service0.ConnectorProperty("ProxyServer") = "<CURRENT_USER>"
'Autodetect proxy settings if Internet Explorer is set to autodetect
'by setting EnableAutoProxy to True
sc_Service0.ConnectorProperty("EnableAutoProxy") = True
End Sub
Private Sub Class_Terminate()
'*****************************************************************
'This subroutine will be called each time the class is destructed.
'Sets sc_ComplexTypes to Nothing.
'*****************************************************************
'Error Trap
On Error GoTo Class_TerminateTrap
Set sc_Service0 = Nothing
Exit Sub
Class_TerminateTrap:
Service0ErrorHandler ("Class_Terminate")
End Sub
Private Sub Service0ErrorHandler(str_Function As String)
'*****************************************************************
'This subroutine is the class error handler. It can be called from any
class subroutine or function
'when that subroutine or function encounters an error. Then, it will
raise the error along with the
'name of the calling subroutine or function.
'*****************************************************************
'SOAP Error
If sc_Service0.FaultCode <> "" Then
Err.Raise vbObjectError, str_Function, sc_Service0.FaultString
'Non SOAP Error
Else
Err.Raise Err.Number, str_Function, Err.Description
End If
End Sub
Public Function wsm_Invoke(ByVal vnt_SHSQuoteDataReadReq As Variant) As
Variant
'*****************************************************************
'Proxy function created from
http://cvgli0502.td.afg:4400/sst/runtime.asvc/com.actional.soapstation.SHSQuoteProcess?WSDL.
'*****************************************************************
'Error Trap
On Error GoTo wsm_InvokeTrap
wsm_Invoke = sc_Service0.Invoke(vnt_SHSQuoteDataReadReq)
Exit Function
wsm_InvokeTrap:
Service0ErrorHandler "wsm_Invoke"
End Function