没有从WCF服务获取数据

时间:2014-12-19 08:45:06

标签: c# asp.net wcf

我在IIS中托管了WCf服务,并将其作为独立的虚拟目录。当我托管这个服务时,我可以从WCF测试客户端看到WCF的方法但是无法访问数据。 你能快点建议我出错了吗

下面是我的代码:

<system.serviceModel>
 <behaviors>
  <serviceBehaviors>
    <behavior name="MobServiceBehavior">
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="WebBehavior">
      <webHttp/>
    </behavior>
  </endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
<services>
  <service name="ClubConnect.MobService" behaviorConfiguration="MobServiceBehavior">
    <endpoint address="" binding="wsHttpBinding" contract="ClubConnect.IMobService"/>
    <endpoint address="ws" name="webHttpBinding" binding="webHttpBinding" contract="ClubConnect.IMobService" behaviorConfiguration="WebBehavior" >
      <identity>
        <dns value="http://domain/mobile_app/mobservice.svc" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>

错误:

  

内容类型text / html; charset =响应消息的UTF-8   不匹配绑定的内容类型(application / soap + xml;   字符集= UTF-8)。如果使用自定义编码器,请确保   IsContentTypeSupported方法正确实现。第一个1024   响应的字节是:&#39; &#39 ;.服务器堆栈跟踪:at   System.ServiceModel.Security.IssuanceTokenProviderBase 1.DoNegotiation(TimeSpan timeout) at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout) at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Security.CommunicationObjectSecurityTokenProvider.Open(TimeSpan timeout) at System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout) at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.SecurityChannelFactory {1.ClientSecurityChannel {1}} 1.ClientSecuritySessionChannel.OnOpen(时间跨度   超时)at   System.ServiceModel.Channels.CommunicationObject.Open(时间跨度   超时)at   System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan超时)   在System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan   超时)at   System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel   频道,TimeSpan超时)at   System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(时间跨度   超时,CallOnceManager级联)at   System.ServiceModel.Channels.ServiceChannel.Call(String action,   Boolean oneway,ProxyOperationRuntime操作,Object [] ins,   对象[]出局,TimeSpan超时)at   System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage   methodCall,ProxyOperationRuntime operation)at   System.ServiceModel.Channels.ServiceChannelProxy.Invoke(即时聊天   消息)在[0]处重新抛出异常:at   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(即时聊天   reqMsg,IMessage retMsg)at   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&安培;   msgData,Int32类型)在IMobService.GetCategoryList()处   MobServiceClient.GetCategoryList()

0 个答案:

没有答案