views:

640

answers:

4

I have XML files in a directory that I wish to get over to a webservice on a server that will validate them and return a true/false as to whether they are valid in construct and values etc. Reason for server side processing is that the validation rules may change from time to time and need to adjust in one place as opposed to all client machines.

What would be the best mechanism to do this?

At the moment am wondering if passing the XMLDocument object from the client to the webservice as a parameter may be the way to go?

Am using .net 3 for this in C#

A: 

Wouldn't a normal string be enough? It's overkill to serialize / deserialize an entire XDoc instance in my opinion. Of course, you can also zip the entire thing to reduce the size of the requests.

kokos
+2  A: 

You might consider using something like a WCF service and streaming the xml up using the GZipStream. I am doing something similar to this and it is working pretty well.

Brian Genisio
hadnt thought about the GZipstream but the files are quite small in size and so may not be worth the overhead. CHeers for the suggestion though.
anonym0use
A: 

Cheers for the suggestions guys!

anonym0use
A: 

Depending on your validation rules, it might be more sensible to encapsulate them in something like an XML schema hosted on a public URL.

That way, clients can validate against the schema in one line of code, rather than having to connect to a web service.

Ciaran McNulty
Do you have any sample code on this? Am not too clued up on XML and validation.
anonym0use