Erro ao executar um WS

18/10/2012

0

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

Responder

Posts

18/10/2012

Pjava

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.
Responder

18/10/2012

Tiago

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

21/10/2012

Joel Rodrigues

É 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.
Responder

21/10/2012

Marcio Araujo

é bom saber esses problemas!!!
Responder

Assista grátis a nossa aula inaugural

Assitir aula

Saiba por que programar é uma questão de
sobrevivência e como aprender sem riscos

Assistir agora

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar