469,327 Members | 1,265 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,327 developers. It's quick & easy.

XML base64Binary

Hi,

I have a web service which stores an uploaded image into SQL server, thus
there are a few things need to do:
1. Convert image to base64Binary.
2. Call web service and embed image as base64Binary in XML string.
3. Web service save image binary into SQL.

Where can i find the samples. Is there any other way to implement it.

Thanks in advance
Nov 12 '05 #1
2 11975
This should get you going:
Bitmap bmp;
XmlWriter writer;
MemoryStream stream = new MemoryStream();
bmp.Save(stream);
stream.Seek(0, SeekOrigin.Begin);
byte[] bytes = stream.GetBuffer();
writer.WriteBase64(bytes, 0, bytes.Length);

"Sheila" <Sh****@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.com...
Hi,

I have a web service which stores an uploaded image into SQL server, thus
there are a few things need to do:
1. Convert image to base64Binary.
2. Call web service and embed image as base64Binary in XML string.
3. Web service save image binary into SQL.

Where can i find the samples. Is there any other way to implement it.

Thanks in advance

Nov 12 '05 #2
If you define the web service method to take an array of Bytes as a
parameter, it will be automatically converted to/from base64 by the .NET
framework. (Use a SOAP trace tool to see for yourself.)

-Mat

"Sheila" <Sh****@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.com...
Hi,

I have a web service which stores an uploaded image into SQL server, thus
there are a few things need to do:
1. Convert image to base64Binary.
2. Call web service and embed image as base64Binary in XML string.
3. Web service save image binary into SQL.

Where can i find the samples. Is there any other way to implement it.

Thanks in advance


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by David Specht | last post: by
1 post views Thread by Heléne | last post: by
reply views Thread by Tom | last post: by
5 posts views Thread by shashidhar.yarlagadda | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by listenups61195 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.