这个WEB SERVICES接口怎么写(100)

W

wo88786705

Unregistered / Unconfirmed
GUEST, unregistred user!
调用WEB SERVICES函数 function login(const header: Header;
const request: LoginRequest): LoginResponse;
stdcall;源码unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,DNService1, InvokeRegistry, Rio, SOAPHTTPClient, StdCtrls, xmldom, XMLIntf, msxmldom, XMLDoc;type TForm1 = class(TForm) btn1: TButton;
edt1: TEdit;
htpr1: THTTPRIO;
procedure btn1Click(Sender: TObject);
private { Private declarations } public { Public declarations } end;
var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.btn1Click(Sender: TObject);var XMLDoc:TXMLDocument;
Node,tmp:IXMLNode;
Str:string;
DNService1 :DNService;
begin
XMLDoc := TXMLDocument.Create(Application);
XMLDoc.Options := XMLDoc.Options + [doNodeAutoIndent];
XMLDoc.XML.Clear;
XMLDoc.Active := True;
XMLDoc.Encoding := 'GB2312';
XMLDoc.Version := '1.0';
XMLDoc.StandAlone := 'yes';
Node := XMLDoc.AddChild('operation');
Node.AddChild('login').Text :='header' ;
Node.AddChild('loginrequest').Text := Trim(edt1.Text);
XMLDoc.SaveToFile('c:/tv.xml');
Str := DNService1.login(XMLDoc.XML.Text);
XMLDoc.Active := False;
XMLDoc.XML.Text := Str;
XMLDoc.Active := True;
Node := XMLDoc.DocumentElement;
if StrToIntDef(Node.ChildNodes['loginresponse'],0) <> 1 then
ShowMessage(XMLDoc.XML.Text);
//Node.ChildNodes['data'].ChildNodes['Return'].ChildNodes['reason'].Text);
XMLDoc.Free;
end;
end.
现在系统提示[Pascal Error] Unit1.pas(50): E2010 Incompatible types: 'Header' and 'string'[Pascal Error] Unit1.pas(59): E2010 Incompatible types: 'string' and 'IXMLNode'请各位大哥帮忙 在线急等
 
W

wzwcn

Unregistered / Unconfirmed
GUEST, unregistred user!
你看看Header,LoginRequest和 LoginResponse是什么类型的,你参数乱传肯定不对了
 
Top Bottom