WCF WSDL为防火墙后面的WCF错误地为xsd:schema,wsdl:import,soap:address生成了路径. [英] WCF WSDL generated paths for xsd:schema, wsdl:import, soap:address wrong for WCF behind a firewall.
问题描述
My WCF server is behind a firewall
https://www.myserver.net/QA/WS?wsdl
but the schema locations are incorrect in the wsdl
< xsd:schema targetNamespace =" http://www.myserver.net/导入>
< xsd:import schemaLocation ="http://www.myserver.net "/>
< xsd:import schemaLocation =" < xsd:import schemaLocation ="http://www.myserver.net/"/>
</xsd:schema>
<xsd:schema targetNamespace="http://www.myserver.net/Imports">
<xsd:import schemaLocation="http://10.3.100.01:860/WS?xsd=xsd0" namespace="http://www.myserver.net" />
<xsd:import schemaLocation="http://10.3.100.01:860/WS?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
<xsd:import schemaLocation="http://10.3.100.01:860/WS?xsd=xsd2" namespace="http://www.myserver.net/" />
</xsd:schema>
如何更改此项以生成schemaLocation ="https://www.myserver.net/QA/WS?xsd=xsd #用于以上所有方面.
How do I change this to generate schemaLocation="https://www.myserver.net/QA/WS?xsd=xsd#" for all of these above.
对于wsdl:import和soap:address也有相同的问题. < wsdl:import名称空间="<目标=" _ blank标题=" http://www.myserver.net/"href =" http://www.myserver.net/> <字体颜色=#0000ff> http://www.myserver.net "location =" < soap:address location =" http://localhost: 860/WS/"/>
I also have the same question for wsdl:import and soap:address.
<wsdl:import namespace="http://www.myserver.net" location="http://10.3.100.01:860/WS?wsdl=wsdl1" />
<soap:address location="http://localhost:860/WS/" />
感谢您提供任何信息.
Thanks for any info.
推荐答案
您可以将服务设置为使用具有正确地址的静态wsdl,方法是:使用ServiceMetadataBehavior上的ExternalMetadataLocation属性.
You can setup your service to use a static wsdl with the correct addresses by using the ExternalMetadataLocation property on the ServiceMetadataBehavior.
Daniel Roth
Daniel Roth
这篇关于WCF WSDL为防火墙后面的WCF错误地为xsd:schema,wsdl:import,soap:address生成了路径.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!