In this web site to fill in a username, then click call, returns the XML values, such as the returned are as follows:
<? The XML version="1.0" encoding="utf-8"?>
Why not return values in Delphi? The code is as follows:
The unit Unit1;
Interface
USES the
Windows, Messages, SysUtils, Variants, Classes, Controls, StdCtrls, Graphics, Forms,
Dialogs, xmldom XMLIntf msxmldom, XMLDoc;
Type
TForm1=class (TForm)
XMLDocument1: TXMLDocument;
Button2: TButton;
ComboBox1: TComboBox;
Procedure FormCreate (Sender: TObject);
Procedure Button2Click (Sender: TObject);
Private
{Private declarations}
Public
{Public declarations}
end;
Var
Form1: TForm1;
Implementation
{$R *. DFM}
Procedure TForm1. FormCreate (Sender: TObject);
The begin
XMLDocument1. LoadFromFile (' test1. XML);
end;
Procedure TForm1. Button2Click (Sender: TObject);
Var
The nodeList: IXMLNodeList;
Node: IXMLNode;
I: integer;
The begin
NodeList:=XMLDocument1 DocumentElement..childnodes;
For I:=0 to nodeList. Do the Count - 1
The begin
Node:=nodeList [I];
If the node. The NodeName='Table' then
Combobox1. Items. The Add (node.childnodes [' AlbumID ']. Text +
"' + node..childnodes [' title ']. Text);
end;
end;
End.
CodePudding user response:
XMLDocument1. LoadFromFile (' test1. XML);Sorry, here should be:
XMLDocument1. LoadFromFile (' http://www.awcn.cc/webservice/GetAlbumInfo.asmx/GetAlbumInfoDataTable ');
CodePudding user response:
Google search webservice Delphi callCodePudding user response:
The original poster is using a WebService, have to learn how to import the WSDL in Delphi, how to use THttpRio objects such asYour code is just loading an XML document, can not reach the effect of this call,
CodePudding user response:
Formatting read relevant information