I'm trying to create an XPath Match assertion in soapUI against the following XML to see if an element exists:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns2:executeResponse xmlns:ns2="http://ws.namf09.anzlic.org.au">
<responses id="?" xmlns="http://namf09.anzlic.org.au">
<result status="OK" completed="true" hasErrorsInResponseElements="false"/>
<response id="200.1">
<responseResult>
<address>
<streetNumber1>2</streetNumber1>
<streetName>sydney</streetName>
<streetType>SQ</streetType>
<localityName>sydney</localityName>
<stateTerritory>NSW</stateTerritory>
<postcode>2000</postcode>
</address>
</responseResult>
</response>
</responses>
</ns2:executeResponse>
</soapenv:Body>
</soapenv:Envelope>
My first attempt was boolean(//address), which soapUI said was false. But, when I've let soapUI work out the namspaces for me, it has come up with:
declare namespace ns2='http://ws.namf09.anzlic.org.au';
declare namespace ns1='http://namf09.anzlic.org.au';
declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
boolean(//ns1:address)
This works, but I don't understand where the ns1 namespace has come from. I assume it's a default, but how could I work this out without soapUI?