wood burning stoves 2.0*
The moose likes Web Services and the fly likes who has to do the minoccurs validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "who has to do the minoccurs validation " Watch "who has to do the minoccurs validation " New topic
Author

who has to do the minoccurs validation

satish jupalli
Greenhorn

Joined: Apr 06, 2003
Posts: 10
I�m using Weblogic 8.1 and acting as web service provider.
In the WSDL if we declare a field in response as minouccrs=1 , which means the response should contain this element for sure.
My question is whether the weblogic container will raise some fault if we fail to send the response which has the field as minoccurs=1, or as the server side provider do we need to handle this condition and make sure that this field is always part of the response.

In nut shell, does the weblogic or any web services container does any validation before sending the SOAP response to client to make sure that response is strictly according to the WSDL?
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Originally posted by satish jupalli:
does the weblogic or any web services container does any validation before sending the SOAP response to client to make sure that response is strictly according to the WSDL?


In the general case no validation is done for performance reasons. However minoccurs=1 could have an impact on the generated classes depending on how sophisticated the code generator is. (minOccurs=1, maxOccurs=1) on a simple type that translates to an intrinsic Java type simply translates to a property with a default value (either specified by the WSDL/XML Schema or the Java defaults) as intrinsic types cannot be null. (minOccurs=1, maxOccurs=1) on a complex type that translates to a Java class would require additional code - like a mandatory non-null parameter on the constructor and/or sanity-check in every accessor (getter) of the object to ensure that only consistent instances of the class are used.

You'll simply have to experiment with the generated code to see if violations of the constraints laid down by the WSDL/XML Schema will result in exceptions in the generated Java code.

Take into account that WebLogic 8.1 is a J2EE 1.3 generation platform. Web services didn't enter the J2EE specification until 1.4. So any web service support under WebLogic 8.1 should be viewed as "early" and "proprietary" - so I wouldn't get my hopes up.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: who has to do the minoccurs validation
 
Similar Threads
Error in SOAP response when webservice is deployed in Weblogic
clients stubs regeneration
General Doubts in WebServices after Fibonacci Example
how do i make a field mandatory in my WSDL using axis2
Asynch Web Service