【发布时间】:2023-03-18 15:55:01
【问题描述】:
是否可以从基于 .NET ASMX 的 Web 应用程序生成 WSDL 而无需将其托管在 IIS 中?理想情况下,我想将 svcutil.exe(或 wsdl.exe?)指向 dll,并让它为 Web 应用程序吐出所有 WSDL。
如果您能提供 svcutil.exe 的语法,那就太好了。我已经执行了 svcutil.exe /?而且我似乎无法实现 wsdl 生成(如果可能的话)。
如果我打电话:
svcutil.exe myapplication.dll
我收到消息:
Generating metadata files...
Warning: No metadata files were generated. No service contracts were exported.
To export a service, use the /serviceName option. To export data contracts, specify
the /dataContractOnly option. This can sometimes occur in certain security contexts,
such as when the assembly is loaded over a UNC network file share. If this is the
case, try copying the assembly into a trusted environment and running it.
(是的,我意识到 ASMX 已经过时了。我们正在弃用它。)
[编辑] 没人能回答这个问题吗?我知道答案正盯着我的脸,但我这辈子都想不通……
【问题讨论】:
-
显然,答案是“不”。 svcutil 查找服务合同,ASMX 服务中没有服务合同。
-
在 IIS 中托管服务的时间足以让 WSDL 脱离它有什么问题?
标签: .net web-services wsdl asmx svcutil.exe