Skip to main content

"anyType" in auto-generated WSDL/XSD : JAX-WS idiosyncrasy or standard ?

No replies
Joined: 2010-10-20

Hi all,

I'm posting this question in a number of forums (fora ?) in order to get an idea about my situation from all the relevant angles. I've googled the issue like crazy but am not finding any categoric answers, which forces me to come post questions in this kind of forum.

The situation : in the context of my work I am using a proprietary technology to call a webservice over the internet. The WSDL + XSD of the service were generated using JAX-WS (JAX-WS RI 2.1.4-b01-).

These objects define an element defined with type anyType. In order for us to successfully call this service, we are then forced to specify in the XML of the message xsi:type attributes of string, dateTime, etc, in order for the XML processor on the server to be able to operate on our message.

While I understand the reasoning around this mechanism (it's a clever mechanism, I don't deny that for a second) I'm not certain if this is an idiosyncrasy of JAX-WS or if this mechanism is endorsed by the w3c (which I checked too).

My initial instinct is to say that the WSDL + XSD should be the only necessary contract to validate the data being sent to the server. That the server has extra requirements beyond that should be documented upfront so that callers can design their solution accordingly.

Could people kindly share their knowledge with me on this topic ? Links to the relevant information on reference sites such as or would be best !