delphi 10.4 webwebservice 问题

和如 2021-04-29 09:24:56
l通过wsd地址导入生成
function Getmz(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): mz;
const
defWSDL = 'https://yydcccf.cn/mz/eDownload.wsdl';
defURL = 'http://yydcccf.cn:80/mz/eDownload';
defSvc = 'Service';
defPrt = 'Soap11';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
try
Result := (RIO as sxthd_dmz);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;


mz1:=eDownload.Getmz(True,'',HTTPRIO1);
_echoResponse:=mz1.echo(_echoRequest);

程序提示这个错误


提示文档提前结束。这是怎么回事呢?初学这个高手勿喷


另外这个地址是HTTPS的, THTTPRIO 好像没有设置证书之类的地方,在会不会是这个问题。
另外THTTPRIO 要怎么设置才能访问HTTPS的webservice接口呢?
...全文
775 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
和如 2021-04-30
  • 打赏
  • 举报
回复
木有人知道吗?各位大神
和如 2021-04-30
  • 打赏
  • 举报
回复
引用 5 楼 和如的回复:
[quote=引用 4 楼 tanqth的回复:][quote=引用 3 楼 和如 的回复:]还是一样的结果返回的

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>ns0:Server</faultcode><faultstring xml:lang="en">Premature end of file.</faultstring></env:Fault></env:Body></env:Envelope>



这个是你服务器给返回的结果。说明接口调用是成功的,问题可能在两个方面,1、你接口所提交的数据有问题;2、服务器在处理时可能出现了问题。 解决方式: 你检查一下你提交的数据是否满足接口需要,或说是否正确; 再可以通过其他程序测试一下接口是否正确。[/quote] 前辈,这个是什么意思?难道是服务器端的问题?[/quote] 哦哦,好的谢谢,手机上的,刚才没看到发的文字
和如 2021-04-30
  • 打赏
  • 举报
回复
引用 4 楼 tanqth的回复:
[quote=引用 3 楼 和如 的回复:]还是一样的结果返回的

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>ns0:Server</faultcode><faultstring xml:lang="en">Premature end of file.</faultstring></env:Fault></env:Body></env:Envelope>



这个是你服务器给返回的结果。说明接口调用是成功的,问题可能在两个方面,1、你接口所提交的数据有问题;2、服务器在处理时可能出现了问题。 解决方式: 你检查一下你提交的数据是否满足接口需要,或说是否正确; 再可以通过其他程序测试一下接口是否正确。[/quote] 前辈,这个是什么意思?难道是服务器端的问题?
tanqth 2021-04-30
  • 打赏
  • 举报
回复
引用 3 楼 和如 的回复:
还是一样的结果返回的

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>ns0:Server</faultcode><faultstring xml:lang="en">Premature end of file.</faultstring></env:Fault></env:Body></env:Envelope>



这个是你服务器给返回的结果。说明接口调用是成功的,问题可能在两个方面,1、你接口所提交的数据有问题;2、服务器在处理时可能出现了问题。 解决方式: 你检查一下你提交的数据是否满足接口需要,或说是否正确; 再可以通过其他程序测试一下接口是否正确。
和如 2021-04-30
  • 打赏
  • 举报
回复
还是一样的结果返回的

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>ns0:Server</faultcode><faultstring xml:lang="en">Premature end of file.</faultstring></env:Fault></env:Body></env:Envelope>



tanqth 2021-04-30
  • 打赏
  • 举报
回复
我通常是这样调用的:

 mz1:=eDownload.Getmz;
_echoResponse:=mz1.echo(_echoRequest);

1,593

社区成员

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

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