Click here to Skip to main content
15,915,842 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hey all

i have WCF service and Windows mobile application

i need when Client (WM appliaction) call the WCF service it is transfer image from the computer to mobile

what are the steps.>>>

i tried the FileStream but i dnt know under any contract it
Posted

All you have to do is get the byte contents, and send byte[]. But you must know when you receive back what type of file that was so you can convert it back.
 
Share this answer
 
Comments
Ashraf ELHakim 25-Jun-10 5:37am    
thxxxxx for ur answer yes it is work i found the full method here
http://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=799
i´m gonna answer, i bet there is someone looking for this solution, hope it helps.

- in client side:
C#
string fileName = string.Empty;
using (OpenFileDialog ofd = new OpenFileDialog())
{
     ofd.Filter = "Archivos de imágen | *.jpg;*.jpeg;*.tif;*.tiff;*.bmp;*.png";
     if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         fileName = ofd.FileName;
         byte[] imgArray = File.ReadAllBytes(fileName);
         var result = yourWcfServiceProxy.YourServiceMethod(imgArray);
     }
}


- in server side:
C#
public string YourServiceMethod(byte[] imageArray)
{
     var stream = new MemoryStream(imageArray);
     Image img = Image.FromStream(stream);
     //perform your custom actions...
}


i have a poor english but i hope you understand. ;)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900