How to do validation in client side in wcf? [Resolved]

Posted by Programmer123 under WCF on 11/21/2013 | Points: 10 | Views : 2265 | Status : [Member] | Replies : 2
How to do validation in client side in wcf.




Responses

Posted by: Allemahesh on: 11/22/2013 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
WCF doesn't deal with client-side validation, because it can't know the capabilities of the client on the other end of the service. If you want to do something like this you're either going to need to:

1. Write extra functions into your WCF service that give your clients a way to request the validation rules in some format and then implement them using some custom code.
2. Your client will need to implement its own validation logic.

See the below link:-

http://msdn.microsoft.com/en-us/library/ff647875.aspx

Programmer123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 11/22/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
If you want to have client side validation you should in the first place implement that validation on the client side - it can be done by using buddy classes for partial classes used by WCF proxy. If you want to have a maintenance nightmare and you don't want to use this way you must share assembly with your entities between your WCF client and WCF service and reuse those types when adding service reference.

Reference:
http://www.bryanavery.co.uk/post/2013/07/09/Validation-from-WCF-layer-through-to-MVC.aspx

Refer
http://stackoverflow.com/questions/6232131/how-can-i-approach-client-side-validation-with-mvc-and-wcf-without-duplicating-l

http://wcfsecurity.codeplex.com/wikipage?title=How%20To%20-%20Perform%20Message%20Validation%20with%20Schemas%20in%20WCF


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Programmer123, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response