472,131 Members | 1,332 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,131 software developers and data experts.

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 12070
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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.