akacodemonkey
12 years agoNew Contributor
[Resolved] property expansion on soap message
hello, I'm looking for some help with using information received on one test step to be used in the next step. The response from step 1 is as follows:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<ActivityId CorrelationId="d5237c79-9a11-40e3-b38d-0e9556c6314f" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">d24565d2-2d85-4972-80ee-acd985969680</ActivityId>
</s:Header>
<s:Body>
<GetCustomersResponse xmlns="http://tempuri.org/">
<GetCustomersResult xmlns:a="http://schemas.datacontract.org/2004/07/Iress.MSO.DIP.Application.Contracts.Intemediary.Customer" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:CustomerDetails>
<a:Customers>
<a:CustomerDto>
<a:DateOfBirth>1983-08-06T01:00:00</a:DateOfBirth>
<a:Gender>2</a:Gender>
<a:HasChangedNameInLastThreeYears>false</a:HasChangedNameInLastThreeYears>
<a:HasFinancialDependants>false</a:HasFinancialDependants>
<a:Id>0407029a-818d-e311-a507-984be1759724</a:Id>
<a:IsPermanentUkResident>true</a:IsPermanentUkResident>
<a:Name>
<a:Forename>Brian</a:Forename>
<a:MiddleName/>
<a:Surname>Curlew</a:Surname>
<a:Title>1</a:Title>
</a:Name>
<a:Nationality>1</a:Nationality>
<a:PreviousName i:nil="true"/>
</a:CustomerDto>
</a:Customers>
<a:Dependants/>
</a:CustomerDetails>
<b:CustomerOccupancyDto>
<b:CurrentOccupancy>
<b:Address>
<b:County>GLOUCESTERSHIRE</b:County>
<b:District/>
<b:Flat/>
<b:HouseName i:nil="true"/>
<b:HouseNumber>1</b:HouseNumber>
<b:Postcode>GL4 4WB</b:Postcode>
<b:Street>High Street</b:Street>
<b:Town>CHELTENHAM</b:Town>
</b:Address>
<b:AddressTargeted>false</b:AddressTargeted>
<b:Hash i:nil="true"/>
<b:Id i:nil="true"/>
<b:IsDeleted>false</b:IsDeleted>
<b:IsLettingAgent i:nil="true"/>
<b:OccupancyStatus>5</b:OccupancyStatus>
<b:TimeAtAddressInMonths>0</b:TimeAtAddressInMonths>
<b:TimeAtAddressInYears>3</b:TimeAtAddressInYears>
</b:CurrentOccupancy>
<b:CustomerId>0407029a-818d-e311-a507-984be1759724</b:CustomerId>
<b:PreviousOccupancies/>
</b:CustomerOccupancyDto>
</a:CustomersOccupancy>
</GetCustomersResult>
</GetCustomersResponse>
</s:Body>
</s:Envelope>
I've used the property expansion syntax
${#GetCustomerDetails#Response#//s:Envelope/s:Body/GetCustomersResponse/GetCustomersResult/a:CustomerDetails/a:Customers[1]/a:CustomerDto/a:DateOfBirth/text()}
that didnt work so I then used a property transfer to move the response into a property (which worked) and then placed the following command
${#TestCase#CustomerDetails#[//s:Envelope/s:Body/GetCustomersResponse/GetCustomersResult/a:CustomerDetails/a:Customers[1]/a:CustomerDto/a:DateOfBirth/text()]}
again didnt work. I've checked the xpath and it is valid and returns the data I expect.
Any ideas? I'd be grateful for the help
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<ActivityId CorrelationId="d5237c79-9a11-40e3-b38d-0e9556c6314f" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">d24565d2-2d85-4972-80ee-acd985969680</ActivityId>
</s:Header>
<s:Body>
<GetCustomersResponse xmlns="http://tempuri.org/">
<GetCustomersResult xmlns:a="http://schemas.datacontract.org/2004/07/Iress.MSO.DIP.Application.Contracts.Intemediary.Customer" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:CustomerDetails>
<a:Customers>
<a:CustomerDto>
<a:DateOfBirth>1983-08-06T01:00:00</a:DateOfBirth>
<a:Gender>2</a:Gender>
<a:HasChangedNameInLastThreeYears>false</a:HasChangedNameInLastThreeYears>
<a:HasFinancialDependants>false</a:HasFinancialDependants>
<a:Id>0407029a-818d-e311-a507-984be1759724</a:Id>
<a:IsPermanentUkResident>true</a:IsPermanentUkResident>
<a:Name>
<a:Forename>Brian</a:Forename>
<a:MiddleName/>
<a:Surname>Curlew</a:Surname>
<a:Title>1</a:Title>
</a:Name>
<a:Nationality>1</a:Nationality>
<a:PreviousName i:nil="true"/>
</a:CustomerDto>
</a:Customers>
<a:Dependants/>
</a:CustomerDetails>
<b:CustomerOccupancyDto>
<b:CurrentOccupancy>
<b:Address>
<b:County>GLOUCESTERSHIRE</b:County>
<b:District/>
<b:Flat/>
<b:HouseName i:nil="true"/>
<b:HouseNumber>1</b:HouseNumber>
<b:Postcode>GL4 4WB</b:Postcode>
<b:Street>High Street</b:Street>
<b:Town>CHELTENHAM</b:Town>
</b:Address>
<b:AddressTargeted>false</b:AddressTargeted>
<b:Hash i:nil="true"/>
<b:Id i:nil="true"/>
<b:IsDeleted>false</b:IsDeleted>
<b:IsLettingAgent i:nil="true"/>
<b:OccupancyStatus>5</b:OccupancyStatus>
<b:TimeAtAddressInMonths>0</b:TimeAtAddressInMonths>
<b:TimeAtAddressInYears>3</b:TimeAtAddressInYears>
</b:CurrentOccupancy>
<b:CustomerId>0407029a-818d-e311-a507-984be1759724</b:CustomerId>
<b:PreviousOccupancies/>
</b:CustomerOccupancyDto>
</a:CustomersOccupancy>
</GetCustomersResult>
</GetCustomersResponse>
</s:Body>
</s:Envelope>
I've used the property expansion syntax
${#GetCustomerDetails#Response#//s:Envelope/s:Body/GetCustomersResponse/GetCustomersResult/a:CustomerDetails/a:Customers[1]/a:CustomerDto/a:DateOfBirth/text()}
that didnt work so I then used a property transfer to move the response into a property (which worked) and then placed the following command
${#TestCase#CustomerDetails#[//s:Envelope/s:Body/GetCustomersResponse/GetCustomersResult/a:CustomerDetails/a:Customers[1]/a:CustomerDto/a:DateOfBirth/text()]}
again didnt work. I've checked the xpath and it is valid and returns the data I expect.
Any ideas? I'd be grateful for the help