delphi 调用webservice的问题

hgto2008 2019-10-11 06:52:05
type

loginResponse = class; { "http://server.cdt.com" }
login = class; { "http://server.cdt.com" }


login = class(TRemotable)
private
FstrDeviceId: WideString;
FstrDeviceKey: WideString;
published
property strDeviceId: WideString read FstrDeviceId write FstrDeviceId;
property strDeviceKey: WideString read FstrDeviceKey write FstrDeviceKey;
end;


HTSAPServer = interface(IInvokable)

function login(const parameters: login): loginResponse; stdcall;


initialization
InvRegistry.RegisterInterface(TypeInfo(HTSAPServer), 'http://server.cdt.com', 'utf-8');
InvRegistry.RegisterInvokeOptions(TypeInfo(HTSAPServer), ioDocument); //jia
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(HTSAPServer), '');
RemClassRegistry.RegisterXSClass(login, 'http://server.cdt.com', 'login');

///下面调用login函数出错,谁帮助写一下怎么调用?

procedure TForm1.btn1Click(Sender: TObject);
var

lginRse:loginResponse ;
login1:login;

begin

login1:=login.Create ;
lginRse:=loginResponse.Create ;

login1.strDeviceId :='123456' ;
login1.strDeviceKey :='1234567890' ;
try
lginRse:=(htpr1 as HTSAPServer).login(login1) ;
mmo1.Text :=lginRse.return ;
finally
login1.Free ;
lginRse.Free ;
end;


end;
...全文
75 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
hgto2008 2019-10-12
  • 打赏
  • 举报
回复
报错 http://schemas.xmlsoap.org/soap/envelope/:Envelope expected
hgto2008 2019-10-12
  • 打赏
  • 举报
回复
报错 http://schemas.xmlsoap.org/wsdl/:definitions found

1,593

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 网络通信/分布式开发
社区管理员
  • 网络通信/分布式开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧