Forum Discussion

AndresEnriquez's avatar
AndresEnriquez
Occasional Contributor
4 years ago

Property transfer Missing match for source xpath

Hello people, I am new to SOAPUI, I hope any of you could help me.

From the following XML I'm trying to get the  <ns3:segmentReference> VALUE with a PROPERTY TRANSFER teststep.

For that I clicked in the "ns" button to bring me the namespaces and declare them, and what I typed afterwards is:

//ns3:segmentReference

But that doesn't seem to work, it says "null" or "Missing match for source xpath"

I tried the longer version of the path but still won't work.

Could you point out what I am doing wrong? 

Thanks in advance

 

 

 

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Header>
      <add:MessageID xmlns:add="http://schemas.xmlsoap.org/ws/2004/08/addressing">0c1d47f3-9c97-4e26-9f47-57d8134e6743</add:MessageID>
   </S:Header>
   <S:Body>
      <querySegmentsResponse xmlns="http://www.telefonica.com/schemas/UNICA/SOAP/OCSProvisioning/accountManagement/v2/types" xmlns:ns0="http://www.telefonica.com/schemas/UNICA/SOAP/common/v2" xmlns:ns3="http://www.telefonica.com/schemas/UNICA/SOAP/OCSProvisioning/v2/types">
         <ns3:segmentInfoList>
            <ns3:segmentInfo>
               <ns3:segmentId>AltaPrepSur</ns3:segmentId>
               <ns3:segmentReference>43751735500</ns3:segmentReference>
               <ns3:timeInterval>
                  <ns3:startTime>
                     <ns3:date>2021-12-15T11:37:34.0-03:00</ns3:date>
                  </ns3:startTime>
               </ns3:timeInterval>
            </ns3:segmentInfo>
            <ns3:segmentInfo>
               <ns3:segmentId>CAMPC100</ns3:segmentId>
               <ns3:segmentReference>43751751374</ns3:segmentReference>
               <ns3:timeInterval>
                  <ns3:startTime>
                     <ns3:date>2021-12-15T11:40:32.0-03:00</ns3:date>
                  </ns3:startTime>
               </ns3:timeInterval>
            </ns3:segmentInfo>
         </ns3:segmentInfoList>
      </querySegmentsResponse>
   </S:Body>
</S:Envelope>

 

 

 

 

Thanks in advance

 

 

 

  • nmrao's avatar
    nmrao
    4 years ago
    Please try below xpath
    //*:segmentInfo[*:segmentId='AltaPrepSur']/*:segmentReference/text()
  • nmrao's avatar
    nmrao
    Champion Level 3
    I believe it is because of multiple of "segmentReference".
    To drill down to single value, use the reference of segmentId
    • AndresEnriquez's avatar
      AndresEnriquez
      Occasional Contributor

      Thanks for your quick reply nmrao ğŸ˜Š

      In order to do this: To drill down to single value, use the reference of segmentId. Do I have to use Xquery?

      Could you teach me how to do it?

      Sorry for the basic questions, It's been days since I'm using the program.

      Cheers

      • nmrao's avatar
        nmrao
        Champion Level 3
        Please try below xpath
        //*:segmentInfo[*:segmentId='AltaPrepSur']/*:segmentReference/text()
    • AndresEnriquez's avatar
      AndresEnriquez
      Occasional Contributor

      I have been reading other posts and articles about Xquery and I wrote this piece of code

      <asdf>
      {
      for $a in //ns3:segmentInfoList/ns3:segmentInfo
      where $a/ns3:segmentId='AltaPrepSur'
      return <ns3:segmentReference> {data($a/ns3:segmentReference/text())} </ns3:segmentReference>
      }
      </asdf>

       

      but it doesn't seem to work, it returns the tag <asdf>