问题描述
我正在困扰一个问题...我正在尝试寻找一种方法从WCF服务生成单个wsdl文档,即没有任何指向外部文档的链接.我已经使用过 FlatWsdl 删除所有xsd:import链接,但是我生成的wsdl仍然包含通过wsdl:import声明指向外部wsdl文档的链接:
I'm troubling into an issue...I'm trying to find a way to generate a single wsdl document from my WCF service, i.e. without any link to external documents.I've used FlatWsdl to remove all xsd:import links, bou my generated wsdl still contains a link to an external wsdl document via a wsdl:import declaration:
<wsdl:import namespace="http://myurl/mynamespace"
location="http://myserver/myservice.svc?wsdl=wsdl0"/>
该文档实际上包含所有内联的xsd模式,所以...为了使一个wsdl单一,也可以内联此外部wsdl文档吗?
This document actually contains all inlined xsd schemas, so... there's a way to inline also this external wsdl document, in order to have a single wsdl?
非常感谢您提供任何帮助.
Thanks a lot for any kind of help.
推荐答案
(有关FlatWSDL的先前答案已删除,因为正如您所指出的,这是关于消除xsd:import而不是wsdl:import.)
( Previous answer about FlatWSDL deleted, because as you pointed out it was about eliminating xsd:import not wsdl:import.)
请参阅此博客文章:控制生成的WSDL在WCF中
"......总是为一个目标名称空间URI生成一个WSDL ..."
"... There is always one WSDL generated for one target namespace URI ..."
您是否为ServiceContract,DataContract,ServiceBehavior等使用不同的命名空间?
Do you have different namespace for ServiceContract, DataContract, ServiceBehavior, etc. ?
这篇关于WCF:如何在没有WSDL:import的情况下生成单个WSDL文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!