Daniela and Keith,
Rick Strahl posted a message that provide sample .NET code to take the received byte array and create an image file. The message #
863609 is the one to look at.
>Daniela,
>
>.NET likes images to be byte arrays - "Dim myImage() as Byte = CType(lcImage.ToArray(), Byte())". You might be okay passing the image as a string, but you will most likely run into character encoding problems based on your server's locale information. Try copying the string into an array in VFP and then sending the array to the Web Service.
>
>In the Web Service, once you have the image in a byte array, you can use the FileStream/StreamWriter or File classes to write the image to disk.
>
>Also, it will be neccessary to pass in the image MIME type (JPG, GIF, BMP, etc...) with the image so you know how to name the output file.
>
>I'm sorry that I can't post some sample code right now - I'm away from my development machine. I will check this thread later tonight to see if I can be more helpful.
>
>Good luck!
>
>>I have a problem to passing an image from a VFP app to a .NET web service
>>
>>In the VFP application I have something like:
>>
>>local lcImage
>>lcImage = FILETOSTR("c:\test.jpg")
>>oWs = CREATEOBJECT("MSSOAP.SoapClient")
>>oWs.MSSoapInit("
http://theserver/ws.wsdl")
>>Ws.TransferImage(lcImage)
>>release oWs
>>
>>In the webservice I have a webmethod as following:
>>
>>WebMethod(Description:="Transfer image", EnableSession:=False) _
>>Public Sub TransferImage(ByVal lcImage As String)
>>
>>' in this method I'd like to read lcImage parameter and save it to the disk (as a .jpg file)
>>
>>End Sub
>>
>>Is it possible? Someone can help me?
>>
>>Thanks in advance
>>
>>Daniela
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi