Can't get request stream in increments - only after all sent from client

Discussion in 'ASP .Net Web Services' started by Steve Schuler, Jul 14, 2003.

  1. Hello all - I'm working an a SoapExtension to implement the SOAP with
    Attachments protocol.



    Here's a Google thread from the MS newsgroups from two years ago that frames
    the design issue mentioned in the Subject:



    http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=caac10d6
    ..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



    Basically, my goal is as follows... I'm basing my design on this MSDN
    sample:
    http://msdn.microsoft.com/msdnmag/issues/02/03/WebMethods/default.aspx.
    However, rather than rewrite the SOAP stream as this sample does, I wanted a
    more scalable solution that could defer the processing of the attachment
    portions of the stream until later, letting the WebMethod process almost
    immediately. The attachments might be very large, and be streaming in over
    a slow link, thus if I use the approach in the sample, I'll be tying up an
    ASP.NET thread for an extended interval. Instead, I would ideally read only
    enough of the stream to get the initial MIME portion (the SOAP envelope) on
    the ASP.NET thread, and spawn a separate thread to read the attachments (of
    course, this only helps if the WebMethod doesn't need to report on correct
    receipt of the attachments, but many of the apps that would use my
    SoapExtension are going to be OK with that caveat).



    But experimentation shows that the ChainStream method of my SoapExtension is
    not called until the input is completely received. I've contrived a client
    test harness to demonstrate this - I split the request in two, and the
    ChainStream method will not be called until after the very last byte has
    been sent from the client.



    This strikes me as a potential performance problem for a large class of
    applications, not just my rather esoteric app... Does anyone know of
    something I'm missing here to allow me to get the initial portion of the
    incoming request immediately?

    --
    Steve Schuler
    Application Consulting, ITOps
    Safeco Insurance Companies
    To reply with email, remove the "NOSPAM"
     
    Steve Schuler, Jul 14, 2003
    #1
    1. Advertising

  2. Steve Schuler

    Sean Kelly Guest

    Hi Steve, I was researching a problem I'm having with
    soapextensions and I came across your message. Sorry I
    don't have an answer for yours. Maybe you can help me.
    I'm debugging my extension and it enters the chainstream
    method twice before it goes into process message. Then
    when it re-enters chainstream before it goes into
    afterserialize, it loses the stream???? I saw some other
    guy having the same problem, but he had no luck getting
    answer. Anyway...talk to ya soon. Thanks.


    >-----Original Message-----
    >Hello all - I'm working an a SoapExtension to implement

    the SOAP with
    >Attachments protocol.
    >
    >
    >
    >Here's a Google thread from the MS newsgroups from two

    years ago that frames
    >the design issue mentioned in the Subject:
    >
    >
    >
    >http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-

    8&threadm=caac10d6
    >..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
    >
    >
    >
    >Basically, my goal is as follows... I'm basing my design

    on this MSDN
    >sample:
    >http://msdn.microsoft.com/msdnmag/issues/02/03/WebMethods/

    default.aspx.
    >However, rather than rewrite the SOAP stream as this

    sample does, I wanted a
    >more scalable solution that could defer the processing of

    the attachment
    >portions of the stream until later, letting the WebMethod

    process almost
    >immediately. The attachments might be very large, and be

    streaming in over
    >a slow link, thus if I use the approach in the sample,

    I'll be tying up an
    >ASP.NET thread for an extended interval. Instead, I

    would ideally read only
    >enough of the stream to get the initial MIME portion (the

    SOAP envelope) on
    >the ASP.NET thread, and spawn a separate thread to read

    the attachments (of
    >course, this only helps if the WebMethod doesn't need to

    report on correct
    >receipt of the attachments, but many of the apps that

    would use my
    >SoapExtension are going to be OK with that caveat).
    >
    >
    >
    >But experimentation shows that the ChainStream method of

    my SoapExtension is
    >not called until the input is completely received. I've

    contrived a client
    >test harness to demonstrate this - I split the request in

    two, and the
    >ChainStream method will not be called until after the

    very last byte has
    >been sent from the client.
    >
    >
    >
    >This strikes me as a potential performance problem for a

    large class of
    >applications, not just my rather esoteric app... Does

    anyone know of
    >something I'm missing here to allow me to get the initial

    portion of the
    >incoming request immediately?
    >
    >--
    >Steve Schuler
    >Application Consulting, ITOps
    >Safeco Insurance Companies
    >To reply with email, remove the "NOSPAM"
    >
    >
    >.
    >
     
    Sean Kelly, Aug 12, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nicolla MacPherson
    Replies:
    4
    Views:
    410
    Karl Heinz Buchegger
    Aug 13, 2003
  2. Replies:
    10
    Views:
    530
    Dennis Lee Bieber
    Jun 26, 2005
  3. 4ward.com

    Loop with float increments (frange)?

    4ward.com, Apr 14, 2006, in forum: Python
    Replies:
    3
    Views:
    469
    Tim Peters
    Apr 14, 2006
  4. M
    Replies:
    6
    Views:
    384
  5. Ilyas
    Replies:
    2
    Views:
    301
    George
    Nov 12, 2008
Loading...

Share This Page