angula Posted January 8, 2004 Posted January 8, 2004 I have a windows app which calls webservice functions on my server. If the functions runs successfully, it returns a dataset to my client app. What I want to know is how to get error messages from the webservice in the event the function does not run correctly to display in a msgbox on the client. I have something similar to below: <WebService> Public Function ReturnDataset(ByVal UserName) as Dataset ...function logic works ReturnDataset = dataset ...function logic fails ??? End Function Any thoughts? Quote
Moderators Robby Posted January 8, 2004 Moderators Posted January 8, 2004 You can 'Throw New Exception" or Return Nothing, in cassse of the latter you would always need to check for the case of the return being Nothing. Quote Visit...Bassic Software
angula Posted January 8, 2004 Author Posted January 8, 2004 I'm not following. Are you saying that the web service would like something like this: <WebService>Public Function GetClientUpdates() as dataset Try ...logic to generate dataset GetClientUpdates = dataset Catch ex as Exception Throw New Exception End Try Then my client looks like below... Public Sub GetClientUpdates() ws.BeginClientUpdatesToClient(" ", "", "", "10:45:00 07/3/00", AddressOf GetClientUpdatesCompleteInvoke, Nothing) End Sub Protected Sub GetClientUpdatesCompleteInvoke(ByVal ar As IAsyncResult) Me.Invoke(New GetClientUpdatesDelegate(AddressOf Me.GetClientUpdatesComplete), New Object() {ar}) End Sub Protected Delegate Sub GetClientUpdatesDelegate(ByVal ar As IAsyncResult) Protected Sub GetClientUpdatesComplete(ByVal ar As IAsyncResult) Try Dim dsTemp As New Mohawk.MohawkWebServices.dsItems dsTemp = ws.EndClientUpdatesToClient(ar) dsI.Merge(dsTemp) UpdateComplete = dsTemp.Items.Count Catch ex As Exception UpdateComplete = 0 End Try End Sub This is not working for me.... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.