2011-09-22 48 views
0

我正在使用Visual Studio 2005中,我想從WCF服務中獲取一些方法。如何獲取WCF服務,如果是服務進行身份驗證

我所謂的WCF服務,但我不能給能夠訪問它,因爲它是由

客戶的憑證,所以我得到錯誤像「權限被拒絕GET這種方法」認證。如何

到憑據傳遞從Visual Studio 2005來訪問WCF服務?。至於我是新的WCF

服務,請指導我?我發佈了相同的代碼。

EmployeeService service = new EmployeeService(); 
+0

您是否在尋找解決方案?分步指南http://blog.adnanmasood.com/2010/04/29/step-by-step-guide-for-authenticating-wcf-service-with-username-and-password-over-ssl/ –

+0

服務已經過身份驗證,我只想將用戶名和密碼傳遞給他們使用客戶端憑據的服務,但我使用的是.net 2005,沒有像這樣的選項。 – Thriumaran

+0

2005年WCF不完全支持...看到這個問題:http://stackoverflow.com/questions/346329/how-to-add-wcf-service-reference-in-visual-studio-2005 –

回答

0

您是否嘗試過使用Credentials屬性。例如,

EmployeeService service = new EmployeeService(); 
service.Credentials = new NetworkCredentials(userName, password);