none
启用silverlight功能的WCF服务,我需要在IIS上发布,web.config文件中需要哪些东西 RRS feed

  • 问题

  • 我是这样配置的:
    <system.serviceModel>
            <behaviors>
                <serviceBehaviors>
                    <behavior name="SilverlightBlog.Web.DataServiceBehavior">
                        <serviceMetadata httpGetEnabled="false" />
                        <serviceDebug includeExceptionDetailInFaults="false" />
                    </behavior>
                </serviceBehaviors>
            </behaviors>
            <bindings>
       <basicHttpBinding> 
       <binding name="BasicHttpBinding_DataService"
          maxBufferSize="62914560"
          maxBufferPoolSize="2147483647"
         maxReceivedMessageSize="62914560">
        <readerQuotas maxArrayLength="2147483647"/>
        </binding>
                </basicHttpBinding>
            </bindings>
      <serviceHostingEnvironment aspNetCompatibilityEnabled="true">
       <baseAddressPrefixFilters>
        <add prefix="http://silverblog.gicp.net/"/>
       </baseAddressPrefixFilters>
      </serviceHostingEnvironment>
            <services>
                <service behaviorConfiguration="SilverlightBlog.Web.DataServiceBehavior"
                    name="SilverlightBlog.Web.DataService">
                    <endpoint address="http://silverblog.gicp.net/DataService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_DataService"
                        contract="SilverlightBlog.Web.DataService" />
         <host>
          <baseAddresses>
           <add baseAddress="http://silverblog.gicp.net/"/>
          </baseAddresses>
         </host>
                   
                </service>
            </services>
        </system.serviceModel>


    首先<serviceMetadata httpGetEnabled="true" /> httpGetEnabled需要设置true吗
    设置true
    会出现:
    ServiceMetadataBehavior 的 HttpGetEnabled 属性设置为 True,而 HttpGetUrl 属性是相对地址,但没有 http 基址。请提供 http 基址或将 HttpGetUrl 设置为绝对地址。

    还有<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />不去掉会有以下错误:

    找不到具有绑定 MetadataExchangeHttpBinding 的终结点的与方案 http 匹配的基址。注册的基址方案是 [https]。




    2010年2月24日 8:51