Your issue probably has to do with this line in your code:
CODE
<cfset arrUic=myRequest.Envelope.Body.XmlChildren>
...not playing nice with this:
CODE
<cfset ArrayInsertAt(arrUic,1,35)>
Now, that seems obvious given the error you're getting. However, to troubleshoot this, rather than doing the cfdump, try this:
CODE
<cfoutput>[#myRequest.Envelope.Body.XmlChildren#]</cfoutput>
Look at that output carefully. Is there a space between the outputted variable and the first square bracket? If so, you've run into something that gave me fits just a few days back. You're not really looking at the content of that variable (even though it looks like you are). You're looking at a structure that contains the variable...in this case, an array.
Try this:
CODE
<cfset arrUic=myRequest.Envelope.Body.XmlChildren.XmlText>
and see if that fixes it. Keep in mind that a ColdFusion array is different from a Javascript array is different from what looks like an array in XML. You may have to strip the individual variables out of the XML struct, reassemble them as an array and they try to manipulate that. Even if that doesn't do it, you need to concentrate your debug efforts on what you're getting out of the XML structure as that's almost certainly your issue.
Good luck!
QUOTE(midasxl @ 28 May, 2009 - 05:58 AM)

Greetings, and thanks for reading! I am attempting to insert an array element using Coldfusion ArrayInsertAt, but I keep getting the following error...
Error casting an object of type to an incompatible type. This usually indicates a programming error in Java, although it could also mean you have tried to use a foreign object in a different way than it was designed.
Here's the snippet...
CODE
<cfset arrUic=myRequest.Envelope.Body.XmlChildren><br />
<cfdump var="#arrUic#">
<cfoutput>
<p>Here is a loop of the above xml document object, extracting the xml children of envelope.body</p>
<ol>
<cfloop index="i" from="1" to="#ArrayLen(arrUic)#">
<li>#arrUic[i]#</li>
</cfloop>
</ol>
</cfoutput>
<cfoutput>This array has #ArrayLen(arrUic)# child/children</cfoutput><br />
<cfoutput>Is this array empty? #ArrayIsEmpty(arrUic)#</cfoutput><br />
<cfset ArrayInsertAt(arrUic,1,35)>
Thank for any help!