Hello,
I have written a small web service and a client to consume it.
I am intentionally throwing a soap exception so i can see if it is working. In my client application it sees it as an exception and not a soap exception.Here is the code for the client program.
Imports System.Web.Services.Protocols
Imports System.Web.Services.Protocols.SoapException
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim emp As New ricks.Employee
Dim binding As New ricks.StructService1SoapClient
Try
emp = binding.GetEmployee()
Catch ex As SoapException
MessageBox.Show(ex.Message)
MessageBox.Show(ex.Code.ToString)
Catch et As Exception
MessageBox.Show(et.Message)
End Try
txtName.Text = emp.Name
txtAge.Text = emp.age
txtSSN.Text = emp.SSN
txtHDate.Text = emp.HDate.ToString()
End Sub
End Class
Thanks for any help,
Rick
I have written a small web service and a client to consume it.
I am intentionally throwing a soap exception so i can see if it is working. In my client application it sees it as an exception and not a soap exception.Here is the code for the client program.
Imports System.Web.Services.Protocols
Imports System.Web.Services.Protocols.SoapException
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim emp As New ricks.Employee
Dim binding As New ricks.StructService1SoapClient
Try
emp = binding.GetEmployee()
Catch ex As SoapException
MessageBox.Show(ex.Message)
MessageBox.Show(ex.Code.ToString)
Catch et As Exception
MessageBox.Show(et.Message)
End Try
txtName.Text = emp.Name
txtAge.Text = emp.age
txtSSN.Text = emp.SSN
txtHDate.Text = emp.HDate.ToString()
End Sub
End Class
Thanks for any help,
Rick