【发布时间】:2014-12-16 09:46:45
【问题描述】:
我有带有 udp 绑定的 wcf 服务(WCF 4.5 中的新功能),我正在尝试将它托管在 Azure 上的 Windows Server 2012 上。
我在 Azure 上为我需要的端口(39901;它适用于 HTTP:80,我可以看到 IIS 网站)进行了端点映射,并且我允许该端口的防火墙中的所有流量。 但我仍然无法在网络浏览器中获取 wsdl。
这是控制台应用程序的 app.config:
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceThrottling maxConcurrentCalls="12" maxConcurrentInstances="56" maxConcurrentSessions="12" />
<useRequestHeadersForMetadataAddress></useRequestHeadersForMetadataAddress>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="ServerService.UdpServiceAlpha">
<endpoint address="soap.udp://localhost:8091" binding="udpBinding" contract="ServerService.IUdpServiceAlpha" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:39901/SelfServerHost/" />
</baseAddresses>
</host>
</service>
</services>
<protocolMapping>
<add binding="udpBinding" scheme="soap.udp" />
</protocolMapping>
<bindings>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
</configuration>
对于本地主机,一切正常...我是这方面的新手(天蓝色,Windows 服务器部署),我在 stackoverflow 或其他任何地方尝试了很多想法。但还是不行。
有什么想法吗?
编辑1:
<services>
<service name="ServerService.UdpServiceAlpha" behaviorConfiguration="UdpServiceAlpha.Behavior">
<endpoint address="/" binding="udpBinding" contract="ServerService.IUdpServiceAlpha"/>
<endpoint address="/" binding="webHttpBinding" contract="ServerService.IUdpServiceAlpha"/>
<host>
<baseAddresses>
<add baseAddress="http://xxx.cloudapp.net:39901/SelfServerHost/" />
<add baseAddress="soap.udp://xxx.cloudapp.net:39901/SelfServerHost/" />
</baseAddresses>
</host>
</service>
</services>
【问题讨论】:
-
我不完全确定,但我相信应该通过一些属性“ServiceDescription”或类似的设置为元数据 URL。
-
@Codor ...我该怎么处理它?哪个 URL 元数据? ...您有一些如何正确设置的示例吗?
标签: c# wcf azure windows-server-2012 self-hosting