all groups > dotnet xml > june 2005 >
You're in the

dotnet xml

group:

XML base64Binary


XML base64Binary Sheila
6/25/2005 8:05:01 PM
dotnet xml:
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

Re: XML base64Binary Chris Lovett
6/29/2005 12:47:49 AM
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);

[quoted text, click to view]

Re: XML base64Binary Mat Kramer
7/6/2005 4:23:41 PM
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

[quoted text, click to view]



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
AddThis Social Bookmark Button