LucD
Leadership
Leadership

ManagedObjectReference WSDL entry has no 'value" attribute. Why ?

Since I'm just starting to use the WSDL files, it could be that this is a real "newbie" question.

But can someone explain why there is no "value" attribute in the ManagedObjectReference WSDL type definition ?

<complexType xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vim25="urn:vim25" name="ManagedObjectReference">
      <simpleContent>
         <extension base="xsd:string">
            <attribute name="type" type="xsd:string"></attribute>
         </extension>
      </simpleContent>
</complexType>


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
7 Replies
jrackliffe
Hot Shot
Hot Shot

I am not a web service expert, but I wonder if value attribute is a default extension for the SimpleContent type? Just a hypothesis, but if you were representing a trivial object that object would need some attribute to store something so maybe an implicit "value" attribute is there to trim the WSDL?

Funny how much we use the proxy generators everyday, but never look on the inside and as "why?".

I am sure someone out there understands the diff between simple and complexcontent schema elements bettert than I who can bring a more educated opinion.

J

0 Kudos
LucD
Leadership
Leadership

I couldn't find anything about implicit attributes in the WSDL schema from W3C.

But during my search I stumbled upon ticket 306, String subclass is generated wrongly from simpleContent , in the soap4r wiki, which seems to describe exactly what I was wondering about (see the text entered on 11/23/07).

Unfortunately the ticket stops there.

Could it be that the WSDL files still contain the suspected bug ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
fixitchris
Hot Shot
Hot Shot

See page 55 : http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/sdk40programmingguide.pdf

So what you're saying is why we don't pass values like this:

<entity type=”Datacenter” value="my dc"/>

but like this:

<entity type=”Datacenter”>datacenter-21</entity>

Here is a decent explanation I found...

http://msdn.microsoft.com/en-us/library/ms256106.aspx

jrackliffe
Hot Shot
Hot Shot

Pretty much, but there is another underlying question.

Why didn't VMware use the simpleContent type any place else. They have a number of types that are simple like the CustomFieldStringValue that has no attributes except value. And a mess of types with only one or two attributes and the pretty much required "value" attribute. I am sure there is a very good reason for it, but I just don't know it.

J

LucD
Leadership
Leadership

Thanks for the references, I understand that the simplecontent definition is following the rules.

But the W3C document (and also the MS site you refered to) state that there 2 alternatives: simplecontent or complexcontent.

There I have to agree with Justin, why did VMW use the SimpleContent construction only for the ManagedObjectReference.

In light of the other elements defined in the WSDL, a ComplexContent construction would have been more in line with the other elements in he WSDL.

The actual reason for this choice is indeed probably documented somewhere in the SDK archives Smiley Wink


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
fixitchris
Hot Shot
Hot Shot

CustomFieldStringValue looks like it inherits from CustomFieldValue which inherits from DynamicData.

So to pass a CustomFieldStringValue aren't you required to fill : (string)value, (int)key, (string)dynamicType, (DynamicProperty)dynamicProperty ?

0 Kudos
jrackliffe
Hot Shot
Hot Shot

That is a good point. Didn't follow the inheritance for that one type. Maybe thats why vmw never used SimpleContent outside of a mor since mor inherits from the base string and many others inherit/contain a complexType or anyType.

Now we are firmly into speculation now so unless VMware engineers have any insight we could chalk it up to the WSDL generator, bugs in frameworks, actual proper compilation based upon inheritance and property types. Unless someone steps up who has written a WSDL compiler and can shed light onto how and when these element types are selected I think we will remain in hypothesis. I mean looking at DynamicData it doesn't even have a content node so whats up with that!?

J

0 Kudos