2008-12-04 9 views
17

Recibo el siguiente error y podría necesitar ayuda para resolverlo. ¿Alguien tiene alguna idea?Solución de errores de configuración en WCF AddressFilter Mismatch

El mensaje con A 'http://localhost:60078/BidService.svc/Query' no se puede procesar en el receptor, debido a una falta de coincidencia de AddressFilter en el EndpointDispatcher. Verifique que EndpointAddresses del emisor y el receptor estén de acuerdo.

El archivo de configuración de cliente es:

<system.serviceModel> 
    <bindings> 
     <customBinding> 
      <binding name="WebHttpBinding_IBidService"> 
       <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" 
        messageVersion="None" writeEncoding="utf-8"> 
        <readerQuotas maxDepth="32" maxStringContentLength="8192" 
            maxArrayLength="16384" 
         maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
       </textMessageEncoding> 
        <httpTransport manualAddressing="True" /> 
      </binding> 
     </customBinding> 
    </bindings> 
    <client> 
     <endpoint binding="customBinding" bindingConfiguration="WebHttpBinding_IBidService" 
        behaviorConfiguration="IBidServiceBehavior" 
      contract="myService.IBidService" name="WebHttpBinding_IBidService" /> 
    </client> 
     <behaviors> 
      <endpointBehaviors> 
       <behavior name="IBidServiceBehavior"> 
        <webHttp/> 
       </behavior> 
      </endpointBehaviors> 
     </behaviors> 
</system.serviceModel> 

Mi contrato de servicios es:

[ServiceContract(Namespace = "http://xxxx.com/services/bids")] 
public interface IBidService 
{ 
    [OperationContract(Action = "*")] 
    [WebGet(RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped)] 
    List<BidSummary> Query(); 
} 

Mi servicio está configurado de la siguiente manera:

<service name="xxx.Web.Services.Bids.BidService" 
      behaviorConfiguration="Cutter.Web.Services.Bids.BidServiceBehavior"> 
    <endpoint address="" binding="basicHttpBinding" 
      contract="xxx.Web.Services.Bids.IBidService" />     
    <endpoint address="mex" binding="mexHttpBinding" 
      contract="IMetadataExchange" /> 
</service> 

<behavior name="Cutter.Web.Services.Bids.BidServiceBehavior"> 
    <serviceMetadata httpGetEnabled="true" /> 
    <serviceDebug includeExceptionDetailInFaults="true" /> 
</behavior> 

La única cosa que leí que Necesito tener el comportamiento webHttp que he agregado. Cualquier ayuda sería apreciada. Solo quiero un servicio de POX simple

Respuesta

30

Creo que también necesita agregar el comportamiento webHttp a la configuración del servicio.

+0

Lo pensé, pero no creo que sea una opción. No aparece en intellisense al menos. – JoshBerke

+0

Ver http://blogs.msdn.com/bags/archive/2008/06/09/rest-in-wcf-part-iv-hi-rest-exposing-a-service-via-get-configuring-the- service.aspx – Brian

+1

Gracias. No entiendo por qué tienen ServiceBehaviors y EndpointBehaviors, pero ahora está funcionando ... ahora para que mi cliente wcf funcione. – JoshBerke

Cuestiones relacionadas