Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > RegEx validation using attibutes

Thread Tools

RegEx validation using attibutes

Steve James
Posts: n/a
Is there a way to use a regular expression to validate a string in an
object/soap message passed to a web service without performing a full
schema validation? What I would like to do is something like:

public class WebServiceRequest

private string _aString;

[RegexValidation( Pattern="<Regular Expression goes here>")]
public string AString
get{ return _aString; }
set{ _aString = value; }

Does such an attribute or other construct exist which causes the
property to be validated against a regular expression by the web
service infrastructure automatically when the soap request is


Reply With Quote
Steve James
Posts: n/a
The [RegexValidation( Pattern="<Regular Expression goes here>")]
attribute doesn't exist - I made it up. I probably didn't make it clear
in my original post, but this is the type of construct I would like to
use if there is one. Just as you can control Xml serialization and
deserialization with attributes such as XmlIgnore and XmlElement I
thought there may be something similar to match a property against a
regular expression.


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How make regex that means "contains regex#1 but NOT regex#2" ?? Python 3 07-01-2008 03:06 PM
Simple Validation Problem Using Regex Phillip Vong ASP .Net 2 10-04-2006 12:04 PM
Using both server side validation and client side validation =?Utf-8?B?dmlkeWE=?= ASP .Net 1 06-02-2005 09:45 PM
Using Summary Validation control with server Custom validation =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?= ASP .Net 2 10-15-2004 06:15 PM
Making my own attibutes for HTML Tags RIck Measham Javascript 1 09-16-2003 12:36 AM