Wo genau ist das Problem? Mein gerade hingeschmiertes Testprogram funktioniert:
Delphi-Quellcode:
uses
Xml.XMLIntf,
Xml.XMLDoc;
const
SoapMessage = '
<?xml version="1.0"?>' +
'
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" ' +
'
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' +
'
<SOAP-ENV:Body><KeyNewRequest xmlns="http://tempuri.org/">' +
'
<KeyNewRequest><GUID>EF629EB757764FBC9EA41E0611093B32</GUID>' +
'
<RequestNumber>BEST1001</RequestNumber><KeyOwner>AB100</KeyOwner>' +
'
</KeyNewRequest></KeyNewRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>';
procedure TForm1.Button1Click(Sender: TObject);
var
SoapDoc: IXMLDocument;
Node: IXMLNode;
NodeList: IXMLNodeList;
a:
String;
begin
Memo1.Clear;
SoapDoc := LoadXMLData(SoapMessage);
Node := SoapDoc.DocumentElement;
if Node<>
nil
then begin
NodeList := Node.ChildNodes;
if (NodeList<>
nil)
and (NodeList.Count=1)
then begin
Node := NodeList[0];
NodeList := Node.ChildNodes;
if (NodeList<>
nil)
and (NodeList.Count=1)
then begin
Node := NodeList[0];
a := Node.Attributes['
xmlns'];
Memo1.Lines.Add(Node.LocalName + '
=' + a);
NodeList := Node.ChildNodes;
if (NodeList<>
nil)
and (NodeList.Count=1)
then begin
NodeList := NodeList[0].ChildNodes;
Node := NodeList.FindNode('
RequestNumber');
if Node<>
nil
then
Memo1.Lines.Add(Node.LocalName + '
=' + Node.Text);
end;
end;
end;
end;
end;