在Azure中托管服务时地址不正确

whi*_*hac 3 wcf azure azure-web-roles

我在Azure上托管了一个WCF服务,网址为http://voraservice.cloudapp.net/MyPushService.svc.问题是当我通过客户端连接时,它告诉我在给定地址找不到端点:

http://rd00155d3425e0/MyPushService.svc

我不知道这个随机服务器名称是如何来到这里的,我想知道几个小时后如何删除这个随机服务器名称并将WCF托管在云上的实际位置.任何指向解决方案的指针都是有意义的!

更新:我看到了这篇知识库文章 - http://support.microsoft.com/kb/971842/ 但是当我尝试更新Win7时,它说hte update不适合我的电脑.

whi*_*hac 6

最初我被重定向到这个KB - http://support.microsoft.com/kb/971842/但这个dint帮助我在我的Windows 7机器上.

最后,我能够通过在serviceBehaviors标记内添加useRequestHeadersForMetadataAddress标记来解决此问题.

<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior name="ShoutboxWebRole.ShoutsBehavior">
                <serviceMetadata httpGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="false"/>
                <useRequestHeadersForMetadataAddress/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <services>
        ...
    </services>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

  • 非常感谢你的回答.我一直在撕掉我头发上留下的东西.非常感激. (2认同)