HTTP状态403 WCF服务请求失败:禁止

时间:2012-03-05 23:25:01

标签: c# asp.net wcf web-services

我正在尝试托管WCF服务。

我正在使用WCF测试客户端工具来测试应用程序,但我不断收到此消息;

所有这些都适用于开发。

Error: Cannot obtain Metadata from http://sgrieger.net/MetroFail If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error    URI: http://sgrieger.net/MetroFail    Metadata contains a reference that cannot be resolved: 'http://sgrieger.net/MetroFail'.    The remote server returned an unexpected response: (405) Method Not Allowed.    The remote server returned an error: (405) Method Not Allowed.HTTP GET Error    URI: http://sgrieger.net/MetroFail    There was an error downloading 'http://sgrieger.net/MetroFail'.    The request failed with HTTP status 403: Forbidden.

这是我的配置文件,因为它位于GoDaddy服务器上;

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

    <system.web>
        <compilation debug="true" />
    </system.web>
    <system.serviceModel>
        <services>
            <service name="MetroFail.PostService" behaviorConfiguration="WcfServiceLibrary1.Service1Behavior">
                <host>
                    <baseAddresses>
                        <add baseAddress = "http://www.sgrieger.net/MetroFail/" />
                    </baseAddresses>
                </host>
                <endpoint address ="" binding="wsHttpBinding" contract="MetroFail.IPostService">
                </endpoint>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="WcfServiceLibrary1.Service1Behavior">
                    <serviceMetadata httpGetEnabled="True"/>
                    <serviceDebug includeExceptionDetailInFaults="False" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
    </system.serviceModel>

</configuration>

0 个答案:

没有答案