首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

关于Delphi7调用webservice接口有关问题

2013-04-20 
关于Delphi7调用webservice接口问题我用Delphi7调用接口,地址:http://219.159.20.164/hisjk/Service.asmx?

关于Delphi7调用webservice接口问题
我用Delphi7调用接口,地址:http://219.159.20.164/hisjk/Service.asmx?WSDL,我先新建一个Application,然后在基础上新建了Delphi中的WebServices中的WSDL Importer,加载出来函数有:function  yhklxgjk(const sHospitalCode: WideString; const sUser: WideString; const sOldPWD: WideString; const sNewPWD: WideString; const sMsg: WideString): WideString; stdcall;

我在Application的Button控件双击事件中写如下代码:

procedure TForm1.Button1Click(Sender: TObject);
var
     BackMsg  :WideString;

    RIO :THTTPRIO;
    RemoteObj :ServiceSoap;
    Ret :WideString;
begin

   RIO := THTTPRIO.Create(nil);
   RIO.WSDLLocation := 'http://219.159.20.164/hisjk/Service.asmx?WSDL';
   RemoteObj := rio as ServiceSoap;
   Ret := remoteObj.yhklxgjk('1033','033','8888','6666',BackMsg);
showmessage('Ret='+Ret);
end;
参数中的值都是正确的(是人家给的)!

可运行后双击总是会报如下错误:
Project Project1.exe raised exception class ESOAPHTTPException with message 'Unable to retrieve the URL endpoint for Service/Port 'Service'/'' from WSDL 'http://219.159.20.164/hisjk/Service.asmx?WSDL''.Process stopped.Use Step or Run to continue.

不知何解,有劳指教!
[解决办法]
http://blog.sina.com.cn/s/blog_484dff580100gpbh.html
把webservice,写到URL里
rio.url

热点排行