RegEx validation using attibutes

Discussion in 'ASP .Net Web Services' started by Steve James, May 17, 2006.

  1. Steve James

    Steve James Guest

    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
    deserialized?

    Steve
     
    Steve James, May 17, 2006
    #1
    1. Advertising

  2. Steve James

    Steve James Guest

    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.

    Steve
     
    Steve James, May 18, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=

    Using Summary Validation control with server Custom validation

    =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=, Oct 15, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    895
    =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=
    Oct 15, 2004
  2. =?Utf-8?B?dmlkeWE=?=
    Replies:
    1
    Views:
    769
    Kevin Spencer
    Jun 2, 2005
  3. Phillip Vong

    Simple Validation Problem Using Regex

    Phillip Vong, Oct 4, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    392
    Phillip Vong
    Oct 4, 2006
  4. Replies:
    3
    Views:
    807
    Reedick, Andrew
    Jul 1, 2008
  5. RIck Measham

    Making my own attibutes for HTML Tags

    RIck Measham, Sep 16, 2003, in forum: Javascript
    Replies:
    1
    Views:
    86
    Lasse Reichstein Nielsen
    Sep 16, 2003
Loading...

Share This Page