J
jianl
Unregistered / Unconfirmed
GUEST, unregistred user!
www.xmotheds.com 上面有一个jokeserver
http://www.xmethods.com/ve2/ViewListing.po;jsessionid=-8a2F3iMmQ9MIWL5wFZT_dNx(QCcd0CRM)?serviceid=24682
使用THTTPRIO的代码:
procedure TForm1.Button1Click(Sender: TObject);
Var p:JokeServerSoap;
lang : JokeToString;
receive :JokeToStringResponse;
begin
p := Httprio1 as JokeServerSoap;
lang := JokeToString.Create;
lang.Lang := 'ES';
receive := JokeToStringResponse.Create;
receive := p.JokeToString(lang);
memo1.Text := receive.JokeToStringResult;
lang.Free;
receive.Free;
end;
出现internal 500错误。
按照李维的(程序员8期)的代码:
var mskobj : OleVariant;
lang : JokeToString;
receive :JokeToStringResponse;
begin
lang := JokeToString.Create;
lang.Lang := 'ES';
receive := JokeToStringResponse.Create;
mskObj := CreateOleObject('MSSOAP.SoapClient');
mskObj.mssoapinit('http://www.xml-webservices.net/services/entretainment/joke_server.asmx?WSDL');
receive := mskObj.JokeToString(lang);
memo1.Text := receive.JokeToStringResult;
lang.Free;
receive.Free;
end;
[red]receive := mskObj.JokeToString(lang);编译错误。[/red]
如何解决?
http://www.xmethods.com/ve2/ViewListing.po;jsessionid=-8a2F3iMmQ9MIWL5wFZT_dNx(QCcd0CRM)?serviceid=24682
使用THTTPRIO的代码:
procedure TForm1.Button1Click(Sender: TObject);
Var p:JokeServerSoap;
lang : JokeToString;
receive :JokeToStringResponse;
begin
p := Httprio1 as JokeServerSoap;
lang := JokeToString.Create;
lang.Lang := 'ES';
receive := JokeToStringResponse.Create;
receive := p.JokeToString(lang);
memo1.Text := receive.JokeToStringResult;
lang.Free;
receive.Free;
end;
出现internal 500错误。
按照李维的(程序员8期)的代码:
var mskobj : OleVariant;
lang : JokeToString;
receive :JokeToStringResponse;
begin
lang := JokeToString.Create;
lang.Lang := 'ES';
receive := JokeToStringResponse.Create;
mskObj := CreateOleObject('MSSOAP.SoapClient');
mskObj.mssoapinit('http://www.xml-webservices.net/services/entretainment/joke_server.asmx?WSDL');
receive := mskObj.JokeToString(lang);
memo1.Text := receive.JokeToStringResult;
lang.Free;
receive.Free;
end;
[red]receive := mskObj.JokeToString(lang);编译错误。[/red]
如何解决?