Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys, i have the next question.
if i have a method in a Web Service and this method need 1 parameter, but the person who is callin my web service not pass the parameter correctly. how can i validate that parameter before the function take it this if is missing or the datatype is in incorrect formtat? there´s a way to prevent this?
here put an example

VB
Dim sResult As DataSet
result = WebService.GetInformation("") ''Here should go the parameter, but assuming that the client is not assigned it

The Next code below is the web service.
VB
Public Function GetInformation(ByVal CodSeguridad As Integer) As DataSet ''here trow me an Error of dataTpye or if the parameter is missing


thanks in advance.
Posted

1 solution

There is no in built support for this, but wthese two articles might give you a direction:

http://msdn.microsoft.com/en-gb/magazine/cc164115.aspx[^]

http://msdn.microsoft.com/en-gb/magazine/cc164100.aspx[^]
 
Share this answer
 
Comments
Rene Bustos 29-Jul-11 9:39am    
Manas. thanks for the answer. I hope stay in this site for a long time.

thanks i gona give you accepted solution, the links posted are very good.

see you later.From Mexico.
Manas Bhardwaj 29-Jul-11 9:43am    
glad, it helped you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900