Créer WCF client par programmation

J'ai un site avec une Silverlight activé service WCF. Le service fonctionne bien, et je peux parcourir le langage WSDL page dans le navigateur avec aucun problème.

Maintenant, je suis en train de créer un client dans une DLL. J'ai besoin de créer l'ensemble du client par programme, car il est appelé dans une DLL, ce qui, pour quelque raison que ce soit (à dessein?) ne pas lire la ServiceModel l'article à partir de son propre fichier de configuration.

Donc voici mon code:

Dim endp As EndpointAddress = New EndpointAddress("http://www.mydomain.com/licensing/lic.svc")
Dim bind As WSHttpBinding = New WSHttpBinding()
Dim svc = New lnt.licClient(bind, endp)
Dim rsp = svc.CheckIt(key)

Mais quand je l'appelle le svc.CheckIt méthode, j'obtiens l'erreur suivante:

Content Type application/soap+xml; charset=utf-8 was not supported by service http://www.mydomain.com/licensing/lic.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 'application/soap+msbin1'.."}

Comment créer mon client, de sorte que ces sont correctement "appariés"??
Merci à l'avance!!!!!

Sivlerlight ne prend pas en charge WSHttpBinding. msdn.microsoft.com/en-us/library/cc896571(SV.95).aspx

OriginalL'auteur eidylon | 2009-10-30