[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

Re: SOAP with Attachments using MIME, no DIME

Steve Schuler

7/16/2003 8:51:00 PM

Hello Craig -

Many have asked for this, but MS hasn't widely publicized the fact that MSDN
magazine had a sample back in Feb.
http://msdn.microsoft.com/msdnmag/issues/02/03/WebMethods/de....
There's a link near the top that downloads the source code. My guesss as to
why they haven't given this more visibility is that they are pushing DIME
and WSE instead. However, some existing standards mandate SwA (I work for
an insurance company, which uses the ACORD standard, which is based on SwA).

One thing to watch out for with this sample, is that my performance testing
has shown that it's approach performs very poorly on large attachment files.
For example, on my dev machine (900 mhz PIII w/512Mb RAM), a single request
with a 1Mb attachment runs for 3 minutes at 99% CPU during the Process
Message phase, where the SwA message is being reparsed to be SOAP. I'm
rewriting this to use a different approach, which I hope will improve
performance:
1) ProcessMessage will write out the attachments as files and add an object
to the application's context that wraps the files as streams.
ProcessMessage will only have to do minimal rewriting of the incoming
stream: just lop off the MIME headers, change the Content-Type and
Content-Length, and truncate after the SOAP envelope.
2) The WebMethod will retrieve the object out of context, and call a
GetAttachmentStream method passing the href's MIME ID to get the
attachment(s).

I also looked at whether I could speed things up for large attachments in
the scenario where the client's link was slow (with the restriction that the
WebMethod wouldn't get to know if the attachment was successfully
retrieved), by putting the file-writing, and most of the stream reading in
ProcessMessage on a separate thread. However, it turns out there would be
no benefit to doing that, due to a little-publized performance issue with
ASP.NET. Here's a link to a Google thread that explains the issue:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&thread...
..0109130806.269529df%40posting.google.com&rnum=2&prev=/groups%3Fq%3Dhttpinpu
tstream%2Bmicrosoft%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3Dcaa
c10d6.0109130806.269529df%2540posting.google.com%26rnum%3D2

BTW, I've had confirmation from within MS that ASP.NET does behave this way
(and testing shows in fact that the BeginRequest event does not fire until
the entire stream has been sent by the client - no matter how large it is).

Steve Schuler,
Application Consulting, ITOps
Safeco Insurance Companies
To reply with email, remove the "NOSPAM"



"Craig Neuwirt" <cneuwirt@emsinet.com> wrote in message
news:uDRlIZxRDHA.3132@tk2msftngp13.phx.gbl...
> I am trying to support a web service specification that requires
Multi-part
> MIME over SOAP support using ASP.NET. However, ASP.NET only supports DIME
> natively. Does anyone know of a implementation of SOAP with Attachments
for
> .NET that uses MIME instead of DIME, or any other mechanism to still use
> ASP.NET Web Services?
>
> thanks,
> Craig Neuwirt
>
>