首页 新闻 赞助 找找看

WCF First Sample 遇到问题

0
悬赏园豆:5 [已解决问题] 解决于 2012-08-16 16:33

WinFrm宿主

问题1:

使用wcftestclient 测试 发生错误, 错误信息如下:

 

Failedto add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata.

WCF元数据错误

The HttpGetEnabled property of ServiceMetadataBehavior is set to true and the HttpGetUrl property is a relative address, but there is no http base address.  Either supply an http base address or set HttpGetUrl to an absolute address.

WCF
问题补充:
<system.serviceModel>
    <!--<diagnostics performanceCounters="All" />-->
    <services>
      <service behaviorConfiguration="HeatingManagerService" name="Hailin.HeatingManager.AppServer.Service.HeatingManagerService">
        <endpoint address="service" binding="netTcpBinding" contract="Hailin.HeatingManager.AppServer.Service.IHeatingManagerService" />
        <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <!--<add baseAddress="net.tcp://localhost:8000" />-->
            <add baseAddress="http://127.0.0.1:8000/"></add>
            <add baseAddress="net.tcp://127.0.0.1:8000/"></add>
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="HeatingManagerService">
          <serviceMetadata httpGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="True"/>
          <serviceCredentials>
            <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType=""/>
          </serviceCredentials>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <netTcpBinding>
        <binding name="service">
          <readerQuotas maxNameTableCharCount="1638400" />
          <security mode="None">
            <transport clientCredentialType="None" protectionLevel="None" />
          </security>
        </binding>
        </netTcpBinding>
    </bindings>
  </system.serviceModel>
峡谷少爷的主页 峡谷少爷 | 菜鸟二级 | 园豆:220
提问于:2012-08-16 14:16
< >
分享
最佳答案
0

web.config中WCF配置有问题

收获园豆:4
dudu | 高人七级 |园豆:31075 | 2012-08-16 15:48

使用 wcftestclient 测试时,用的也是netTcpBinding吗?

dudu | 园豆:31075 (高人七级) | 2012-08-16 16:22

@dudu: 是的。

现在报:

HTTP could not register URL http://+:8000/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).

 

这里是不是因为没有权限啊。

峡谷少爷 | 园豆:220 (菜鸟二级) | 2012-08-16 16:26
其他回答(1)
0

你最好去微软的网站上下载一个完整的WCF例子程序下来,然后编译运行。

收获园豆:1
Launcher | 园豆:45045 (高人七级) | 2012-08-16 14:48
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册