Question: I have a class that is called MyMethodQuery that contains a property of entry of my web method

```
[DataContract()]
public class MyMethodQuery
{
    [DataMember(IsRequired = true)]
    [StringLength(100, MinimumLength = 10)]
    public string Id{ get; set; }
}

```

My Web Method :

```
public string MyMethod(MyMethodQuery MyMethodQuery)
{
   return "it's ok !";
} 

```

I want to throw an exception if I leave the empty property. But it doesn't work in spite of the attribute `StringLength`.

I test my method with SoapUI.

Answer: 
Is your browser making an OPTIONS request before POSTing?
check the NET tab
I've had issues before where an OPTIONS request was being made by the browser or Angular (don't know which) and the server did not have ...

"Access-Control-Allow-Methods": "GET, POST", "PUT", "DELETE", "OPTIONS";
Not sure if you already have the information you need. But in my local web-server - when I make an http request using postman here is what it adds to the header:

headers:
 { host: 'localhost',
 connection: 'keep-alive',
 pragma: 'no-cache',
 'cache-control': 'no-cache',
 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36',
 accept: '*/*',
 referer: '<http://localhost/>',
 'accept-encoding': 'gzip, deflate, sdch',
 'accept-language': 'en-US,en;q=0.8' },

And here is what I see in the rawHeaders:
 [ 'Host',
 'localhost',
 'Connection',
 'keep-alive',
 'Pragma',
 'no-cache',
 'Cache-Control',
 'no-cache',
 'User-Agent',
 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36',
 'Accept',
 '*/*',
 'Referer',
 '<http://localhost/>',
 'Accept-Encoding',
 'gzip, deflate, sdch',
 'Accept-Language',
 'en-US,en;q=0.8' ],

So perhaps you just need to fake your client to be a recognized browser client.