Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Services (http://www.velocityreviews.com/forums/f64-asp-net-web-services.html)
-   -   Please Help with webservice. (http://www.velocityreviews.com/forums/t785154-please-help-with-webservice.html)

klj_mcsd@hotmail.com 07-12-2005 07:18 PM

Please Help with webservice.
 
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


Martin Kulov 07-18-2005 09:46 PM

Re: Please Help with webservice.
 
<klj_mcsd@hotmail.com> wrote in message
news:1121195894.734746.60820@g47g2000cwa.googlegro ups.com...
> 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


Saverio Tedeschi 07-19-2005 08:26 PM

Re: Please Help with webservice.
 
Hi,
maybe you could use DIME to transfer binary content thru web service. HTH
"Martin Kulov" <kulov@bezbokluk.abv.bg> ha scritto nel messaggio
news:%23LcxkI%23iFHA.3064@TK2MSFTNGP15.phx.gbl...
> <klj_mcsd@hotmail.com> wrote in message
> news:1121195894.734746.60820@g47g2000cwa.googlegro ups.com...
>> 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
>





All times are GMT. The time now is 08:57 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.