Forum Discussion

johntautomation's avatar
johntautomation
Occasional Contributor
12 years ago

[R]REST : Property transfer : error:Unexpected element:CDATA

I have two REST api. First one is to generate session id , and I am using property transfer to transfer session id to the 2nd API to do stuff.

Prop transfer is throwing following error

[error:Unexpected element:CDATA]

Thing is, I don't see any CDATA tag in the response. Here is the property transfer screen shot with the error. I am using SoapUI pro 4.6.2.
Please help.
Thanks.

7 Replies

  • Hi,

    XPATH is a query language to get xml nodes. It is only for XML and is independent of SoapUI.

    I doubled checked your screen shot and I see that you have "Response" as the property in the source for property transfer. You should select "ResponseAsXml" instead. Then you can use property transfer as usually and select an XPATH.
  • Hi,

    As a reminder if you are a SoapUI Pro user you can post in the Pro forum.

    I'm not able to reproduce that problem using a REST request.
    When you use the XPATH editor in the property transfer teststep do you see any CDATA tags appearing in the editor?
    Are you able to post a project reproducing this issue?
  • johntautomation's avatar
    johntautomation
    Occasional Contributor
    Thanks Marcus.

    I tried to post this in pro support first, but did not see the option to post a issue.

    almost all the time when I have tried to click the xpath editor , I get this error message. (It worked fine just once)


    Failed to select XPath for source property value [{"id":"123456789123456789","user":{"id":"888888888888888888","key":"myemail@mycompany.com","passwordUpdateId":111111111111111111,"permissions":[".*"],"status":"ENABLED","type":"APP_USER","organizationKey":"mycompany","updateId":"222222222222222222","daysSincePasswordChange":0},"permissions":[".*"],"type":"NORMAL"}]

    (I have changed data values for confidential reasons)

    there is no CDATA tag in this or the actual response in the REST step.
  • Hi,

    Open a support ticket at http://www.soapui.org/Support/support-overview.html to have your user credentials updated to be able to post in Pro forum.

    The problem is your using JSON data. XPATH is for XML data and not JSON.
    That also probably explains why your seeing that CDATA error message (even though a better error message would help).
  • johntautomation's avatar
    johntautomation
    Occasional Contributor
    So how do I get my issue fixed. Is there a way to change preference in the soapUI ? Thanks
  • johntautomation's avatar
    johntautomation
    Occasional Contributor
    As you suggested I changing it to ResponseAsXml fixed my issue.

    Thanks Marcus for your super prompt support