Problems about the Spectrum Data Model - the SOAP issue

Guy Rixon gtr at ast.cam.ac.uk
Fri Sep 15 04:16:42 PDT 2006


On Fri, 15 Sep 2006, Dobos, Laszlo wrote:

> Hello,
>
> I didn't look at the SOAP standard actually, but experienced this problem
> when I tried creating the Spectrum Service.

Right. Since this matters to you, can you do IVOA a favour and look the point
up in the WS-I basic profile, then post the verdict to grid at ivoa.net? Thanks.

> If I creat a WS that exports a
> class that has mixed type serialization set, and I generat a proxy class
> using the .net or mono tools it does not want to use any other data type for
> the field but string, even though most of the fields that are intended to be
> serialized as text between tags are numerical data.
>
> The .net documentation says the following:
>
> The XML Schema Definition Tool (Xsd.exe) occasionally generates the
> XmlTextAttribute when creating classes from an XML Schema definition (XSD)
> file. This occurs when the schema contains a complexType with mixed content;
> in that case, the corresponding class contains a member that returns a
> string array to which the XmlTextAttribute is applied.
>
> (.net uses attributes to control how objects and class fields are serialed,
> XmlTextAttribute directs the serializer to serialize an element as text
> between tags, and, for example, XmlElementAttribute forces the serializer to
> serialize a field as an element.)
>
> A more detailed document from MS:
>
> http://msdn2.microsoft.com/en-us/library/kz8z99ds.aspx
>
> However, I'm a practical guy and still suggesting omitting mixed content
> from the VO standard if it does not work with any of the main WS
> implementations. Why actually do we need that number right between the tags
> instead of in an attribute?

I understand your position. Are you happy then if I veto all usages that are
problematic for Apache Axis? That's a vast list since Axis has problems with
almost everything. :-/  Perhaps we should allow only simple types in
SOAP because comple types are rather hard in SOAP:Lite. Pandering to broken
tools is a bad precedent.

> Also, using mixed content is an _extension_ to the basic XSD,

No it's not! It's part of XML Schema Part 1: Structures Second Edition
W3C Recommendation 28 October 2004, the primary standard. See section 3.4
(http://www.w3.org/TR/xmlschema-1/#Complex_Type_Definitions):

Complex Type Definitions provide for:...Constraining element information item
[children] to be empty, or to conform to a specified element-only or mixed
content model, or else constraining the character information item [children]
to conform to a specified simple type definition.

> and we can
> design standards that are going to last for decades, as FITS do, and
> introduce extensions that arise incompatibility, but if we want to create
> web services right now, we should keep in mind the SOAP restrictions.
>
> Anyway XSD is for validating XML documents. SOAP is for serializing in
> memory object into XML. Of course XML has more possibilities for twisting
> data types than a programming language, and that's why SOAP has more
> constaints on the schema. And these constraints are existing not just
> because the MS guys didn't want to implement the whole standard.

SOAP doesn't have these constraints; .NET does.

Look, I'm sympathetic to problems with bad tools (we have many such
headaches), but let's not confuse "invalid according to specification" with
"happens not work in my software".

Cheers,
Guy

Guy Rixon 				        gtr at ast.cam.ac.uk
Institute of Astronomy   	                Tel: +44-1223-337542
Madingley Road, Cambridge, UK, CB3 0HA		Fax: +44-1223-337523



More information about the dm mailing list