Try OpenEdge Now
skip to main content
Web Services
Developing a .NET Client to Consume OpenEdge SOAP Web Services : Developing the VB.NET client application : Handling errors on the client
 

Handling errors on the client

To handle a SOAP fault in a VB.NET client, catch the SoapException and parse it, as shown:
Try
   ' Code to access the Web service
   ...
   Catch soapEx As System.Web.Services.Protocols.SoapException
      Dim detail As String, reqId As String
         detail = parseSoapException(soapEx.Detail, reqId)
         MsgBox(detail, MsgBoxStyle.Critical, soapEx.Message)
End Try
Caution: In any catch block where you exit the program, you must release all Web service objects you created in the program.
The parseSoapException( ) method in this example is a client function provided in the .NET samples installed with OpenEdge. It parses the detail error information from the SOAP fault message.
You can also use the Microsoft SOAP Toolkit to assist in debugging SOAP fault messages. For more information, see Testing and Debugging OpenEdge SOAP Web Services.