2013-05-01 39 views
0

我遇到了WCF服務端點的問題。我編寫了這個服務,並用Windows窗體項目進行了測試。這工作得很好。當我嘗試從Silverlight中使用它時會出現問題。引起該問題的語句是從Silverlight調用WCF服務時讓端點工作

昏暗l_svcOOA作爲SvcZipStreamClient =新SvcZipStreamClient(「BasicHttpBinding_IServiceZipStream」)

錯誤說

找不到名爲「BasicHttpBinding_IServiceZipStream」和合同「svcZipStream.ISvcZipStream」終結點元素在ServiceModel客戶端配置部分。這可能是因爲沒有爲您的應用程序找到配置文件,或者因爲在客戶端元素中找不到匹配此名稱的端點元素。 堆棧跟蹤在System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint,字符串configurationName) 在System.ServiceModel.ChannelFactory.ApplyConfiguration(字符串configurationName) 在System.ServiceModel.ChannelFactory.InitializeEndpoint(字符串configurationName,的EndpointAddress地址) 在System.ServiceModel.ChannelFactory 1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress) at System.ServiceModel.EndpointTrait 1.CreateSimplexFactory() 在System.ServiceModel.EndpointTrait 1.CreateChannelFactory() at System.ServiceModel.ClientBase 1.CreateChannelFactoryRef(EndpointTrait 1 endpointTrait) at System.ServiceModel.ClientBase 1.InitializeChannelFactoryRef() 在System.ServiceModel.ClientBase`1..ctor(字符串endpointConfigurationName) 在普通的.svcZipStream.SvcZipStreamClient..ctor(字符串endpointConfigurationName) 在Common.clsUtilities.GetFileInZip(字符串p_ZipFile,字符串p_FileName)

的ServiceReferences.ClientConfig是:

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
      <binding name="BasicHttpBinding_ISvcZipStream" maxBufferSize="2147483647" 
       maxReceivedMessageSize="2147483647"> 
       <security mode="None" /> 
      </binding> 
     </basicHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="http://localhost:22214/ServiceZipStream.svc" 
      binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISvcZipStream" 
      contract="svcZipStream.ISvcZipStream" name="BasicHttpBinding_ISvcZipStream" /> 
    </client> 
</system.serviceModel> 

與往常一樣,任何幫助將不勝感激。

回答