Forum Discussion

dwallace's avatar
dwallace
New Contributor
10 years ago

Can't access properties in webservice response object

Hi,



I'm trying to run a test on a webservice that returns an object ("WebServiceResponse".) I'm receiving this response, but having trouble accessing properties deeper within the object. The WebServiceResponse object includes two properties: "ErrorMessage" and "Result," the latter of which points to another object, called "GetTicketPriceResponse". I can pull the values from the error message, but not the sub-object; they all return empty.



One thing I've noticed is that the GetTicketPriceResponse object is only ever used in this indirect way, never directly as the response or included in a request, so it doesn't appear to have been included in the catalog of webservice types for the TypeFactory. Is this what could be affecting my ability to access its properties? If so, what can I do to get TestComplete to recognize this object type? If not, what else might be causing the problem?



Thanks,

Danielle

4 Replies

  • dwallace's avatar
    dwallace
    New Contributor
    Nevermind; we solved it on our end by throwing a dummy method into the web service that passes the object in question, so that TestComplete would see and recognize it. :)



    Food for thought for future updates, though: it would be useful to be able to add custom objects to the TypeFactory somehow. (Or if there already is a way of doing this, or an effective alternative, I'd love to know!)
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Danielle,



    Can you post here a link to this web service or its .wsdl file?

    If this can not be done for some reason, I would recommend to create a Support ticket via http://support.smartbear.com/message/?prod=TestComplete.

    If you create a ticket, I would appreciate if you let us know the results.

    BTW, what version of TestComplete are you using?
  • dwallace's avatar
    dwallace
    New Contributor
    Further support isn't necessary since we found a way to solve the problem on our end.



    The problem was the the object was not defined in the WSDL, but it was still required so that TestComplete could recognize and collect its contents.



    I don't oversee the WSDL, myself, but I'm assuming it is automatically generated and we avoid manual edits so that they won't be overwritten if it needs to be refreshed. We solved the problem by creating a dummy method that passes the object in question directly, forcing it to be defined by the WSDL generator.



    Thank you for the offer of help, though. :)
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Danielle,



    > The problem was the the object was not defined in the WSDL, but it was still required [...]



    OK, thank you for the details.

    If I got you correctly, it looks like the problem was not with TestComplete, but with the tested web service. The case is that neither TestComplete nor any other web service client has no other means to get the information about methods and data types required by the web service but from the published WSDL. And if WSDL lacks some information, this means that any client will not be able to communicate with this web service.

    I think that it is worth to talk to developers and figure out why this information was not published in the WSDL file. As of now, for me this looks like a problem (issue) in web service.