WCF TestClient调用Get()方法时出错

时间:2012-05-30 15:27:58

标签: wcf

我正在处理WCF测试的问题。我有 CategorieService WCF服务..查看图片http://i.stack.imgur.com/1Wbg1.jpg通过 netTcpBinding 分享它没关系(所有方法都被正确调用),GetAll()除外GetById()方法。它会引发异常......请参阅详细信息http://i.stack.imgur.com/I60vt.jpg

以下是 App.config 文件

<system.serviceModel>
    <diagnostics>
      <messageLogging logEntireMessage="true" logMalformedMessages="true"
        logMessagesAtTransportLevel="true" />
      <endToEndTracing activityTracing="true" />
    </diagnostics>
    <services>
      <service name="Services.CategorieService">
        <clear />
        <endpoint binding="mexHttpBinding" contract="IMetadataExchange"
          listenUriMode="Explicit">
          <identity>
            <dns value="localhost" />
            <certificateReference storeName="My" storeLocation="LocalMachine"
              x509FindType="FindBySubjectDistinguishedName" />
          </identity>
        </endpoint>
        <endpoint address="net.tcp://localhost:8888/myservice" binding="netTcpBinding"
          bindingConfiguration="" contract="Services.ICategorieService" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8732/Service1/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

1 个答案:

答案 0 :(得分:0)

我正在使用带有DbContext连接的POCO实体。 ProxyCreation选项必须设置为this.Configuration.ProxyCreationEnabled = false;