gpt4 book ai didi

delphi - 导入 Exchange Web 服务 (EWS) wsdl 文件时如何修复未解析的类型?

转载 作者:行者123 更新时间:2023-12-03 15:58:20 25 4
gpt4 key购买 nike

https://ourmail.server/ews/services.wsdl 导入 wsdl 文件时,我最初在生成的 services.pas 中得到了大量“WSDL 文档中引用的以下类型未在此文件中表示”的信息。
然后我将 wdsl 文件下载到磁盘,看到它引用 http://schemas.microsoft.com/exchange/services/2006/messageshttp://schemas.microsoft.com/exchange/services/2006/types ,已下载https://ourmail.server/ews/types.xsdhttps://ourmail.server/ews/messages.xsd并修改了services.wdsl的启动

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:s="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://schemas.microsoft.com/exchange/services/2006/messages" schemaLocation="messages.xsd"/>
</xs:schema>
</wsdl:types>

至:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:s="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://schemas.microsoft.com/exchange/services/2006/messages" schemaLocation="file://d:/testing/web/exchange web services/types.xsd"/>
<xs:import namespace="http://schemas.microsoft.com/exchange/services/2006/messages" schemaLocation="file://d:/testing/web/exchange web services/messages.xsd"/>
</xs:schema>
</wsdl:types>

现在生成的 services.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.
// ************************************************************************ //
// !:double - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:duration - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:time - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:base64Binary - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:boolean - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:int - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:string - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:language - "http://www.w3.org/2001/XMLSchema"[Hdr][Gbl]
// !:dateTime - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:lang - "http://www.w3.org/2001/XMLSchema"[GblAttr]
// !:nonNegativeInteger - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:anyURI - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:short - "http://www.w3.org/2001/XMLSchema"[Gbl]

我可以添加什么“xs:import”行来解决这些问题?
我搜索了 W3C 的 datatypes.xsd 和 Structures.xsd 并尝试了相同的方法,但我无法让它工作。

最佳答案

有一个Web Services Toolkit for Delphi and Free Pascal ,它还有一个 WSDL 导入器。

也许这个能够处理 WSDL,我会尝试一下。

关于delphi - 导入 Exchange Web 服务 (EWS) wsdl 文件时如何修复未解析的类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13084064/

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