RouG
13 years agoOccasional Contributor
Passing Objects to WebServices
Hello,
I'm running TC 8.50.618.7.
We have a WebService that you can see the definition in the attached file (WebService.jpg).
When I try the following code :
Set arrPersonDetails = WebServices.ImportPerson.TypeFactory.ArrayOfKeyValueOfPersonPropertyanyType9TnG2BaV
Set PersonDetail = WebServices.ImportPerson.TypeFactory.KeyValueOfPersonPropertyanyType9TnG2BaVType
'Set the details for a person
'Create the Array of Person's details
arrPersonDetails.KeyValueOfPersonPropertyanyType9TnG2BaV = BuiltIn.CreateVariantArray(0,0)
'Insert the first person details
PersonDetail.Key = "FirstName"
PersonDetail.Value = "First_Test01"
set arrPersonDetails.KeyValueOfPersonPropertyanyType9TnG2BaV(0) = PersonDetail
set resp_status = WebServices.ImportPerson.CreatePerson(arrPersonDetails)
I get the error with the deserializer(see WebSerive-error.jpg) when calling : set resp_status = WebServices.ImportPerson.CreatePerson(arrPersonDetails)
I think my problem is around the PersonDetail.Value. I'm passing here a string , but in the definition (xsd) it's defined as anytype.
What am I doing wrong ?
Any helps would be appriciate.
Regards
I'm running TC 8.50.618.7.
We have a WebService that you can see the definition in the attached file (WebService.jpg).
When I try the following code :
Set arrPersonDetails = WebServices.ImportPerson.TypeFactory.ArrayOfKeyValueOfPersonPropertyanyType9TnG2BaV
Set PersonDetail = WebServices.ImportPerson.TypeFactory.KeyValueOfPersonPropertyanyType9TnG2BaVType
'Set the details for a person
'Create the Array of Person's details
arrPersonDetails.KeyValueOfPersonPropertyanyType9TnG2BaV = BuiltIn.CreateVariantArray(0,0)
'Insert the first person details
PersonDetail.Key = "FirstName"
PersonDetail.Value = "First_Test01"
set arrPersonDetails.KeyValueOfPersonPropertyanyType9TnG2BaV(0) = PersonDetail
set resp_status = WebServices.ImportPerson.CreatePerson(arrPersonDetails)
I get the error with the deserializer(see WebSerive-error.jpg) when calling : set resp_status = WebServices.ImportPerson.CreatePerson(arrPersonDetails)
I think my problem is around the PersonDetail.Value. I'm passing here a string , but in the definition (xsd) it's defined as anytype.
What am I doing wrong ?
Any helps would be appriciate.
Regards