Forum Discussion

Mdrafi's avatar
Mdrafi
Occasional Contributor
15 years ago

need help

From the following response i need to pass the accesskey to the other request..please help

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<UnregisterDataSyncClientResult xmlns="http://www.mcafeeasap.com/ws/McAfee.SaaS.DataSync/V1/">
<ResultCode>1</ResultCode>
<ResultMessage>InvalidInput: Parameter 'request.AccessKey': Value must be provided</ResultMessage>
</UnregisterDataSyncClientResult>
</s:Body>
</s:Envelope>


I have used the following but it did not work
<v1:AccessKey>${RegisterDataSyncClient#Response#//xmlns:RegisterDataSyncClientResult/Accesskey}</v1:AccessKey>


Thanks
Rafi
  • Could you please show an example of the XML response from test case "RegisterDataSyncClient"?
  • (all one line)
    ${RegisterDataSyncClient#Response#declare namespace ns1='http://www.mcafeeasap.com/ws/McAfee.SaaS.DataSync/V1/'; //ns1:RegisterDataSyncClientResult[1]/ns1:AccessKey[1]}


    I think you could leave out the "declare namespace ns1='...';" part as shown below. But the above is more proper.
    ${RegisterDataSyncClient#Response#//ns1:RegisterDataSyncClientResult[1]/ns1:AccessKey[1]}
  • Mdrafi's avatar
    Mdrafi
    Occasional Contributor
    I have a complicated responce now, i need to put the uid which is colored in the responce below in the request, can you help out?

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
    <ActivityId CorrelationId="8b773093-e169-4a4f-8b57-16dc7d76a799" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">77f95d86-ea84-4878-8803-7d44ee753b3f</ActivityId>
    </s:Header>
    <s:Body>
    <GetProductCatalogResult xmlns="http://www.mcafeeasap.com/ws/McAfee.SaaS.DataSync/V1/">
    <ResultCode>0</ResultCode>
    <ResultMessage>Success</ResultMessage>
    <Products xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <Product>
    <Uid>a19ebac4-d255-4a0f-a9c5-3d43cf377869</Uid>
    <Code>VSS</Code>
    <Name>Virus and Spyware Protection Coverage</Name>
    <IsEndpointProduct>true</IsEndpointProduct>
    </Product>
    <Product>
    <Uid>c989497f-b929-44b8-a71d-efeafe1fce63</Uid>
    <Code>PFW</Code>
    <Name>Firewall Protection Coverage</Name>
    <IsEndpointProduct>true</IsEndpointProduct>
    </Product>
    <Product>
    <Uid>771cef42-8bc7-4714-acfa-2e34e830cf25</Uid>
    <Code>BP</Code>
    <Name>Browser Protection Coverage</Name>
    <IsEndpointProduct>true</IsEndpointProduct>
    </Product>
    <Product>
    <Uid>d8238919-bc8e-47fd-9772-2ff516161309</Uid>
    <Code>WFS</Code>
    <Name>Web Filtering Service</Name>
    <IsEndpointProduct>true</IsEndpointProduct>
    </Product>
    <Product>
    <Uid>854a0d2c-2a29-45bb-a069-93c5829223e2</Uid>
    <Code>MXL</Code>
    <Name>SaaS Email Protection service</Name>
    <IsEndpointProduct>false</IsEndpointProduct>
    </Product>
    <Product>
    <Uid>afb294a7-bbf3-4685-9592-d65d433ff92e</Uid>
    <Code>MSS</Code>
    <Name>SaaS vulnerability scanning service</Name>
    <IsEndpointProduct>false</IsEndpointProduct>
    </Product>
    </Products>
    </GetProductCatalogResult>
    </s:Body>
    </s:Envelope>
  • Very similar. Just a bit more fancy with the Xpath:


    ${RegisterDataSyncClient#Request#declare namespace ns1='http://www.mcafeeasap.com/ws/McAfee.SaaS.DataSync/V1/'; //ns1:GetProductCatalogResult[1]/ns1:Products[1]/ns1:Product[ns1:Name='SaaS vulnerability scanning service']/ns1:Uid[1]}