473,394 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Attachments

Hi

ASP.Net v2.0

Can you send an attachment with a web-method call? If so, how?

Thanks
Kev
Jul 6 '07 #1
6 1980
Hi Mantorok,

Did you mean to send data using soap? If yes, then:

http://msdn2.microsoft.com/en-us/library/ms996944.aspx
http://www.samspublishing.com/articl...7825&seqNum=17

Regards, Alex Meleta
[TechBlog] http://devkids.blogspot.com

MHi
M>
MASP.Net v2.0
M>
MCan you send an attachment with a web-method call? If so, how?
M>
MThanks
MKev
Jul 7 '07 #2
Hi Kev,

If what you want to do is simply sending some file(binary or text) through
ASP.NET webservice, you have the following approaches:

** define a byte[] (byte array) parameter in your webservice webmethod's
input parameters (or return value if you want to download file through
webservice). Thus, when calling webservice, you can pass the file's binary
content into the input byte[] parameter.

http://support.microsoft.com/kb/318425

http://articles.techrepublic.com.com...1-5805105.html
** Directly using byte[] as webmethod parameter will have poor transfering
experience since binary to text/xml encoding will enlarge the webservice
SOAP message's size. If your application scenario can consider using some
add-on component such as WSE 3.0, you can benifit from the MTOM file
transfer encoding which will reduce binary encoding overhead in SOAP
message:

#Using Web Services Enhancements to Send SOAP Messages with Attachments
http://msdn2.microsoft.com/en-us/library/ms996944.aspx

http://msdn.microsoft.com/msdnmag/is...n/default.aspx

Hope this also helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jul 9 '07 #3
Thanks for your responses.

I was using byte arrays before and wanted to know more about attachments,
given time-constraints I won't be able to investigate the use WSE.

Kev

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:RS**************@TK2MSFTNGHUB02.phx.gbl...
Hi Kev,

If what you want to do is simply sending some file(binary or text) through
ASP.NET webservice, you have the following approaches:

** define a byte[] (byte array) parameter in your webservice webmethod's
input parameters (or return value if you want to download file through
webservice). Thus, when calling webservice, you can pass the file's binary
content into the input byte[] parameter.

http://support.microsoft.com/kb/318425

http://articles.techrepublic.com.com...1-5805105.html
** Directly using byte[] as webmethod parameter will have poor transfering
experience since binary to text/xml encoding will enlarge the webservice
SOAP message's size. If your application scenario can consider using some
add-on component such as WSE 3.0, you can benifit from the MTOM file
transfer encoding which will reduce binary encoding overhead in SOAP
message:

#Using Web Services Enhancements to Send SOAP Messages with Attachments
http://msdn2.microsoft.com/en-us/library/ms996944.aspx

http://msdn.microsoft.com/msdnmag/is...n/default.aspx

Hope this also helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 9 '07 #4
Thanks for your followup Kev,

If you have interested on using attachment based(such as the MTOM in WSE)
binary transfer, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Jul 10 '07 #5
On 10 jul, 02:20, stch...@online.microsoft.com (Steven Cheng[MSFT])
wrote:
Thanks for your followup Kev,

If you have interested on using attachment based(such as the MTOM in WSE)
binary transfer, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.
Sorry to hijack the thread, but I'm having problems transfering an
array of bytes to a jaxws webservice. I get an "Cannot find the
dispatch method" Exception. since i'm transfering very small images
(about 15kbytes each) I don't problem using this method, but I can't
get it to work correctly. Any ideas?

Regards,
Sérgio

Jul 20 '07 #6
<se*************@gmail.comwrote in message
news:11**********************@w3g2000hsg.googlegro ups.com...
On 10 jul, 02:20, stch...@online.microsoft.com (Steven Cheng[MSFT])
wrote:
Thanks for your followup Kev,

If you have interested on using attachment based(such as the MTOM in WSE)
binary transfer, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no
rights.
Sorry to hijack the thread, but I'm having problems transfering an
array of bytes to a jaxws webservice. I get an "Cannot find the
dispatch method" Exception. since i'm transfering very small images
(about 15kbytes each) I don't problem using this method, but I can't
get it to work correctly. Any ideas?
----------
"Cannot find the dispatch method" sounds like a Java error message. Perhaps
you should ask on a Java newsgroup?
--
John Saunders [MVP]

Jul 21 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: S_p_ike | last post by:
Hi all, I have a problem with mail with attachments. To send e-mail with attachments from a form, I use Setec Astronomy's libmail class (v 1.4) (available here http://www.phpclasses.org/) ...
1
by: Trond A. S. Andersen | last post by:
Hi all, I'm working on a project in which i need to send mail attachments in the form of Excel documents from a .NET C# application. I've written a class which creates the Excel document using...
1
by: nabil m | last post by:
hi i have 5 checkboxes i would like to when the user click on 1 or multiple checkbox i would like to email 1 or multiple files attachments to them ex: mailMsg.Attachments.Add(myAttachment+i); but...
5
by: Jozef | last post by:
Hello, I have an Access XP database that has attachments to a BE database that has a password. The attachments work fine, until I run some code that modifies a BE table (adding a field). I do...
2
by: Brad | last post by:
I have a web .Net app which sends emails with attachments. After the email is sent I clean up aftermyself and delete the attachments from disk. In upgrading to .Net 2 I changed the email logic...
1
by: mike11d11 | last post by:
If someone could help me, I need to be able to send attachments from my access database that I have created. This database runs queries then generates a report off the queries from underlying...
0
by: bambi | last post by:
I am facing issues while adding attachments in an E-mail via Mapisend. The code I use is below. If I try to send , I am getting error messgae in Mailmessage.12. Mailmessage.12 is expected as numeric,...
1
by: Steve Holden | last post by:
I'm having some trouble getting attachments right for all recipients, and it seems like Apple's mail.app is the pickiest client at the moment. It doesn't handle attachments that both Thunderbird...
130
by: Gianni Mariani | last post by:
Attached example CPP files makes it easier to post code and extract code from posts. It's unimaginable at this time where virtually any news reader is capable of dealing with attachments to stick...
1
by: budyerr | last post by:
All, I am trying to build a email submission form using asp.net. I currently have a web form page that will upload to my webhosting server, attach to email then delete the file after sending. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...

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.