Dnx_7
asked on
How do i use XPATH on SOAP string?
hi experts,
i use a webservice that returns a soap string and i try to work with xml/xpath on that string (loaded into a xmldocument)
but every xpath expression i tried doesn't work...
can you help me?
regards
i use a webservice that returns a soap string and i try to work with xml/xpath on that string (loaded into a xmldocument)
but every xpath expression i tried doesn't work...
can you help me?
regards
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetChildrenResponse xmlns="http://machine/types">
<Results>
<AssetDescription>
<InterplayURI>machine</InterplayURI>
<Attributes>
<Attribute Name="Moniker" Group="SYSTEM">1|2C3CEE92-1AE6-472C-ABE9-D0365F0F8FD8|*|5981|*</Attribute>
<Attribute Name="Created By" Group="SYSTEM">Administrator</Attribute>
<Attribute Name="Creation Date" Group="SYSTEM">2007-07-25T09:18:23.234+0100</Attribute>
<Attribute Name="Display Name" Group="USER">2) AUTOPROMO</Attribute>
<Attribute Name="Modified By" Group="SYSTEM">Administrator</Attribute>
<Attribute Name="Modified Date" Group="SYSTEM">2007-07-25T09:18:23.234+0100</Attribute>
<Attribute Name="Path" Group="SYSTEM">/PRODUCTION/2) AUTOPROMO/</Attribute>
<Attribute Name="Type" Group="SYSTEM">folder</Attribute>
</Attributes>
</AssetDescription>
<AssetDescription>
<InterplayURI>interplay://RTLWG/PRODUCTION/3) PLUG/</InterplayURI>
<Attributes>
<Attribute Name="Moniker" Group="SYSTEM">1|2C3CEE92-1AE6-472C-ABE9-D0365F0F8FD8|*|6298|*</Attribute>
<Attribute Name="Created By" Group="SYSTEM">Administrator</Attribute>
<Attribute Name="Creation Date" Group="SYSTEM">2007-07-25T09:19:16.578+0100</Attribute>
<Attribute Name="Display Name" Group="USER">3) PLUG</Attribute>
<Attribute Name="Modified By" Group="SYSTEM">Administrator</Attribute>
<Attribute Name="Modified Date" Group="SYSTEM">2007-07-25T09:19:16.578+0100</Attribute>
<Attribute Name="Path" Group="SYSTEM">/PRODUCTION/3) PLUG/</Attribute>
<Attribute Name="Type" Group="SYSTEM">folder</Attribute>
</Attributes>
</AssetDescription>
<AssetDescription>
<InterplayURI>interplay://RTLWG/PRODUCTION/1) HABILLAGES/</InterplayURI>
<Attributes>
<Attribute Name="Moniker" Group="SYSTEM">1|2C3CEE92-1AE6-472C-ABE9-D0365F0F8FD8|*|7885|*</Attribute>
<Attribute Name="Created By" Group="SYSTEM">Administrator</Attribute>
<Attribute Name="Creation Date" Group="SYSTEM">2007-07-25T14:21:32.093+0100</Attribute>
<Attribute Name="Display Name" Group="USER">1) HABILLAGES</Attribute>
<Attribute Name="File Size" Group="SYSTEM">0</Attribute>
<Attribute Name="Modified By" Group="SYSTEM">Administrator</Attribute>
<Attribute Name="Modified Date" Group="SYSTEM">2007-07-25T14:21:32.093+0100</Attribute>
<Attribute Name="Path" Group="SYSTEM">/PRODUCTION/1) HABILLAGES/</Attribute>
<Attribute Name="Type" Group="SYSTEM">folder</Attribute>
</Attributes>
</AssetDescription>
</Results>
</GetChildrenResponse>
</soap:Body></soap:Envelope>
.NET
Dim xmlDOc As New XmlDocument
xmlDOc.LoadXml(My.Computer.FileSystem.ReadAllText("c:\test.txt"))
Dim nsmgr As New XmlNamespaceManager(xmlDOc.NameTable)
nsmgr.AddNamespace("se", "http://schemas.xmlsoap.org/soap/envelope/")
nsmgr.AddNamespace("gc", "http://machine/types")
For Each n As XmlNode In xmlDOc.SelectSingleNode("soap:Envelope/soap:Body/GetChildrenResponse/Results")
Console.WriteLine(n.Value)
Next
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Computer101
EE Admin