Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF DataService - Cancel insert server side

We have build a simple Web Service using WCF Dataservices. This service is consumed by multiple applications.

Under some circumstances I would like to be able to inspect the inserted message on the server side, and cancel the insert if the inserted object meets specific conditions.

I found that i can inspect the insert with a QueryInterceptor, but did found no way to "Cancel" the insert.

Is it possible to cancel the insert server side, without throwing an exception?

like image 305
Richard Mosselveld Avatar asked Nov 28 '25 02:11

Richard Mosselveld


1 Answers

you may just write a DispatchMessageInspector and inspect the message received; and you may decide whether to execute it or not without throwing any exceptions.

like image 104
daryal Avatar answered Nov 30 '25 17:11

daryal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!