gpt4 book ai didi

delphi - 在delphi XE3中导入wsdl文件

转载 作者:行者123 更新时间:2023-12-03 18:48:45 25 4
gpt4 key购买 nike

我必须使用 SOAP 来处理 Web 服务。

WSDL 文件是 http://www.healthconnect.be/sites/default/files/support/ConsultMyCareNet.wsdl

但是,当我在我的项目(Delphi XE3)中使用 file-new-other-WSDL importer 导入这个 WSDL 文件时,会出现一些错误,

在新的 *.pas 文件顶部,我发现:

The following types, referred to in the WSDL document are not being represented in this file. They are either aliases[@] of other types represented or were referred to but never[!] declared in the document. The types from the latter category typically map to predefined/known XML or Embarcadero types; however, they could also indicate incorrect WSDL documents that failed to declare or import a schema type.*


// !:GetMCNStatusRequest - "urn:be:healthconnect:rrnconnector:ws:1_0:messages"
// !:GetMCNStatusResponse - "urn:be:healthconnect:rrnconnector:ws:1_0:messages"**

因此无法编译以下用于解决 Web 服务的重要且必要的功能
留言:
Cannot unwrap: - Input part does not refer to an element - Output part does not refer to an element*
function getMCNStatus(const parameters: GetMCNStatusRequest): GetMCNStatusResponse; stdcall;

但我需要这个函数“getMCNStatus”,因为它是第一个调用的函数,因为这个函数测试与 web 服务的连接是否正常。没有这个功能,其余的都不起作用。

那么我怎样才能让这个功能正常工作呢?

我必须定义类 GetMCNStatusRequestGetMCNStatusResponse我自己和我必须在类中定义什么?我可以在 wsdl 文件中找到答案吗?

最佳答案

打开你的 wsdl 文件。
删除类型标记中的以下行。

   <xs:import namespace="urn:be:healthconnect:rrnconnector:ws:1_0:person"     schemaLocation="person-1-0.xsd" /> 
<xs:import namespace="urn:be:healthconnect:rrnconnector:ws:1_0:common" schemaLocation="common-1-0.xsd" />
<xs:import namespace="urn:be:healthconnect:rrnconnector:ws:1_0:messages" schemaLocation="messages-1-0.xsd" />

现在,您在导入 wsdl 时不会出现任何错误。
更新:原因

为什么会这样?
您不是在 wsdl 文件中定义元素类型,而是导入这些 namespace ,这些 namespace 已定义 xsd 文件,如 person-1-0.xsd 或 common-1-0.xsd 不可访问。这些命名空间应该像
"http://healthconnect/example"

关于delphi - 在delphi XE3中导入wsdl文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20846629/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com