|
-
Jan 4th, 2002, 04:28 PM
#1
Thread Starter
Hyperactive Member
binary data through web service
How can I return for example a picture (or any other binary file) by WebMethod function?
Thanks
-
Jan 4th, 2002, 04:43 PM
#2
hmm good question
Perhaps create a GDI Graphics object(dont know the namespace off the top of my head) that the Function can return
Code:
<Webmethod()>Public Function myImage() As Graphics
End Function
Do some searching for GDI+ to find info on loading an Image to the Graphics object and whatever namespaces needed
IO namespaces/classes might be able to be used for other files..
Cant be 100% sure on this though.
-
Jan 6th, 2002, 07:36 AM
#3
Thread Starter
Hyperactive Member
-
Jan 7th, 2002, 09:35 AM
#4
Ill do some looking around to see what I can find since this is an interesting idea.
-
Jan 7th, 2002, 09:41 AM
#5
ack.. doesnt look possible according to this
http://samples.gotdotnet.com/quickst...vicetypes.aspx
i guess the only option is to break it down into a byte array that the client would have to manually code to rebuild.
-
Jan 8th, 2002, 01:24 PM
#6
Thread Starter
Hyperactive Member
This seems to be quite good argument. 
However, I think there should be some better support for binaries (or text files as well) than splitting it into an array, what is not so good idea. Imagine, even sending <byte> and </byte> enlarges the file 7 times (in addition to spaces, bytes represented by string, and line feeds).
I don't believe realizing such simple services, as get an image, do some effects and return image, or translate documents or whatever else, will be too complicated, or?
Another poor idea - to encode the file (uuencode, mime) and to send it as long string or something.
-
Jan 8th, 2002, 01:34 PM
#7
well yeah as a string would be ok to...I really meant to say byte array or as a string.... Either way there just isnt any better option as now that I think about it, binary support would go outside the bounds of what xml does and I believe MS is trying to get away from adding propietary functionailty to open standards.
-
Jan 8th, 2002, 05:37 PM
#8
Thread Starter
Hyperactive Member
Well, it seems there is not any other possibility , so...
I have web service returning encoded image as string
I think there is no problem, encoding can be done manually, if not already present in some system libraries
Client is an ASP.NET page
which should encode and display the image. And here I have no idea how to transform a string into bitmap...
...unless... ... unless I force IE to encode and display the image itself, as in MHT files. But this would limite reciever to use only IE...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|