张志峰的博客

水滴石川,积少成多。

导航

Delphi动态调用Java的WebService 转

Posted on 2013-10-31 11:20  ╰★张志峰★╮  阅读(3336)  评论(0编辑  收藏  举报

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.