2009-01-23 35 views
5

GÜNCELLEME 3: Bir Visual Studio 2008 test projeyi oluşturulan ve paylaşılan sitesi WCF hizmeti referans bir servis başvurusu oluşturmak için çalıştı ve şu hatayı alınan
:Yük dengeleme hatası - NLB

There was an error downloading ' http://apps.mydomain/MyService.svc '. The request failed with HTTP status 400: Bad Request. Metadata contains a reference that cannot be resolved: ' http://apps.mydomain/MyService.svc '. Content Type application/soap+xml; charset=utf-8 was not supported by service http://apps.mydomain/MyService.svc '. The client and service bindings may be mismatched. The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'.. If the service is defined in the current solution, try building the solution and adding the service reference again.

GÜNCELLEME 2:
@Nick - Her bir uç noktasının adresini her sunucunun tam yolu ile açık bir şekilde belirleme önerisini denedim ve yine de aynı sonucu elde ediyorum.

Ayrıca, listenUri özniteliğini paylaşılan site URL'siyle ayarlamaya çalıştığımda, 404 hatası yerine 400 hatalı bir istek hatası alıyorum.

GÜNCELLEME bazı ek araştırmadan sonra, orada http://apps1.mydomain ve http://apps2.mydomain arasındaki çatışmaları ayarı bazı IIS yapılandırma ve "sunucu uygulaması kullanılamıyor" hatası geçmiş olsun edebildi. Paylaşılan sitede (http://apps.mydomain) göz atmak için çalıştı

Şimdi bir 404 hatası alıyorum ama http://apps1.mydomain ve http://apps2.mydomain hizmet referansına göz atabilir duyuyorum.

Orijinal Sorun

My şirketin bizim IIS sunucuları arasındaki denge trafiği yüklemek için Microsoft NLB kullanır. Kısa bir süre önce her bir IIS 6 Windows Server 2003 Standard Edition SP1 sunucusuna bir WCF hizmeti dağıtmıştım. Ben IE 7 kullanarak paylaşılan alan adına göz çalıştığında aşağıdaki hata aldı:

Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.

tüketici hizmeti kullanmak için http://apps.mydomain işaret eder fakat sanal alanı http://apps1.mydomain veya http://apps2.mydomain eşleştirilir. Her sunucuda hizmete göz atarsam, bu hatayı almıyorum.

Hizmet şu anda anonim bir basicHttpBinding kullanıyor.

Başka biri bu sorunu yaşadı mı?

bu hata meydana başlamadan önce ben her üç alan adı (http://apps.mydomain, http://apps1.mydomain, http://apps2.mydomain) için broswed zaman, aşağıdaki hata aldı

Tarih:

This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.

ben ServiceHostFactory kullanılan özel bir hizmet fabrikası belirtmek için .svc dosyamı özelleştirmek için sınıf. Ardından, ServiceHostFactory'den devralınarak ve gerektiğinde geçersiz kılarak özel fabrikamızı oluşturuyorum.

public class MyFactory : ServiceHostFactory 
{ 
    protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) 
    { 
     return new ServiceHost(serviceType, baseAddresses[0]); 
    } 
} 

<%@ ServiceHost Language="C#" Factory="MyFactory" Debug="true" Service="MyService" CodeBehind="~/App_Code/MyService.cs" %> 

cevap

2

. Ben tüketen uygulamada işçi servis başvuruları (http://apps1.mydomain veya http://apps2.mydomain) birine bir servis başvurusu yarattı. Sonra paylaşılan sitesi WCF adresi (http://apps.mydomain) işaret edecek istemci yapılandırmasında son nokta referansını değiştirdi ve ben tüketmek ve hizmeti kullanmak başardı.

1

Ben sunucuların sadece buldum ilk IP adresini pic olurdu farklı IP adresleri ve WCF ile çoklu ağ kartları vardı WCF ve yük dengeleme ile daha önce bir sorunu yaşadım. Her sunucunun Hizmet Tanımında IP adresini açıkça belirtmek zorundaydık, böylece WCF doğru olanı bağlayacaktır.bazıları benim WCF hizmeti için farklı konfigürasyonlarda deneme ve uygulama tüketen sonra

+0

@ Nick - Bir örnek teşkil veya kaynak verebilir misiniz? –