I have a soap interface with a boolean function, this function is supposed to return true if everything is succesfully, and false if something goes wrong.
How is it possible to return false + errormessage on a boolean function ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As your interface assumes to return only bool result you can’t return additional string.
If it is suitable in your case then you can generate Exception with specified message on server side rather than just return
false.In that case SOAP fault is returned by the server as response. SOAP fault contains Exception message. So client knows that request is processed with error and client is able to read error message.
That is standard behavior.
You can find more details here.