2 // Microsoft.Web.Services.Messaging.SoapTransport.cs
4 // Author: Todd Berman <tberman@gentoo.org>
6 // (C) 2003 Todd Berman
11 namespace Microsoft
.Web
.Services
.Messaging
13 public abstract class SoapTransport
15 private SoapChannelCollection _channels
;
16 private ICredentials _credentials
;
17 private ISoapFormatter _formatter
;
20 [MonoTODO("DimeFormatter is the default here, but not impl yet")]
21 protected SoapTransport () : base ()
24 _formatter
= new SoapPlainFormatter ();
25 _channels
= new SoapChannelCollection ();
29 public SoapChannelCollection Channels
{
30 get { return _channels; }
33 public ICredentials Credentials
{
34 get { return _credentials; }
35 set { _credentials = value; }
38 public ISoapFormatter Formatter
{
39 get { return _formatter; }
42 throw new ArgumentNullException ("formatter");
48 public int IdleTimeout
{
49 get { return _timeout; }
52 throw new ArgumentNullException ("Timeout");
58 protected class SendAsyncResult
: AsyncResult
60 private delegate void Send (SoapEnvelope env
);
62 private SoapChannel _channel
;
64 public SendAsyncResult (SoapChannel chan
,
66 AsyncCallback callback
,
67 object state
) : base (callback
, state
)
70 chan
.BeginSend (env
, new AsyncCallback (OnSendComplete
), null);
73 public void OnSendComplete (IAsyncResult result
)
76 _channel
.EndSend (result
);
77 Complete (result
.CompletedSynchronously
);
78 } catch (Exception e
) {
79 Complete (result
.CompletedSynchronously
, e
);
83 public SoapChannel Channel
{
84 get { return _channel; }