1

I am very much a beginner when dealing with web services. We have a WSDL for a web service, and I'm messing around with the "maxOccurs" property in the WSDL. Previously, the value was "unbounded" but I am changing it to 5000. We feed this to wsimport which creates a Java class from it.

But in the resulting Java class, there are no changes to Java code between when maxOccurs was set to 5000 vs unbounded. What's the difference between 5000 and unbounded from our perspective then? I notice when I increase the number to >5000 I get an error saying that it can't support more than 5000 so it's obviously reading that, I'm just confused as to how this works.

Nash Glover
  • 51
  • 1
  • 6
  • What do you mean by "I notice when I increase the number to >5000 I get an error "? – DaveH Sep 21 '17 at 15:56
  • When I increase "maxOccurs" value to >5000. wsimport then outputs an error. "[WARNING] Current configuration of the parser doesn't allow a maxOccurs attribute value to be set greater than the value 5,000." – Nash Glover Sep 21 '17 at 17:24
  • It looks like you can alter that limit ( see https://stackoverflow.com/questions/16651005/workaround-for-xmlschema-not-supporting-maxoccurs-larger-than-5000 ), but I don't think that answers your question about what difference it makes to the code that is generated. What happens if you set it to ( say ) 5 in the schema, generate the classes and then get it to process a document which has 10 of these elements? – DaveH Sep 22 '17 at 07:15
  • Sorry about the late comment Dave, I've been out of the office - that was also my question... it doesn't seem to do anything. When I set it to 3 and put 5 elements into the XML request, it processes it just fine. Which makes sense - I'm not sure where exactly the check would come in to play in the first place. – Nash Glover Sep 28 '17 at 18:43
  • I think that check would only come into play if you were to parse the document against the schema – DaveH Sep 28 '17 at 19:02
  • Okay, I'll have to read more about that then. It certainly seems like we are not parsing based on the schema as we can break the upper bound specified in it. Thank you for your help. – Nash Glover Sep 28 '17 at 19:11

0 Answers0