WebServices serializing arrays
WebServices serializing arrays
- Subject: WebServices serializing arrays
- From: "Philip D. Wasson" <email@hidden>
- Date: Fri, 26 Sep 2003 18:38:42 -0400
Is this the right list on which to ask about WebServicesCore, or would
the "web-development" list be a better place? That looks less
programmer-y, so I'll ask here first.
I'm trying to use WebServicesCore (WSMethodInvocation) to call a Web
Service (duh). One method takes among its parameters an array of
structures (dictionaries, in this case).
What we're hoping to see is something like this (within the parameter
list, for an n-element array):
<ArrayParameterName SOAP-ENC:Array
SOAP-ENC:ArrayType="xsd:OurStructType[n]">
<OurStructType>
<strucElem1>somevalue</strucElem1>
<strucElem2>somevalue</strucElem2>
<strucElem3>somevalue</strucElem3>
</OurStructType>
<OurStructType>
<strucElem1>somevalue</strucElem1>
<strucElem2>somevalue</strucElem2>
<strucElem3>somevalue</strucElem3>
</OurStructType>
etc.
</ArrayParameterName>
Notice that each element of the array has the same tag name (which
matches examples in a [somewhat outdated] SOAP book I have).
But instead, the array element names ("OurStructType" above) are
"item_0", "item_1", etc., and the "xsd:OurStructType" property value in
the outer element ("ArrayParameterName") is "ur-type", like this:
<ArrayParameterName SOAP-ENC:ArrayType="xsd:ur-type[n]"
xsi:type="SOAP-ENC:Array">
<item_0 xsi:type="OurStructType">
<strucElem1>somevalue</strucElem1>
<strucElem2>somevalue</strucElem2>
<strucElem3>somevalue</strucElem3>
</item_0>
<item_1 xsi:type="OurStructType">
<strucElem1>somevalue</strucElem1>
<strucElem2>somevalue</strucElem2>
<strucElem3>somevalue</strucElem3>
</item_1>
etc.
</ArrayParameterName>
I did manage to set a special value in the inner dictionaries that sets
the xsi:type of the array elements, but they still have bogus element
names.
Can anyone offer a suggestion of how to fix this?
Oh, I'm using "kWSSOAP2001Protocol" on Mac OS 10.2.6.
Thanks in advance.
----------------------------------------------------------------------
Philip D. Wasson pwasson at mac dot com
Software Engineer Managing Editor Inc.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.