开发者

Validating call to web service against schema before sending request

I am calling a web service (written in Java) in my web app. I use the WSDL to generate proxy classes using the wsdl.exe command line tool.

Everything is working fine开发者_如何学运维.

However, I have found out that the web service is not doing any data validation at all when they receive a request from my app. Hence, if I happen to send one minute piece of data that isn't exactly what they want, I receive a general fault error in return, with no specifics at all of what the incorrect (if any) piece of data is.

So, before I make the request, I'd like to validate my request against the schema they have provided. Is this possible, and if so, how do I go about this?

Thanks in advance


The proxy built from the wsdl already enforces whatever schema was provided unless, of course, the call takes a string parameter where you are supposed to pass xml. That would be bad design but if that's what you have to do, you can. Just use the XmlDocument object or the XmlReader to validate the XML.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜