sending an image by webservice..

M

Milsnips

hi there,

is this possible?

i want the user to upload a image on their website, then i want to send it
by webservice ( or another method to a second webserver) and store it there
also?

thanks,
 
S

Scott Mitchell [MVP]

Milsnips said:
i want the user to upload a image on their website, then i want to send it
by webservice ( or another method to a second webserver) and store it there
also?

Look into using DIME and WS-Attachments. I have an article on this very
topic here:

An Extensive Examination of Web Services: Part 10
http://aspnet.4guysfromrolla.com/articles/090804-1.aspx

In fact, you may want to read the entire (currently) 10-part series on
Web services I've written... it starts here:
http://aspnet.4guysfromrolla.com/articles/100803-1.aspx

You could also pick up a copy of my .NET Web Services DVD at
http://www.amazon.com/exec/obidos/ASIN/B0002AHVPA/4guysfromrollaco -
it's a two-disc DVD with ~10 hours of training on creating and consuming
Web services, examining the core Web service standards along with WSE.
In fact, the *entire* ~30-minute Chapter 14 on using DIME and
WS-Attachments can be found online at
http://dvpress.com/ecom/Downloads/Sample_Clips.aspx

Happy Programming!

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
 
N

Nitin

well yes u can upload the image file by calling web service method,
the Web services toolkits support adding attachments to SOAP messages using
an object model, so that you are abstracted from the details of populating
HTTP headers and building the compound SOAP message. Thanks to the generation
of Web service proxies, in a few lines of code you can create a DIME
attachment from a binary stream, attach it to the outgoing attachments
collection, and invoke the Web service method, as shown here for a .NET Web
service.
DimeAttachment attachment =
new DimeAttachment("image/jpeg",
TypeFormatEnum.MediaType,
data);
svc.RequestSoapContext.Attachments.Add(attachment);
svc.SignAttachment(text);

more information about Soap specificaion for attachment can be found at
http://www.w3.org/TR/SOAP-attachments
 

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,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top