Import Validation

J

Jim

Hi All

what would be a good method to validate data that are imported though a
webservice?\

thanks

Jim
 
D

Dan Rogers

Hi Jim

You might want to validate the incoming XML before it is marshalled
(whoops, deserialized) into the classes that are passed to your web
methods. You can do this fairly trivially by adding in a web service
extension that uses a schema collection and then uses a validating reader
to determine if the incoming XML matches the rules defined in a schema. If
there are errors found, you can write the response (directly as an XML SOAP
fault) and abort the method call.

Another place you can do the same thing is in an HTTP Filter in IIS
(typically written in C++). In a filter, you get the raw stream received
on the wire and have full control over the response/processing.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
 
J

Jim

Hi Dan
Thanks!

Dan Rogers said:
Hi Jim

You might want to validate the incoming XML before it is marshalled
(whoops, deserialized) into the classes that are passed to your web
methods. You can do this fairly trivially by adding in a web service
extension that uses a schema collection and then uses a validating reader
to determine if the incoming XML matches the rules defined in a schema. If
there are errors found, you can write the response (directly as an XML SOAP
fault) and abort the method call.

Another place you can do the same thing is in an HTTP Filter in IIS
(typically written in C++). In a filter, you get the raw stream received
on the wire and have full control over the response/processing.

I hope this helps

Dan Rogers
Microsoft Corporation
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top