Does income xml request get validated against wsdl?

Hi, there:

I'm using document/literal web service. My question is: Does income xml request get validated automatically against wsdl complex type xml schema? If not is there any configuration way we can set to validate income xml request automatically?

I searched posts in this forum, it seems the same question was asked long long time ago already, but no answer. So, I want to check that question again.

I simply tested my web service by using soapUI, it seems no xml validation implemented on any request at all.

Highly appreciated if any help or comment, thanks a lot in advance.

David

[627 byte] By [weichen_davida] at [2007-11-27 11:36:58]
# 1

Not sure about your stack, but ours doesn't do it (mind we use rather old software).

In fact it works perfectly fine without any wsdl files being available at all (as do AFAIK all stacks), the wsdl being generated on the fly unless you bend over backwards to tell it to serve fixed files.

Rather the message will be attempted to be parsed into the Java (or whatever) structures defined in the service itself and a SoapFault generated when it doesn't.

And that's all you really need.

jwentinga at 2007-7-29 17:11:51 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Thank you very much jwenting for the reply. We are using jbossWs.

Yes, I definately agree that it's very cool that wsdl is generated on the fly, and all xml message is parsed to java bean automatically by jaxb. However, my 2 cents is:

1. How can I generate other xml schema restrictions in wsdl on the fly except "enum" (ex. pattern, minInclusive, maxInclusive etc.)? Currently, it seems only @XmlEnum can generate "enum" restriction in wsdl automatically, no other restrictions could be generated automatically in wsdl.

2. Even if I have those restrictions defined manually in wsdl, as it doesn't implement validation on income xml request, and I should do the validation inside my webservice logic, which means that even if I have those xml schema restrictions defined in wsdl, they are useless.

That's the reason I want to check if anyway the validation can be implemented automatically on income xml request.

Again, highly appreciated any further helps or comments. Thanks a lot in advance.

David

weichen_davida at 2007-7-29 17:11:51 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

wsdl generators generally aren't all that smart. They're not going to pick up the boundaries you place on input, so they're not going to translate those to restrictions to datatypes in the wsdl.

That's not too problematic though, as most code generators taking wsdl files as input won't understand those restrictions in wsdl files and will simply ignore them :)

What we did is have all the wsdl generated once and immediately turn off the generation completely.

Then all files were modified and corrected (the generated wsdl was often faulty) by hand.

jwentinga at 2007-7-29 17:11:51 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

thank you very much jwentling, and I'll definately consider your suggestion.

Thanks a lot

David

weichen_davida at 2007-7-29 17:11:51 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...