Please Help with webservice.

Discussion in 'ASP .Net Web Services' started by klj_mcsd@hotmail.com, Jul 12, 2005.

  1. Guest

    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
     
    , Jul 12, 2005
    #1
    1. Advertising

  2. Martin Kulov Guest

    <> wrote in message
    news:...
    > 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
     
    Martin Kulov, Jul 18, 2005
    #2
    1. Advertising

  3. Hi,
    maybe you could use DIME to transfer binary content thru web service. HTH
    "Martin Kulov" <> ha scritto nel messaggio
    news:%23LcxkI%...
    > <> wrote in message
    > news:...
    >> 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, Jul 19, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. batista
    Replies:
    1
    Views:
    926
    Laurent Bugnion
    Jan 26, 2006
  2. batista
    Replies:
    0
    Views:
    568
    batista
    Jan 26, 2006
  3. Replies:
    4
    Views:
    522
    Chris Uppal
    May 5, 2005
  4. KK
    Replies:
    2
    Views:
    596
    Big Brian
    Oct 14, 2003
  5. MuZZy
    Replies:
    7
    Views:
    1,768
    Mike Hewson
    Jan 7, 2005
Loading...

Share This Page