Erro ao executar um WS

.NET

18/10/2012

Fui executar um WS, passando uma URL do tipo:

http://minha_url/arquivo/meu_ws.svc

Aí gerou esse erro. Aparentemente o IIS está ok, mas....

Qualquer ajuda é bem-vinda.


Server Error in '/svgweb' Application.
--------------------------------------------------------------------------------

This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item
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.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item

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:


[ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item]
System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item) +11645310
System.Collections.Generic.SynchronizedCollection`1.Add(T item) +67
System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] addresses) +49
System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +129
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +28
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +331
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +693
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +42
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479
Pjava

Pjava

Curtidas 0

Respostas

Pjava

Pjava

18/10/2012

Resolvi assim: Parece ser uma restrição de segurança do IIS 7.5 em não permitir multiplos sites. Fui no meu web.config e adicionei essa tag:

<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

Isso startou o serviço e meu problema foi resolvido.
GOSTEI 0
Tiago

Tiago

18/10/2012

Bacana pjava, engraçado como iis tem muitas coisas para se aprender... ja passei por situações semelhantes..
GOSTEI 0
Joel Rodrigues

Joel Rodrigues

18/10/2012

É verdade, Tiago. São muitas as opções do IIS, eu arrisco dizer que é difícil publicar uma aplicação sem precisar de alguma configuração adicional, sempre falta alguma coisa.
Obrigado por compartilhar a solução com a comunidade, PJsva.
Bom, nesse caso estou encerrando o tópico.
GOSTEI 0
Marcio Araujo

Marcio Araujo

18/10/2012

é bom saber esses problemas!!!
GOSTEI 0
POSTAR