Hello, i'm new to web services. I'm trying to display the error message from the Web Service to the textbox in my Form1.
Script on my button that calls the web service. (I have no issues on doing the edit thing, i have issues on retrieving the error message on my web service):
If Not objWebServiceTest.editAccount(myObject, txtID.text) Then
txtErrMsg.Text = objWebServiceTest.ReturnMessage
Exit Sub
End If
Script on my web service (ASMX file):
Public Function ReturnMessage() As String
Return strMsg
End Function
<WebMethod()> _
Public Function editAccount(ByVal myObject As Accounts, ByVal accountID As String) As Boolean
Dim leditAccounts As Boolean = False
Try
leditNibs = "Assigning string to boolean to cause an error"
*****Remove the scripts here******
*****Remove the scripts here******
*****Remove the scripts here******
Catch ex As Exception
strMsg = ex.Message
End Try
Return leditAccounts
End Function
*****************************************
And when i query on the immediate window, i got this. I wanted to display that error message on my textbox in my winform.
?strMsg
"Conversion from string "test lang" to type 'Boolean' is not valid."
Once i click the button on my form, objWebServiceTest.ReturnMessage just returns a blank string. How do i get the value of the error message from my web service and display in on my textbox?
Script on my button that calls the web service. (I have no issues on doing the edit thing, i have issues on retrieving the error message on my web service):
If Not objWebServiceTest.editAccount(myObject, txtID.text) Then
txtErrMsg.Text = objWebServiceTest.ReturnMessage
Exit Sub
End If
Script on my web service (ASMX file):
Public Function ReturnMessage() As String
Return strMsg
End Function
<WebMethod()> _
Public Function editAccount(ByVal myObject As Accounts, ByVal accountID As String) As Boolean
Dim leditAccounts As Boolean = False
Try
leditNibs = "Assigning string to boolean to cause an error"
*****Remove the scripts here******
*****Remove the scripts here******
*****Remove the scripts here******
Catch ex As Exception
strMsg = ex.Message
End Try
Return leditAccounts
End Function
*****************************************
And when i query on the immediate window, i got this. I wanted to display that error message on my textbox in my winform.
?strMsg
"Conversion from string "test lang" to type 'Boolean' is not valid."
Once i click the button on my form, objWebServiceTest.ReturnMessage just returns a blank string. How do i get the value of the error message from my web service and display in on my textbox?