J'utilise l'installation d'intégration WCF de Castle et tout fonctionne correctement pour mon premier point de terminaison webHttp. Pour que ce point de terminaison fonctionne, le paramètre WebHttpBehavior doit être activé sur le point de terminaison. J'ai pu y parvenir en utilisant:Spécification du comportement du point de terminaison de l'outil d'intégration WCF de château par point de terminaison
container.Register(Component.For<IEndpointBehavior>()
.ImplementedBy<WebHttpBehavior>());
Cela devient un problème lorsque je tente de permettre à un deuxième point final à l'aide BasicHttpBinding qui est incompatible avec le WebHttpBehavior. Y a-t-il un moyen de spécifier que l'enregistrement IEndPointBehavior ci-dessus s'applique uniquement à un point de terminaison donné?
Ceci est mon installateur complet pour le service:
container.AddFacility<WcfFacility>(f => f.CloseTimeout = TimeSpan.Zero)
.Register(Component.For<IDiagnosticService>()
.ImplementedBy<DiagnosticService>()
.Named("DiagnosticService")
.LifestyleTransient()
.AsWcfService(new DefaultServiceModel()
.Hosted()
.AddEndpoints(WcfEndpoint.BoundTo(new WebHttpBinding()).At("json"))
.AddEndpoints(WcfEndpoint.BoundTo(new BasicHttpBinding()).At("soap"))
.PublishMetadata(o => o.EnableHttpGet())));
container.Register(Component.For<IEndpointBehavior>()
.ImplementedBy<WebHttpBehavior>());
La classe WcfEndpoint accepte une instance de System.ServiceModel.ServiceEndpoint. En utilisant cela, je peux configurer indépendamment le point de terminaison si nécessaire. Cela semble fonctionner correctement, mais je ne peux pas comprendre comment gérer l'adressage relatif (ie (http: //local/ser.svc/json vs (http: //local/ser.svc/soap) Les constructeurs pour System.ServiceModel.EndpointAddress nécessite un URI Si je mets tout l'uri (http: //local/ser.svc/json "), j'obtiens une exception" No protocol binding match "Si j'utilise juste http: // local /ser.svc en tant qu'URI, cela fonctionne, mais je n'ai pas les adresses/json et/ou le point de terminaison soap. – Bluffrock