V
Vince Sefcik
I have several web services that I use as the source/sink of the main
query/submit form. I recently updated the web services to add a lot of
error checking and I return errors from them as SOAP Exceptions. Since I
wanted to catch these exceptions in the Infopath script, I installed the
Infopath 2003 Toolkit for Visual Studio .Net and wrote my query in a
Try/Catch block in VB.Net. When I tried to "Catch ex as SOAPException", I
kept getting an unhandled exception error from Infopath, so I rewrote the
code to catch anytype of exception and print out some of the properties.
The display says that the Exception Type is a COMException, not a
SOAPException. Is this by design, or a bug?
Here's the code:
Dim wsAdapter2 As WebServiceAdapter2
wsAdapter2 = thisXDocument.DataAdapters(0)
' Perform the query.
Try
wsAdapter2.Query()
Catch ex As Exception
thisXDocument.UI.Alert("Exception Caught" & vbCrLf & _
"Exception Type: " & ex.GetType.Name & vbCrLf & _
"Exception Message: " & ex.Message & vbCrLf & _
"Exception Source: " & ex.Source.ToString)
End Try
query/submit form. I recently updated the web services to add a lot of
error checking and I return errors from them as SOAP Exceptions. Since I
wanted to catch these exceptions in the Infopath script, I installed the
Infopath 2003 Toolkit for Visual Studio .Net and wrote my query in a
Try/Catch block in VB.Net. When I tried to "Catch ex as SOAPException", I
kept getting an unhandled exception error from Infopath, so I rewrote the
code to catch anytype of exception and print out some of the properties.
The display says that the Exception Type is a COMException, not a
SOAPException. Is this by design, or a bug?
Here's the code:
Dim wsAdapter2 As WebServiceAdapter2
wsAdapter2 = thisXDocument.DataAdapters(0)
' Perform the query.
Try
wsAdapter2.Query()
Catch ex As Exception
thisXDocument.UI.Alert("Exception Caught" & vbCrLf & _
"Exception Type: " & ex.GetType.Name & vbCrLf & _
"Exception Message: " & ex.Message & vbCrLf & _
"Exception Source: " & ex.Source.ToString)
End Try