从dll生成WSDL?

时间:2011-08-24 18:27:57

标签: .net web-services wsdl asmx svcutil.exe

是否可以从基于.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已经过时了。我们正在弃用它。)

[编辑] 没人能回答这个问题?我知道答案是盯着我的脸,但对于我的生活,我无法弄明白......

1 个答案:

答案 0 :(得分:1)

您可以将服务托管在其他地方并从中生成WSDL吗? This guy used Cassini和Stephan Brenner撰写了GetWsdl。我自己没有用过它。