Delphi动态调用Java的WebService —— 基于“Axis2发布WebService例子(HelloWorld)”
uses ComObj;
var
WsObject: Variant;
reslt:String;
name:String;
begin
try
//WsObject:=Unassigned;
try
WsObject := CreateOleObject('MSOSOAP.SoapClient30');
except
WsObject := CreateOleObject('MSSOAP.SoapClient30');
end;
try
WsObject.mssoapinit('http://localhost:8080/HelloWorld/services/HelloWorld?wsdl');
ShowMessage('存储服务连接成功!');
finally
end;
except on E: Exception do
ShowMessage('存储服务连接失败!!错误信息:' + E.Message);
end;
name:='gan';
reslt:=WsObject.gethelloWorld(name);
ShowMessage(reslt);
end.