gr3270 0 Newbie Poster

Anyone solved this one? - Suppose I have a Person complex type defined in an xsd. And it has an element, eg age, that is declared as minOccurs=0. ie, age is optional for the creation/existence of the complexType.

Now suppose I want to pass that Person as the argument on 5 different SOAP requests (operations) that are defined in a WSDL. And suppose that I want to enforce and declare to the caller that on 3 of those operations age is a required element, and on 2 of them age is not required.

Is there a best way to do this? Should I create new complex types such as Op1Person, Op2Person etc that each have the appropriate setting for minOccurs for that operation? ("Op1Person" would probably only include the Person elements that were required for Operation op1).

So, "Person" is the real domain object, what would be the best way to specify what elements of Person are required for particular operations? And to specify it declaratively so it's known at build time, rather than relying on assertion exceptions being thrown at runtime?

-gr

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.