There are some code
123.xml:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Body>
<P2MessageServiceStatus>
<CONNECTION>CONNECTION_CONNECTED</CONNECTION>
<ROUTER>ROUTER_CONNECTED</ROUTER>
</P2MessageServiceStatus>
</SOAP:Body>
</SOAP:Envelope>
so, i am trying go get value using name Spaces. It runs ok without it, but with namespaces it does nothing
$url='http://123.xml'
$xpath='/SOAP:Envelope/SOAP:Body/P2MessageServiceStatus/@CONNECTION'
$namespace='SOAP'
$wc = New-Object Net.WebClient
[xml]$xml_body = $wc.DownloadString($url)
$xmlvalue= Select-Xml -XPath $xpath -Xml $xml_body -Namespace @{ SOAP = 'http://test'}
$xmlvalue will be empty with no errors, how to fix it ?