Specifying correct XSD in WSDL

P

peter.moss

I wondered if anyone can help.

I have a web service which has a method similar to the following:
DoSomething(MyObject)

The MyObject was generated from a schema using XSD.EXE. The schema has
a lot of specific information about MyObject (basic validation, string
lengths etc.). The problem is when I look at the WSDL the schema
information is not present.
When I look at the class XSD has generated I can indeed see there is no
attribute to specify what the schema should be, however I can't seem
to find out how to specify the schema for the class.

So basically, how do I tell .NET to output my schema in the WSDL and
not the one based on the class metadata?

Thanks in advance.
 
P

peter.moss

To add extra questions to this message I have recently discovered,
whilst searching for the solution to the above, that it wouldn't
matter a damn even if I had a correct schema. Why? Because the .NET
framework offers no facilities for validating incoming requests against
the schema (makes you wonder what the whole point of having a schema is
if MS choose to ignore it anyway).

My research pulls up the following article
(http://msdn.microsoft.com/msdnmag/issues/03/07/xmlschemavalidation/default.aspx)
published, on MSDN in 2003 (3 years ago). To quote Microsoft on this
lack of validation:
"WebMethods do not fully validate the messages they process against
the implied schema. As a result, it's possible for a given WebMethod
invocation to produce a false positive (a successful response with an
incorrect or unintended result) when an exception would have been
expected."
The article on MSDN goes on to highlight the potential issues this
causes. Again, to quote Microsoft:
"The lack of validation support complicates the error handling that
must be built into each WebMethod."
"...within the WebMethod infrastructure, there are... problems...
it's not possible to get your hands on the underlying XmlSerializer"
"These situations, and many others, cause WebMethods to produce false
positives... it could be catastrophic and is therefore completely
unacceptable."

To conclude, MS clearly and strongly admit that this is completely
unacceptable and potentially disastrous (especially if you presume that
validation _IS_ occurring).

Bearing this in mind have MS made any attempt to fix this
"catastrophic and... completely unacceptable" lack of validation
which will "cause WebMethods to produce false positives"? After
all, they've had over two years of development on .NET 2.0 since
they've acknowledged this issue.

Can anyone offer any help on both the issues (specifying the correct
schema for the WSDL) and also validating the request against it mainly
because I am writing an application where MS are quite right in
concluding that the result would "be catastrophic" and "is
therefore completely unacceptable.".
 

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,744
Messages
2,569,479
Members
44,900
Latest member
Nell636132

Latest Threads

Top