Martin,
This is the code that use to get the XML out of the WebService.
Dim wsc As WebServiceConnection =
DirectCast(Me.DataConnections("GetFormData"), WebServiceConnection)
Dim xp As XPathNavigator = Me.MainDataSource.CreateNavigator
Dim idValue As String =
xp.SelectSingleNode("/my:myFields/my:field4", Me.NamespaceManager).Value
' Create XmlDocuments.
Dim inputDocument As XmlDocument = New XmlDocument()
Dim outputDocument As XmlDocument = New XmlDocument()
Dim errorsDocument As XmlDocument = New XmlDocument()
' Load input document.
inputDocument.LoadXml("<GetFormData
xmlns=""http://brickmua.com/""><id>" & idValue & "</id></GetFormData>")
' Create XPathNavigator objects for documents.
Dim inputNav As XPathNavigator = inputDocument.CreateNavigator()
Dim outputNav As XPathNavigator = outputDocument.CreateNavigator()
Dim errorsNav As XPathNavigator = errorsDocument.CreateNavigator()
' Call Execute method. - retrieves data from web service xml is
in the outputNav field
wsc.Execute(inputNav, outputNav, errorsNav)
the outputNav.OuterXML property contains the orginal xml that I posted.
outputNav is a XpathNavigator object so I assumed all I had to do was access
the data as follows:
Dim val1 As String =
outputNav.SelectSingleNode("GetFormDataResponse/Ge tFormDataResult/myFields/my:field1", namespace manager).Value
I also tried the following:
Dim val1 As String =
outputNav.SelectSingleNode("/GetFormDataResponse/G etFormDataResult/myFields/my:field1", namespace manager).Value
Also tried creating an XMLDocument from the OuterXML property - can create
and access the children can not access using XPATH expressions. Also tried to
us an XPathDocument and a XMLReader.
Again I thank you for ythe help, as this would be the proper way to do it
instead of a dataset.
Let me know if you need more info.
"Martin Honnen" wrote:
> John Daly wrote:
> > Martin, Thanks for the code sample. I had tried that code, and am still
> > recieving the NullReferenceArgument.
>
> That is rather odd as that was tested code run against the XML you
> posted. If you still want to solve that problem then provide the exact
> code that gives the error.
>
> --
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/
>