Estoy tratando de alojar el mismo servicio dentro del mismo sitio web utilizando dos puntos finales, uno HTTP y el otro HTTPS."Ya existe un registro para URI" al alojar el mismo servicio para HTTPS y HTTP
El problema es que felizmente puedo llamar a un servicio (lo que yo llamo primeros trabajos) pero luego llamar al otro falla hasta que vuelva a intentarlo. SO puedo felizmente llamar a ambos, pero uno a la vez hasta que un proceso se recicle.
He agotado (o creo que tengo) todos los Q relevantes y documentos que pude encontrar y ninguno de ellos parece ayudarme. El nivel de documentación de MSDN con respecto a estos casos (que debería ser muy común) es espantoso y nada funciona como parece.
He utilizado Host/BaseAddresses/BaseAddress sin suerte y cada vez que lo uso, aparece otro error (no se puede encontrar un esquema HTTPS).
Tengo una carpeta llamada Seguridad que está habilitada para HTTPS dentro de IIS.
He desactivado mex por lo que no se permitieron metadatos que obtuve pasaron los errores anteriores.
¿Alguien tiene una pista? ... Soy cluless
<service name="Namespace.MyService" behaviorConfiguration="MyBehaviour">
<host>
<baseAddresses>
</baseAddresses>
</host>
<endpoint address="http://localhost/Services/MyService.svc/MyService"
name="MyService" binding="wsHttpBinding"
bindingConfiguration="myWsHttpBinding" contract="Namespace.IMyService" />
<endpoint address="https://localhost/Services/Secure/MySslService.svc/MySslService"
name="MySslService" binding="basicHttpBinding"
bindingConfiguration="MySslServiceBinding" contract="Namespace.IMyService" />
</service>
.....
<behavior name="MyBehaviour">
<custom1/>
<custom2/>
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceAuthorization principalPermissionMode="UseAspNetRoles" roleProviderName="CustomProvider"/>
<serviceCredentials>
<serviceCertificate findValue="Some" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="SomeClass, SomeDll"/>
</serviceCredentials>
</behavior>
error original es:
A registration already exists for URI 'http://localhost/Services/....'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: A registration already exists for URI 'http://localhost/Services/....'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: A registration already exists for URI
System.ServiceModel.Channels.UriPrefixTable1.RegisterUri(Uri uri, HostNameComparisonMode hostNameComparisonMode, TItem item) +320 System.ServiceModel.Channels.HttpTransportManager.Register(TransportChannelListener channelListener) +380
2.OnOuterListenerOpen(ChannelDemuxerFilter filter, IChannelListener listener, TimeSpan timeout) +606
System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener) +816
System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback) +121
System.ServiceModel.Channels.HttpChannelListener.OnOpen(TimeSpan timeout) +125
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +789
System.ServiceModel.Channels.DatagramChannelDemuxer
System.ServiceModel.Channels.SingletonChannelListener`3.OnOpen(TimeSpan timeout) +91
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +789
System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +375
Aquí es el error WCF registro de seguimiento:
The ChannelDispatcher at 'http://localhost/Services/...' with contract(s) '"IMyService"' is unable to open its IChannelListener. System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath) System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath) System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state) System.ServiceModel.AspNetPartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state) System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequestWithFlow(Object state) System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
Gracias. Lo intentaré mañana con una estructura no anidada aunque es un poco complicado con la forma en que están definidos y tengo que asegurar una carpeta, pero es posible. – Aliostad
Podría ser más simple probar el concepto de carpeta anidada con un servicio ficticio en una VM: comience con algo que funcione y vea si puede romperlo :) –
No tuve suerte como pensaba. Se desmorona en WCF no en IIS.De hecho, incluso encontré en el código MS donde falla usando Reflector pero no puedo averiguar exactamente cómo pasarlo. – Aliostad