我将 basicHttpBinding 添加到生产中的现有服务中,以便将其公开以供在 Delphi 中使用。
当我尝试在 wsdl 文件上使用 Delphi 7 中的 WSDLImporter 时,它无法正常工作。
生成的 tlb 中的一个部分表示
// ************************************************************************ //
// 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 Borland types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
.NET 客户端可以很好地使用此服务。该服务正在使用复杂类型,但它们位于文件中,并且它们是较新的拆分为多个文件以供 xsd 导入的文件。
在 Delphi 7 中有什么方法可以做到这一点吗?我什至尝试将所有导入的类型拉回 1 个 wsdl 文档。没有区别。
谢谢, 大卫
最佳答案
我知道这很旧(非常),但它可能会帮助其他人解决这个问题,就像我们使用 WCF 与 Delphi 的互操作性一样。
我自己的经历产生了不同的是
- 使用 basicHttpBinding
- 使用 Delphi wsdlImp 命令行工具
- 强制执行 Soap 1.1
- 指向 SingleWsdl 地址。
这是我们的 WsdlImp 命令的样子:
wsdlimp -P -XName -Ox- -SOAP11 -Oa- -Ol+ -ob+ -= http://srvAddress:1253/WCF.Server/Utils.svc/metadata?singleWsdl=UtilsWsdl.pas
关于使用 basicHttpBinding 的 Delphi 7 Soap WCF 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3661603/