Forum Discussion

RouG's avatar
RouG
Occasional Contributor
13 years ago

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

2 Replies

  • Julia_K's avatar
    Julia_K
    SmartBear Alumni (Retired)

    Hello Gaetan,


    Unfortunately, the information you gave us is not enough to find the reason of the problem.

    Could you please use this web form to send us your WSDL file (or a sample WSDL file that demonstrates the problem)? This will help us reproduce and analyze the problem faster.

    Thanks in advance.

  • RouG's avatar
    RouG
    Occasional Contributor
    Hello,



    I've followed the link and provided additional information (wsdl file and the xsd)



    Hope it will help.



    Regards.