Does anyone know if it's possible to use a webservice with a VB6 com object, or do I have to switch to VB dotnet?
If it is possible with VB6: how?, what do I need?
You can do it - I'm not an expert but I was able to do it using the SOAP toolkit and a WSDL file.
This is a bit of the code that was used:
Public Function errSend(strApplication As String, strMethod As String, strDescription As String, nSeverity As Integer) As Boolean
' send error-message data to a remote web-service.
' [strApplication] the application where the error occurred.
' [strMethod] the method where the error occurred.
' [strDescription] description of the error.
' [nSeverity] severity of error: 0, 1, 2, 3 (critical).
' Return value:
' Boolean returned by the Request method of remote web-service.
' Remarks: sends 8 items of data to web-service: 4 are passed
' in as parameters and passed on, 3 are obtained from
' the system and 1 is a vehicle for receiving back
' any errors in the invocation of the web-service itself.
Rem variables for web-service call
Dim bReturnValue As Boolean
Dim dteNow As Date
Dim strComputerName As String
Dim strUserID As String
Dim strError As String
Rem get local system environment data
Rem get the current date and time
dteNow = Now()
Rem create a new System-Environment object
Dim oSystemEnv As New clsSystemEnv
Rem Get the hostname and user ID.
strComputerName = oSystemEnv.getComputerName()
strUserID = oSystemEnv.getUserID()
Rem Use high-level interface to MS SOAP Toolkit.
Rem Invoke service named "Service", with port-type "ServiceSoap"
Rem and using local copy of the interface-definition, "service.wsdl".
Dim oSoapClient As New MSSOAPLib.SoapClient
oSoapClient.mssoapinit "CorporateError.wsdl", "Service", "ServiceSoap", ""
Rem Call method "Request" on the web-service.
Rem Pass 4 parameters passed into this method by caller.
Rem Pass 3 items of data obtained from system.
Rem Pass strError to be filled with an error-message
Rem by the web-service itself, should it fail somehow.
bReturnValue = oSoapClient.Request(strApplication, strMethod, strDescription, nSeverity, dteNow, strComputerName, strUserID, strError)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.