File Upload using XML WebServices

P

P@B1o

Hello,
I need to create an XML WebService that will allow to upload files to
the server. Does anyone have an example of such service or know where
I could find any information that could help me in building it?

I am a newbie in WebServices programming and SOAP so I need something
that will explain the process in detail.

Thank you in advance

p@b10
 
D

Daniel Cummings

Hiya,

You need to convert the binary file into something that can be
transferred via XML. The easiest way is to Base64 encode the binary so
that it's represented as a string. This means that the code that
consumes the webservice must convert the binary to Base64 before
sending it as a parameter and then your webservice code must convert
the parameter back into its' binary form.

Fortunately MS saw this one coming and put in a pair of static Base64
conversion methods into the .NET Framework :

System.Convert.ToBase64String
and
System.Convert.FromBase64String

You'll need to get your binary into a byte array to pass to
ToBase64String and FromBase64String will return a byte array.

Hope this helps!

Dan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top