Click here to Skip to main content
15,899,474 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Help Pin
NetPointerIN22-Sep-03 11:14
NetPointerIN22-Sep-03 11:14 
GeneralRestoring of DB Pin
Anonymous22-Sep-03 3:27
Anonymous22-Sep-03 3:27 
GeneralAccess Report Printing from VB Pin
Dangleberry21-Sep-03 22:26
sussDangleberry21-Sep-03 22:26 
QuestionIs it possible??? Pin
Doominator21-Sep-03 12:04
Doominator21-Sep-03 12:04 
GeneralPrinting Software - Please Help Me .... Pin
Wism Chan20-Sep-03 14:28
sussWism Chan20-Sep-03 14:28 
GeneralCalendar & DropDown boxes for changing Calendar Month, Day, Year Pin
iamalexCode20-Sep-03 11:24
iamalexCode20-Sep-03 11:24 
Generalusing vb6 crystal reports 7 in .net Pin
Anonymous20-Sep-03 10:15
Anonymous20-Sep-03 10:15 
GeneralXPath problem Pin
raf franco20-Sep-03 3:39
raf franco20-Sep-03 3:39 
Hi,

I have a problem parsing a WSDL xml with an XMlDocument.
This is a short version of the XML:

<?xml version="1.0" encoding="utf-8" ?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org/WebReferenceAddin.DefaultCustomer/CustomerEngine" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org/WebReferenceAddin.DefaultCustomer/CustomerEngine" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types />
<message name="GetCustomerSoapIn" />
<message name="GetCustomerSoapOut" />
<message name="GetCustomerByNameSoapIn" />
<message name="GetCustomerByNameSoapOut" />
<portType name="CustomerEngineSoap" />
<binding name="CustomerEngineSoap" type="s0:CustomerEngineSoap" />
<service name="CustomerEngine">
<port name="CustomerEngineSoap" binding="s0:CustomerEngineSoap">
<soap:address location="http://localhost/webreferenceaddin.defaultcustomer/customerengine.asmx" />
</port>
</service>
</definitions>

The code I use is:
Dim dom As New System.Xml.XmlDocument
dom.Load(URL.Text)
'Create an XmlNamespaceManager for resolving namespaces.
Dim nsmgr As System.Xml.XmlNamespaceManager = _
New System.Xml.XmlNamespaceManager(dom.NameTable)
For Each att As System.Xml.XmlAttribute In dom.DocumentElement.Attributes
If att.Prefix = "xmlns" Then
nsmgr.AddNamespace(att.LocalName, att.Value)
End If
If att.LocalName = "xmlns" Then
nsmgr.AddNamespace("", att.Value)
End If
Next


When I use the commandwindow for selecting the service element I get:

>? dom.selectsinglenode("./node()[1]/service",nsmgr)
Nothing

But the statement below gives

>? dom.selectsinglenode("./node()[1]/node()[8]",nsmgr)
{System.Xml.XmlElement}
[System.Xml.XmlElement]: {System.Xml.XmlElement}
Attributes: {System.Xml.XmlAttributeCollection}
BaseURI: "http://localhost/webreferenceaddin.defaultcustomer/customerengine.asmx?wsdl"
ChildNodes: {System.Xml.XmlChildNodes}
FirstChild: {System.Xml.XmlElement}
HasChildNodes: True
InnerText: ""
InnerXml: "<port name="CustomerEngineSoap" binding="s0:CustomerEngineSoap" xmlns="http://schemas.xmlsoap.org/wsdl/"><soap:address location="http://localhost/webreferenceaddin.defaultcustomer/customerengine.asmx" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" /></port>"
IsReadOnly: False
Item: <cannot view indexed property>
LastChild: {System.Xml.XmlElement}
LocalName: "service"
Name: "service"
NamespaceURI: "http://schemas.xmlsoap.org/wsdl/"
NextSibling: Nothing
NodeType: Element
OuterXml: "<service name="CustomerEngine" xmlns="http://schemas.xmlsoap.org/wsdl/"><port name="CustomerEngineSoap" binding="s0:CustomerEngineSoap"><soap:address location="http://localhost/webreferenceaddin.defaultcustomer/customerengine.asmx" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" /></port></service>"
OwnerDocument: {System.Xml.XmlDocument}
ParentNode: {System.Xml.XmlElement}
Prefix: ""
PreviousSibling: {System.Xml.XmlElement}
Value: Nothing

What is wrong?

Thank you,
Raf.
GeneralRe: XPath problem Pin
Jan Tielens22-Sep-03 20:07
Jan Tielens22-Sep-03 20:07 
GeneralRe: XPath problem Pin
raf franco22-Sep-03 20:45
raf franco22-Sep-03 20:45 
GeneralResizing Columns in a DataGrid Pin
Emile Jacobs20-Sep-03 1:15
Emile Jacobs20-Sep-03 1:15 
GeneralRe: Resizing Columns in a DataGrid Pin
ami-uhle26-Sep-03 5:39
ami-uhle26-Sep-03 5:39 
GeneralAdding controls to a child control of a UserControl at design time Pin
jplocster19-Sep-03 22:15
jplocster19-Sep-03 22:15 
QuestionHow to Use API AddForm in VB.net Pin
allanli19-Sep-03 0:22
allanli19-Sep-03 0:22 
AnswerRe: How to Use API AddForm in VB.net Pin
NetPointerIN19-Sep-03 6:57
NetPointerIN19-Sep-03 6:57 
GeneralRe: How to Use API AddForm in VB.net Pin
allanli19-Sep-03 16:06
allanli19-Sep-03 16:06 
QuestionHELP! How to convert MS Word/Excel into Image? Pin
j.j18-Sep-03 23:24
j.j18-Sep-03 23:24 
AnswerRe: HELP! How to convert MS Word/Excel into Image? Pin
scott@otech.com23-Sep-03 4:17
scott@otech.com23-Sep-03 4:17 
QuestionMarshalling Data, Can Anyone Help? Pin
GrindAZ18-Sep-03 10:05
GrindAZ18-Sep-03 10:05 
AnswerRe: Marshalling Data, Can Anyone Help? Pin
NetPointerIN19-Sep-03 8:02
NetPointerIN19-Sep-03 8:02 
GeneralRe: Marshalling Data, Can Anyone Help? Pin
GrindAZ22-Sep-03 5:31
GrindAZ22-Sep-03 5:31 
GeneralRe: Marshalling Data, Can Anyone Help? Pin
NetPointerIN22-Sep-03 11:08
NetPointerIN22-Sep-03 11:08 
GeneralRe: Marshalling Data, Can Anyone Help? Pin
GrindAZ22-Sep-03 12:00
GrindAZ22-Sep-03 12:00 
GeneralFolder Size Pin
Ramaza18-Sep-03 6:53
Ramaza18-Sep-03 6:53 
GeneralRe: Folder Size Pin
Christian Eriksen10-Oct-03 14:34
Christian Eriksen10-Oct-03 14:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.