Soap Extension problem (seems that soap request is not sent to server)

Discussion in 'ASP .Net Web Services' started by Frederik Vanderhaegen, Oct 20, 2006.

  1. Hi,

    I'm writing a simple soap extension for a webservice I developed (without
    the use of an extension the webservice works perfect).
    The extension is registered through the web.config files of my webservice
    and my application.
    In my extension I override the Chainstream method and implement the abstract
    methods (GetInitializer, Initialize and ProcessMessage)

    my chainstream method:
    Stream _Original;
    Stream _Chainned;

    public override Stream ChainStream( Stream stream )
    {
    _Original = stream;
    _Chainned = new MemoryStream();
    return _Chainned;
    }

    my GetInitializer methods return null.
    The processMessage (simplified) function:

    public override void ProcessMessage(SoapMessage message)
    {
    switch (message.Stage)
    {
    case SoapMessageStage.BeforeSerialize:
    if(message is System.Web.SoapClientMessage)
    System.Diagnostics.Debug.WriteLine("Client
    BeforeSerialize");
    else
    System.Diagnostics.Debug.WriteLine("Server
    BeforeSerialize");
    break;
    case SoapMessageStage.AfterSerialize:
    if(message is System.Web.SoapClientMessage)
    System.Diagnostics.Debug.WriteLine("Client
    AfterSerialize");
    else
    System.Diagnostics.Debug.WriteLine("Server
    AfterSerialize");
    break;
    case SoapMessageStage.BeforeDeserialize:
    if(message is System.Web.SoapClientMessage)
    System.Diagnostics.Debug.WriteLine("Client
    BeforeDeserialize");
    else
    System.Diagnostics.Debug.WriteLine("Server
    BeforeDeserialize");
    break;
    case SoapMessageStage.AfterDeserialize:
    if(message is System.Web.SoapClientMessage)
    System.Diagnostics.Debug.WriteLine("Client
    AfterDeserialize");
    else
    System.Diagnostics.Debug.WriteLine("Server
    AfterDeserialize");
    break;
    }
    }

    So far the introduction, my problem is the following:
    When I register the extension on both the client and the server and set a
    breakpoint on the line "Server BeforeDeserialize",
    the _Original and _Chainned variables are null => no soap message is
    available.
    When I register the extension on only the server then the two variables are
    also null but when I then change the ChainStream method to
    public override Stream ChainStream( Stream stream )
    {
    if(stream.GetType().FullName="System.Web.HttpInputStream")
    return stream;
    _Original = stream;
    _Chainned = new MemoryStream();
    return _Chainned;
    }

    everything works perfect for the server side.

    I've tried a lot of different things but nothing seems to resolve my
    problem.
    It looks like I'm unable to send the soap request from my client to my
    server, in "Client AfterSerialize" everything is perfect but in "Server
    BeforeDeserialize" no message has been received.

    Is there anyone who knows what I'm doing wrong?

    Thx in advance

    Frederik
     
    Frederik Vanderhaegen, Oct 20, 2006
    #1
    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. Chris Hayes
    Replies:
    0
    Views:
    667
    Chris Hayes
    Jul 27, 2005
  2. CreativeMind
    Replies:
    2
    Views:
    325
    CreativeMind
    Apr 27, 2010
  3. David Hayward via .NET 247

    SOAP Header Not Sent If Exception Thrown

    David Hayward via .NET 247, May 23, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    122
    David Hayward via .NET 247
    May 23, 2005
  4. Najati Imam
    Replies:
    2
    Views:
    489
  5. Randell D.
    Replies:
    9
    Views:
    210
    Randell D.
    Feb 8, 2005
Loading...

Share This Page