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. Advertisements

  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. Advertisements

  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. Advertisements

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. Juan Irigoyen
    Replies:
    0
    Views:
    682
    Juan Irigoyen
    Sep 2, 2004
  2. Juan Irigoyen
    Replies:
    0
    Views:
    483
    Juan Irigoyen
    Sep 1, 2004
  3. Aaron  Robson
    Replies:
    1
    Views:
    426
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Sep 2, 2004
  4. David
    Replies:
    5
    Views:
    570
    David
    Nov 27, 2004
  5. Replies:
    4
    Views:
    829
    Chris Uppal
    May 5, 2005
  6. KK
    Replies:
    2
    Views:
    1,061
    Big Brian
    Oct 14, 2003
  7. MuZZy
    Replies:
    7
    Views:
    2,094
    Mike Hewson
    Jan 7, 2005
  8. mera
    Replies:
    7
    Views:
    1,358
Loading...