Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. help with webservice

help with webservice

Scheduled Pinned Locked Moved ASP.NET
questionhelp
11 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chitranjan gohil
    wrote on last edited by
    #1

    Hello, i have made a webservice that has a single function getimages. i want this function to return an image that resides on my system to the client.how do i do it? thanx, chitranjan more dash than cash!!!

    E R I 3 Replies Last reply
    0
    • C chitranjan gohil

      Hello, i have made a webservice that has a single function getimages. i want this function to return an image that resides on my system to the client.how do i do it? thanx, chitranjan more dash than cash!!!

      E Offline
      E Offline
      enjoycrack
      wrote on last edited by
      #2

      Hi there, just an idea, how about your function will read and return the image as binary stream to the client... << >>

      C 1 Reply Last reply
      0
      • E enjoycrack

        Hi there, just an idea, how about your function will read and return the image as binary stream to the client... << >>

        C Offline
        C Offline
        chitranjan gohil
        wrote on last edited by
        #3

        ya i thought of that but actually i want to send a group of images back so i need to find some other way.is there any way of creating an object of a file stored on the file system.Note:- i dont want to get a reference to a file on the file system i want to have a replica of the file so that i can put it on an object array and send it back to the client. regards, chitranjan more dash than cash!!!

        E 1 Reply Last reply
        0
        • C chitranjan gohil

          ya i thought of that but actually i want to send a group of images back so i need to find some other way.is there any way of creating an object of a file stored on the file system.Note:- i dont want to get a reference to a file on the file system i want to have a replica of the file so that i can put it on an object array and send it back to the client. regards, chitranjan more dash than cash!!!

          E Offline
          E Offline
          enjoycrack
          wrote on last edited by
          #4

          IMO, You can load an image file into an image object. Then, you can return an array of image objects to client.... << >>

          C 1 Reply Last reply
          0
          • E enjoycrack

            IMO, You can load an image file into an image object. Then, you can return an array of image objects to client.... << >>

            C Offline
            C Offline
            chitranjan gohil
            wrote on last edited by
            #5

            ok gr8.can u give me a hint as to how to do it. thanx a lot chitranjan more dash than cash!!!

            E 1 Reply Last reply
            0
            • C chitranjan gohil

              ok gr8.can u give me a hint as to how to do it. thanx a lot chitranjan more dash than cash!!!

              E Offline
              E Offline
              enjoycrack
              wrote on last edited by
              #6

              Do you know how to load an image file into Image object?? refer the System.Drawing.Image or something like this, I cannot remember exactly :doh:

              J 1 Reply Last reply
              0
              • E enjoycrack

                Do you know how to load an image file into Image object?? refer the System.Drawing.Image or something like this, I cannot remember exactly :doh:

                J Offline
                J Offline
                Jetsam
                wrote on last edited by
                #7

                Or create an object with a collection of binary arrays and return that object.

                1 Reply Last reply
                0
                • C chitranjan gohil

                  Hello, i have made a webservice that has a single function getimages. i want this function to return an image that resides on my system to the client.how do i do it? thanx, chitranjan more dash than cash!!!

                  R Offline
                  R Offline
                  Ritesh Mehrotra
                  wrote on last edited by
                  #8

                  Follow these simple steps to return image to your client: 1. Create a Webmethod that return an array of bytes. For example, public byte[] GetBarCodeImage() { } 2. Create a MemoryStream Object and save your image in the stream public byte[] GetBarCodeImage() { System.IO.MemoryStream ms = new System.IO.MemoryStream(); System.Drawing.Imaging.BitMap objBitmap = new System.Drawing.Imaging.BitMap(//path); objBitmap.Save(ms ,ImageFormat.Png); return ms.GetBuffer(); } 3. At the client end, receive the byte array and do the reverse process. WebService1.Service1 obj = new WebService1.Service1(); imgBarcode = obj.getimages(strdate); MemoryStream memStream = new MemoryStream(imgBarcode); bmp=new Bitmap(memStream); pictureBox1.image = bmp; I hope this solves ur prob. Ritesh

                  1 Reply Last reply
                  0
                  • C chitranjan gohil

                    Hello, i have made a webservice that has a single function getimages. i want this function to return an image that resides on my system to the client.how do i do it? thanx, chitranjan more dash than cash!!!

                    I Offline
                    I Offline
                    Ista
                    wrote on last edited by
                    #9

                    first 1) right click the project --> Add Web Refeerence 2) in the path bar type in the path to the .wsdl file created by the web service This creates a proxy class for you to use. Now just use it 1 line of code equals many bugs. So don't write any!!

                    C 1 Reply Last reply
                    0
                    • I Ista

                      first 1) right click the project --> Add Web Refeerence 2) in the path bar type in the path to the .wsdl file created by the web service This creates a proxy class for you to use. Now just use it 1 line of code equals many bugs. So don't write any!!

                      C Offline
                      C Offline
                      chitranjan gohil
                      wrote on last edited by
                      #10

                      Hi, i did what u said.it worked.however when i run it, it gave me a 404 file not found exception.what do u think could be the reason.i have kept the .wsdl file on the general server of our company thanx, chitranjan more dash than cash!!!

                      I 1 Reply Last reply
                      0
                      • C chitranjan gohil

                        Hi, i did what u said.it worked.however when i run it, it gave me a 404 file not found exception.what do u think could be the reason.i have kept the .wsdl file on the general server of our company thanx, chitranjan more dash than cash!!!

                        I Offline
                        I Offline
                        Ista
                        wrote on last edited by
                        #11

                        You typed the wrong path for it. You can hit the web service from IE. Just type it in the explorer bar. When you get the path correct copy and paste into the wsdl screen in .NET. Its telling you 404 because the path is mis-spelled. Nick 1 line of code equals many bugs. So don't write any!!

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups