473,574 Members | 2,690 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12148
This should get you going:
Bitmap bmp;
XmlWriter writer;
MemoryStream stream = new MemoryStream();
bmp.Save(stream );
stream.Seek(0, SeekOrigin.Begi n);
byte[] bytes = stream.GetBuffe r();
writer.WriteBas e64(bytes, 0, bytes.Length);

"Sheila" <Sh****@discuss ions.microsoft. com> wrote in message
news:30******** *************** ***********@mic rosoft.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****@discuss ions.microsoft. com> wrote in message
news:30******** *************** ***********@mic rosoft.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3549
by: David Specht | last post by:
I'm having a problem with generating a proxy class for the Amazon Web Service for Merchant Integration. Per their instructions I installed WSE 2.0 and referenced the dime version of their web service. Using VS 2003 I end up with a missing location property for their ReferencedBinary object. When I use the command line tool wsewsdl2.exe...
1
6379
by: Heléne | last post by:
Hi! I have a string I want to save to database via a webmethod. The webmethod takes a dataset where my string is declared as base64binary. I have tried to convert my string to a byte array and send this to the method. This returns no error but when I read the string again only the first carachter seems to have been stored in the database....
3
1525
by: BredStik | last post by:
Hi! I have this particular problem. I have to use a base64Binary attribute as a key for one element in my schema. Everything is validating ok in XmlSpy, but when using the .Net XmlValidatingReader to validate my Xml file, the duplicate key doesn't seem to be checked. When using a string attribute type, the validation works. However, I...
13
10114
by: dbuchanan | last post by:
Hello, Here is the error message; ---------------------------- Exception Message: ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child key values (5) to exist in the parent table. ----------------------------
0
1279
by: Tom | last post by:
When I am implementing MTOM in my web service using WSE 3.0. <s:element minOccurs="0" maxOccurs="1" name="buffer" type="s:base64Binary" /> The wsdl generated still refers to my buffer as base64Binary ? I thought by using MTOM the attachment is left as binary ? so why then does the wsdl generated by ASMX still refer to base64Binary ? ...
0
2658
by: tanish2k | last post by:
hi. I am using c#, visual studio 2003. I need to validate a xml file against schema which itself has 2 more schema imported under it. i have following 2 xsd files : xsd1 ---> ------------------- <?xml version="1.0" encoding="UTF-8"?> <xs:schema
1
1128
by: baskarpr | last post by:
HI, I am a beginner in XML schema. In XML schema(XSD) how to complex type, which is restricted to base64Binary (the value of base64Binary type should be any of the values from enumeration) ? I have tried the below, but has some error, saying unexpected child element xs:enumeration. ( I am using altova's XML spy). <?xml version="1.0"...
0
1274
by: binuchirayath | last post by:
Hi All, I’m developing a windows application in which I have to implement a functionality for importing an image to a crystal report. I got two-three versions of code from Google. In all the codes the methodology followed is as given below Create a dataset (xsd) In that Create a datatable having a column for image
5
3645
by: shashidhar.yarlagadda | last post by:
hi, hey! i am writing an XML Schema Defination where i got a sistutation in such way that i need to defina a tag that should hold binary data (ASCII data). How can i handle this sistutation? I mean what datatype i need to mention. i saw the base64Binary data type but it will not support all the ascii characters right? In this scenario can...
0
7732
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8063
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8243
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7822
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5626
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3754
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2249
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.