Reputation: 12016
I have a SOAPUI project aimed at v4 of an API. To use the API, I need to authenticate to get a token, and then use that token in subsequent API calls. I'm using a Property Transfer to pick up the authentication token and store it as a Custom Property (against the TestSuite). This all works fine.
I'm now working against v1 of the API, and I am trying to follow the same approach. However, when I do the token transfer, I get an error:
[Error: Unexpected element: CDATA]
The response from the v1 Authenticate request is near-identical, except for the following:
And there is no CDATA element within.
Sample Response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<AuthenticateResponse xmlns="http://cse-healthcare.com/API/1.0">
<AuthenticateResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<AuthenticationToken>a183577c-52d8-4fa0-a73a-611e6a143d79</AuthenticationToken>
<Response xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
<Status>
<Code>EGE00</Code>
<Description i:nil="true"/>
<Status>OK</Status>
</Status>
</AuthenticateResult>
</AuthenticateResponse>
</s:Body>
</s:Envelope>
Property Transfer:
I'm using //*:AuthenticationToken/text()
, which is identical to that working against v4, apart from the initial capital.
It's not an absolute show-stopper; I don't have that much testing to do so copying the token to other requests would not be crippling, but it is just frustrating that something that appears to be identical does not work.
Any ideas?
Upvotes: 2
Views: 4526
Reputation: 10329
The property transfer step targets children of a node in the XML. If the specified node does not contain any children, then the text node will be selected. If there are additional children, then the resulting hierarchy will be selected. In either case you can restrict that only the text be transferred, by selecting the "Transfer text content" option. Additional documentation is here.
For your case, removing the /text()
node from your XPath should work.
Upvotes: 1