Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 21061

Cannot assign an object to a variant array in a Web Service Request

$
0
0

Hello,

 

I have a Web Service which has a similar structure:

 

<Body>

             <WebMethod1>

                                        <VariantOfObject1>

                                                                    <Object1>

                                                                                     <node1/>

                                                                                     <node2/>

                                                                                     <node3/>

                                                                    </Object1>

                                                                    <Object2>

                                                                                     <node1/>

                                                                                     <node2/>

                                                                                     <node3/>

                                                                    </Object2>

                                        </ArrayOfObject1>

             </WebMethod1>

</Body>

 

And in order to assign an object to each Array entry, I use the following code:

 

function RequestObject ()

{

 

var TypeFactory;

var Result;

 

TypeFactory = WebService.MyWS.TypeFactory;

Result = TypeFactory.ArrayOfObject;
Result.Object = BuiltIn.CreateVariantArray(0,1);

 

for (var i=0; i<2;i++)

{

Result.Object(i) = TypeFactory.Object;

Result.Object(i).node1 = "a";

Result.Object(i).node2 = "a"

Result.Object(i).node3 = "a"

}

return Result;

}

 

With this code, the object generates just fine, but when I try to assign the generated object to an entry of the Array, I see that the array doesnt save the object in each entry and appears as a "undefined" value and and the data type is "String", instead of "(Object)". Can you guys help me out with this please? I have looked everywhere and I dont seem to find the answer nor I can find a work around. If you need extra information, I will gladly give it.


Viewing all articles
Browse latest Browse all 21061

Trending Articles