Delphi调用.NET的WebService,是非常容易和方便的,下面用C#提供的
Login服务 ,来说明Delphi的调用方法.Login返回的是一个字符串.
一般有以下布骤:
A.调用第一步,完成C#,asmx文件生的调用函数
- unit UnitMJWebLogin;
- interface
- uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
- type
- // Namespace : http://tempuri.org/
- // soapAction: http://tempuri.org/%operationName%
- // transport : http://schemas.xmlsoap.org/soap/http
- // style : document
- // binding : MJLoginSoap
- // service : MJLogin
- // port : MJLoginSoap
- // URL : http://127.0.0.1/EPlatform/bin/MJLogin/MJLogin.asmx
- // ************************************************************************ //
- IMJWebLogin = interface (IInvokable)
- [ '{EEAFD61D-DA43-1CB6-C349-E5DD8110DE17}' ]
- function Login( const aLoginName: WideString; const aPassword: WideString; const aCPUID: WideString; const aHardDiskID: WideString): string ; stdcall;