Please Help with webservice.

K

klj_mcsd

I get the file in the webservice like this.


bImage = New Bitmap("C:\Inetpub\wwwroot\ima­ges\GR4001.PNG")
'Save as PNG file
bImage.Save(bFile,
System.Drawing.Imaging.ImageFo­rmat.Png)
'Return Binary file in a byte array
Return bFile.GetBuffer()


Now I call the webservice like this.


Response.ContentType = "image/png"
Set objHTTP = Server.CreateObject("Msxml2.Se­rverXMLHTTP")
' Point to an image file with adequate access permissions granted
objHTTP.open "GET",
"http://localhost/wsImage/wsImage.asmx/GetSpecimenImage", false
objHTTP.send
Response.BinaryWrite objHTTP.ResponseBody
Set objHTTP = Nothing


Nothing appears in the browser window but I get the binary back. Please

Help
 
M

Martin Kulov

S

Saverio Tedeschi

Hi,
maybe you could use DIME to transfer binary content thru web service. HTH
Martin Kulov said:
Nothing appears in the browser window but I get the binary back.


Hi,

you can use aspx page to return image data to the client. IMHO web service
call won't work since the web service returns soap body in the HTTP stream
and the img tag expects binary data instead.
Look here for an example [1].

[1] http://www.csharp-station.com/Articles/Thumbnails.aspx

HTH,

--
Martin Kulov
http://www.codeattest.com/blogs/martin

MCAD Charter Member
MCSD.NET Early Achiever
MCSD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top