2013-01-07 55 views

回答

0

這聽起來像你在正確的軌道上。快速搜索interwebz產生了以下鏈接:http://www.codeproject.com/Articles/166763/WCF-Streaming-Upload-Download-Files-Over-HTTP

您的問題表明您想從java客戶端向WCFd端點發送文件,但問題的內容表明這應該是雙向功能。如果是這種情況,那麼您還需要在客戶端上實現服務端點。至於談到這裏,我不能有很大幫助,但也有資源,有像這太問題:In-process SOAP service server for Java

至於實際執行,我覺得用這兩個環節上,你應該能夠產生一些代碼爲您的服務器和客戶端。

至於讀取文件的所有字節,在C#中,你可以使用:

//Read The contents of the file indicated 
string fileName = "/path/to/some/file"; 
//store the binary in a byte array 
byte[] buffer = File.ReadAllBytes(fileName); 
//do something with those bytes! 

一定要使用搜索功能在未來:File.ReadAllBytes應該如下面的代碼工作 semi-phenomenal, nearly cosmic powered Stack Overflow search function

相關問題