Imported Upstream version 4.2.0.179

Former-commit-id: 4610231f55806d2a05ed69e5ff3faa7336cc1479
This commit is contained in:
Xamarin Public Jenkins
2015-08-26 07:17:56 -04:00
committed by Jo Shields
parent aa7da660d6
commit c042cd0c52
7507 changed files with 90259 additions and 657307 deletions

View File

@@ -1,66 +0,0 @@
//
// System.Web.Services.Protocols.AnyReturnReader.cs
//
// Author:
// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Tim Coleman, 2002
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.IO;
using System.Net;
using System.Web.Services;
namespace System.Web.Services.Protocols {
public class AnyReturnReader : MimeReturnReader {
#region Constructors
public AnyReturnReader ()
{
}
#endregion // Constructors
#region Methods
public override object GetInitializer (LogicalMethodInfo methodInfo)
{
return null;
}
public override void Initialize (object o)
{
// do nothing
}
// returns the input HTTP response stream.
public override object Read (WebResponse response, Stream responseStream)
{
return responseStream;
}
#endregion // Methods
}
}

View File

@@ -1,55 +0,0 @@
//
// System.Web.Services.Protocols.HtmlFormParameterReader.cs
//
// Author:
// Tim Coleman (tim@timcoleman.com)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// Copyright (C) Tim Coleman, 2002
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Web;
using System.Web.Services;
namespace System.Web.Services.Protocols {
public class HtmlFormParameterReader : ValueCollectionParameterReader {
#region Constructors
public HtmlFormParameterReader ()
{
}
#endregion // Constructors
#region Methods
public override object[] Read (HttpRequest request)
{
return Read (request.Form);
}
#endregion // Methods
}
}

View File

@@ -1,71 +0,0 @@
//
// System.Web.Services.Protocols.HtmlFormParameterWriter.cs
//
// Author:
// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Tim Coleman, 2002
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.IO;
using System.Net;
using System.Web.Services;
namespace System.Web.Services.Protocols {
public class HtmlFormParameterWriter : UrlEncodedParameterWriter {
#region Constructors
public HtmlFormParameterWriter ()
{
}
#endregion // Constructors
#region Properties
public override bool UsesWriteRequest {
get { return true; }
}
#endregion // Properties
#region Methods
public override void InitializeRequest (WebRequest request, object[] values)
{
if (RequestEncoding == null) request.ContentType = "application/x-www-form-urlencoded";
else request.ContentType = "application/x-www-form-urlencoded; charset=" + RequestEncoding.BodyName;
}
public override void WriteRequest (Stream requestStream, object[] values)
{
StreamWriter sw = new StreamWriter (requestStream);
Encode (sw, values);
sw.Flush ();
}
#endregion // Methods
}
}

View File

@@ -1,62 +0,0 @@
//
// System.Web.Services.Protocols.HttpGetClientProtocol.cs
//
// Author:
// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Tim Coleman, 2002
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Net;
using System.Web.Services;
namespace System.Web.Services.Protocols {
public class HttpGetClientProtocol : HttpSimpleClientProtocol {
#region Constructors
public HttpGetClientProtocol ()
{
TypeStub = (HttpSimpleTypeStubInfo) TypeStubManager.GetTypeStub (GetType(), "HttpGet");
}
#endregion // Constructors
#region Methods
protected override WebRequest GetWebRequest (Uri uri)
{
if (uri == null)
throw new InvalidOperationException ("The uri parameter is null.");
if (uri.ToString () == String.Empty)
throw new InvalidOperationException ("The uri parameter has a length of zero.");
WebRequest request = WebRequest.Create (uri);
request.Method = "GET";
return request;
}
#endregion // Methods
}
}

View File

@@ -1,62 +0,0 @@
//
// HttpGetTypeStubInfo.cs: Information about a method and its mapping to a SOAP web service.
//
// Author:
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Ximian, Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.Web.Services.Protocols
{
internal class HttpGetMethodStubInfo : HttpSimpleMethodStubInfo
{
public HttpGetMethodStubInfo (TypeStubInfo parent, LogicalMethodInfo source): base (parent, source)
{
ParameterReaderType = new MimeFormatterInfo (typeof(UrlParameterReader));
ReturnWriterType = new MimeFormatterInfo (typeof(XmlReturnWriter));
if (ParameterWriterType == null) ParameterWriterType = new MimeFormatterInfo (typeof(UrlParameterWriter));
}
}
internal class HttpGetTypeStubInfo : HttpSimpleTypeStubInfo
{
public HttpGetTypeStubInfo (LogicalTypeInfo logicalTypeInfo): base (logicalTypeInfo)
{
}
public override string ProtocolName
{
get { return "HttpGet"; }
}
protected override MethodStubInfo CreateMethodStubInfo (TypeStubInfo typeInfo, LogicalMethodInfo methodInfo, bool isClientProxy)
{
if (isClientProxy && methodInfo.ActualMethodInfo.GetCustomAttributes (typeof(HttpMethodAttribute),true).Length == 0) return null;
if (!ValueCollectionParameterReader.IsSupported (methodInfo)) return null;
return new HttpGetMethodStubInfo (typeInfo, methodInfo);
}
}
}

View File

@@ -1,62 +0,0 @@
//
// System.Web.Services.Protocols.HttpPostClientProtocol.cs
//
// Author:
// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Tim Coleman, 2002
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Net;
using System.Web.Services;
namespace System.Web.Services.Protocols {
public class HttpPostClientProtocol : HttpSimpleClientProtocol {
#region Constructors
public HttpPostClientProtocol ()
{
TypeStub = (HttpSimpleTypeStubInfo) TypeStubManager.GetTypeStub (GetType(), "HttpPost");
}
#endregion // Constructors
#region Methods
protected override WebRequest GetWebRequest (Uri uri)
{
if (null == uri)
throw new InvalidOperationException ("The uri parameter is a null reference.");
if (String.Empty == uri.ToString ())
throw new InvalidOperationException ("The uri parameter has a length of zero.");
WebRequest request = WebRequest.Create (uri);
request.Method = "POST";
return request;
}
#endregion // Methods
}
}

View File

@@ -1,62 +0,0 @@
//
// HttpPostTypeStubInfo.cs: Information about a method and its mapping to a SOAP web service.
//
// Author:
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Ximian, Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.Web.Services.Protocols
{
internal class HttpPostMethodStubInfo : HttpSimpleMethodStubInfo
{
public HttpPostMethodStubInfo (TypeStubInfo parent, LogicalMethodInfo source): base (parent, source)
{
ParameterReaderType = new MimeFormatterInfo (typeof(HtmlFormParameterReader));
ReturnWriterType = new MimeFormatterInfo (typeof(XmlReturnWriter));
if (ParameterWriterType == null) ParameterWriterType = new MimeFormatterInfo (typeof(HtmlFormParameterWriter));
}
}
internal class HttpPostTypeStubInfo : HttpSimpleTypeStubInfo
{
public HttpPostTypeStubInfo (LogicalTypeInfo logicalTypeInfo): base (logicalTypeInfo)
{
}
public override string ProtocolName
{
get { return "HttpPost"; }
}
protected override MethodStubInfo CreateMethodStubInfo (TypeStubInfo typeInfo, LogicalMethodInfo methodInfo, bool isClientProxy)
{
if (isClientProxy && methodInfo.ActualMethodInfo.GetCustomAttributes (typeof(HttpMethodAttribute),true).Length == 0) return null;
if (!ValueCollectionParameterReader.IsSupported (methodInfo)) return null;
return new HttpPostMethodStubInfo (typeInfo, methodInfo);
}
}
}

View File

@@ -1,221 +0,0 @@
//
// System.Web.Services.Protocols.HttpSimpleClientProtocol.cs
//
// Author:
// Tim Coleman (tim@timcoleman.com)
// Lluis Sanchez Gual (lluis@ximian.com)
//
// Copyright (C) Tim Coleman, 2002
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Web.Services;
using System.Net;
using System.IO;
using System.Threading;
namespace System.Web.Services.Protocols {
[System.Runtime.InteropServices.ComVisible (true)]
public abstract class HttpSimpleClientProtocol : HttpWebClientProtocol {
#region Fields
internal HttpSimpleTypeStubInfo TypeStub;
#endregion // Fields
#region Constructors
protected HttpSimpleClientProtocol ()
{
}
#endregion // Constructors
#region Methods
protected IAsyncResult BeginInvoke (string methodName, string requestUrl, object[] parameters, AsyncCallback callback, object asyncState)
{
HttpSimpleMethodStubInfo method = (HttpSimpleMethodStubInfo) TypeStub.GetMethod (methodName);
SimpleWebClientAsyncResult ainfo = null;
try
{
MimeParameterWriter parameterWriter = (MimeParameterWriter) method.ParameterWriterType.Create ();
string url = parameterWriter.GetRequestUrl (requestUrl, parameters);
WebRequest req = GetWebRequest (new Uri(url));
ainfo = new SimpleWebClientAsyncResult (req, callback, asyncState);
ainfo.Parameters = parameters;
ainfo.ParameterWriter = parameterWriter;
ainfo.Method = method;
ainfo.Request = req;
ainfo.Request.BeginGetRequestStream (new AsyncCallback (AsyncGetRequestStreamDone), ainfo);
RegisterMapping (asyncState, ainfo);
}
catch (Exception ex)
{
if (ainfo != null)
ainfo.SetCompleted (null, ex, false);
else
throw ex;
}
return ainfo;
}
void AsyncGetRequestStreamDone (IAsyncResult ar)
{
SimpleWebClientAsyncResult ainfo = (SimpleWebClientAsyncResult) ar.AsyncState;
try
{
if (ainfo.ParameterWriter.UsesWriteRequest)
{
Stream stream = ainfo.Request.GetRequestStream ();
ainfo.ParameterWriter.WriteRequest (stream, ainfo.Parameters);
stream.Close ();
}
ainfo.Request.BeginGetResponse (new AsyncCallback (AsyncGetResponseDone), ainfo);
}
catch (Exception ex)
{
ainfo.SetCompleted (null, ex, true);
}
}
void AsyncGetResponseDone (IAsyncResult ar)
{
SimpleWebClientAsyncResult ainfo = (SimpleWebClientAsyncResult) ar.AsyncState;
WebResponse response = null;
try {
response = GetWebResponse (ainfo.Request, ar);
}
catch (WebException ex) {
response = ex.Response;
HttpWebResponse http_response = response as HttpWebResponse;
if (http_response == null || http_response.StatusCode != HttpStatusCode.InternalServerError) {
ainfo.SetCompleted (null, ex, true);
return;
}
}
catch (Exception ex) {
ainfo.SetCompleted (null, ex, true);
return;
}
try {
MimeReturnReader returnReader = (MimeReturnReader) ainfo.Method.ReturnReaderType.Create ();
object result = returnReader.Read (response, response.GetResponseStream ());
ainfo.SetCompleted (result, null, true);
}
catch (Exception ex) {
ainfo.SetCompleted (null, ex, true);
}
}
protected object EndInvoke (IAsyncResult asyncResult)
{
if (!(asyncResult is SimpleWebClientAsyncResult))
throw new ArgumentException ("asyncResult is not the return value from BeginInvoke");
SimpleWebClientAsyncResult ainfo = (SimpleWebClientAsyncResult) asyncResult;
lock (ainfo)
{
if (!ainfo.IsCompleted)
ainfo.WaitForComplete ();
UnregisterMapping (ainfo.AsyncState);
if (ainfo.Exception != null)
throw ainfo.Exception;
else
return ainfo.Result;
}
}
protected object Invoke (string methodName, string requestUrl, object[] parameters)
{
HttpSimpleMethodStubInfo method = (HttpSimpleMethodStubInfo) TypeStub.GetMethod (methodName);
MimeParameterWriter parameterWriter = (MimeParameterWriter) method.ParameterWriterType.Create ();
string url = parameterWriter.GetRequestUrl (requestUrl, parameters);
WebRequest request = GetWebRequest (new Uri(url, true));
parameterWriter.InitializeRequest (request, parameters);
if (parameterWriter.UsesWriteRequest)
{
Stream stream = request.GetRequestStream ();
parameterWriter.WriteRequest (stream, parameters);
stream.Close ();
}
WebResponse response = GetWebResponse (request);
MimeReturnReader returnReader = (MimeReturnReader) method.ReturnReaderType.Create ();
return returnReader.Read (response, response.GetResponseStream ());
}
protected void InvokeAsync (string methodName, string requestUrl, object[] parameters, SendOrPostCallback callback)
{
InvokeAsync (methodName, requestUrl, parameters, callback, null);
}
protected void InvokeAsync (string methodName, string requestUrl, object[] parameters, SendOrPostCallback callback, object userState)
{
InvokeAsyncInfo info = new InvokeAsyncInfo (callback, userState);
BeginInvoke (methodName, requestUrl, parameters, new AsyncCallback (InvokeAsyncCallback), info);
}
void InvokeAsyncCallback (IAsyncResult ar)
{
InvokeAsyncInfo info = (InvokeAsyncInfo) ar.AsyncState;
SimpleWebClientAsyncResult sar = (SimpleWebClientAsyncResult) ar;
InvokeCompletedEventArgs args = new InvokeCompletedEventArgs (sar.Exception, false, info.UserState, (object[]) sar.Result);
if (info.Context != null)
info.Context.Send (info.Callback, args);
else
info.Callback (args);
}
#endregion // Methods
}
internal class SimpleWebClientAsyncResult : WebClientAsyncResult
{
public SimpleWebClientAsyncResult (WebRequest request, AsyncCallback callback, object asyncState)
: base (request, callback, asyncState)
{
}
public object[] Parameters;
public HttpSimpleMethodStubInfo Method;
public MimeParameterWriter ParameterWriter;
}
}

View File

@@ -1,147 +0,0 @@
//
// HttpSimpleMethodStubInfo.cs: Information about a method and its mapping to a SOAP web service.
//
// Author:
// Lluis Sanchez Gual (lluis@ximian.com)
//
// (C) 2003 Ximian, Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Reflection;
using System.Collections;
using System.Xml;
using System.Xml.Serialization;
using System.Web.Services;
using System.Web.Services.Description;
namespace System.Web.Services.Protocols
{
enum FormatterKind
{
ParameterWriter,
ParameterReader,
ReturnReader,
ReturnWriter
}
internal abstract class HttpSimpleMethodStubInfo : MethodStubInfo
{
public MimeFormatterInfo ParameterWriterType;
public MimeFormatterInfo ParameterReaderType;
public MimeFormatterInfo ReturnReaderType;
public MimeFormatterInfo ReturnWriterType;
public MimeFormatterInfo GetFormatterInfo (FormatterKind kind)
{
switch (kind)
{
case FormatterKind.ParameterWriter: return ParameterWriterType;
case FormatterKind.ParameterReader: return ParameterReaderType;
case FormatterKind.ReturnReader: return ReturnReaderType;
case FormatterKind.ReturnWriter: return ReturnWriterType;
}
return null;
}
public HttpSimpleMethodStubInfo (TypeStubInfo parent, LogicalMethodInfo source): base (parent, source)
{
object[] atts = source.CustomAttributeProvider.GetCustomAttributes (typeof(HttpMethodAttribute), true);
if (atts.Length > 0)
{
HttpMethodAttribute at = (HttpMethodAttribute) atts[0];
ParameterWriterType = new MimeFormatterInfo (at.ParameterFormatter);
ReturnReaderType = new MimeFormatterInfo (at.ReturnFormatter);
}
if (ReturnReaderType == null) {
if (source.IsVoid) ReturnReaderType = new MimeFormatterInfo (typeof(NopReturnReader));
else ReturnReaderType = new MimeFormatterInfo (typeof(XmlReturnReader));
}
}
}
internal class MimeFormatterInfo
{
public MimeFormatterInfo (Type type) {
Type = type;
}
public MimeFormatter Create () {
return MimeFormatter.CreateInstance (Type, Initializer);
}
public Type Type;
public object Initializer;
}
internal abstract class HttpSimpleTypeStubInfo : TypeStubInfo
{
public HttpSimpleTypeStubInfo (LogicalTypeInfo logicalTypeInfo): base (logicalTypeInfo)
{
}
protected override void BuildTypeMethods ()
{
base.BuildTypeMethods ();
BuildInitializers (FormatterKind.ParameterWriter);
BuildInitializers (FormatterKind.ParameterReader);
BuildInitializers (FormatterKind.ReturnReader);
BuildInitializers (FormatterKind.ReturnWriter);
}
void BuildInitializers (FormatterKind formatter)
{
Hashtable types = new Hashtable ();
foreach (HttpSimpleMethodStubInfo met in Methods)
AddType (types, met.GetFormatterInfo (formatter).Type, met);
foreach (DictionaryEntry ent in types)
{
Type t = (Type)ent.Key;
ArrayList list = (ArrayList)ent.Value;
LogicalMethodInfo[] mets = new LogicalMethodInfo [list.Count];
for (int n=0; n<list.Count; n++)
mets[n] = ((MethodStubInfo)list[n]).MethodInfo;
object[] inits = MimeFormatter.GetInitializers (t, mets);
for (int n=0; n<list.Count; n++)
((HttpSimpleMethodStubInfo)list[n]).GetFormatterInfo (formatter).Initializer = inits[n];
}
}
void AddType (Hashtable types, Type type, HttpSimpleMethodStubInfo method)
{
ArrayList list = (ArrayList) types [type];
if (list == null)
{
list = new ArrayList ();
types [type] = list;
}
list.Add (method);
}
}
}

View File

@@ -1,135 +0,0 @@
//
// System.Web.Services.Protocols.HttpSimpleWebServiceHandler.cs
//
// Author:
// Lluis Sanchez Gual (lluis@ximian.com)
//
// Copyright (C) Ximian, Inc. 2003
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Reflection;
using System.IO;
using System.Web.Services;
namespace System.Web.Services.Protocols
{
internal class HttpSimpleWebServiceHandler: WebServiceHandler
{
HttpSimpleTypeStubInfo _typeInfo;
HttpSimpleMethodStubInfo method;
public HttpSimpleWebServiceHandler (Type type, string protocolName)
: base (type)
{
_typeInfo = (HttpSimpleTypeStubInfo) TypeStubManager.GetTypeStub (type, protocolName);
}
protected HttpSimpleTypeStubInfo TypeStub
{
get { return _typeInfo; }
}
internal override MethodStubInfo GetRequestMethod (HttpContext context)
{
string name = context.Request.PathInfo;
if (name.StartsWith ("/"))
name = name.Substring (1);
method = (HttpSimpleMethodStubInfo) _typeInfo.GetMethod (name);
if (method == null)
WriteError (context, "Method " + name + " not defined in service " + ServiceType.Name);
return method;
}
public override void ProcessRequest (HttpContext context)
{
Context = context;
Stream respStream = null;
Exception error = null;
try
{
if (method == null)
method = (HttpSimpleMethodStubInfo) GetRequestMethod (context);
if (method.MethodInfo.EnableSession)
Session = context.Session;
MimeParameterReader parameterReader = (MimeParameterReader) method.ParameterReaderType.Create ();
object[] parameters = parameterReader.Read (context.Request);
MimeReturnWriter returnWriter = (MimeReturnWriter) method.ReturnWriterType.Create ();
object result = Invoke (method.MethodInfo, parameters);
respStream = context.Response.OutputStream;
returnWriter.Write (context.Response, respStream, result);
}
catch (Exception ex)
{
error = ex;
}
if (error != null)
WriteError (context, error.ToString ());
if (respStream != null)
respStream.Close ();
}
void WriteError (HttpContext context, string msg)
{
try
{
context.Response.ContentType = "text/plain";
context.Response.StatusCode = 500;
context.Response.Write (msg);
context.Response.End ();
}
catch {}
}
object Invoke (LogicalMethodInfo method, object[] parameters)
{
try
{
object server = CreateServerInstance ();
try {
object[] res = method.Invoke (server, parameters);
if (!method.IsVoid) return res[0];
else return null;
}
finally {
IDisposable disp = server as IDisposable;
if (disp != null)
disp.Dispose();
}
}
catch (TargetInvocationException ex)
{
throw ex.InnerException;
}
}
}
}

View File

@@ -1,413 +0,0 @@
//
// System.Web.Services.Protocols.HttpSoapWebServiceHandler.cs
//
// Author:
// Lluis Sanchez Gual (lluis@ximian.com)
//
// Copyright (C) Ximian, Inc. 2003
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Net;
using System.Web;
using System.Xml;
using System.Text;
using System.IO;
using System.Reflection;
using System.Xml.Serialization;
#if !MOBILE
using System.Web.Services.Description;
#endif
namespace System.Web.Services.Protocols
{
internal class HttpSoapWebServiceHandler: WebServiceHandler
{
SoapTypeStubInfo _typeStubInfo;
SoapExtension[] _extensionChainHighPrio;
SoapExtension[] _extensionChainMedPrio;
SoapExtension[] _extensionChainLowPrio;
SoapMethodStubInfo methodInfo;
SoapServerMessage requestMessage = null;
public HttpSoapWebServiceHandler (Type type): base (type)
{
_typeStubInfo = (SoapTypeStubInfo) TypeStubManager.GetTypeStub (ServiceType, "Soap");
}
public override bool IsReusable
{
get { return false; }
}
internal override MethodStubInfo GetRequestMethod (HttpContext context)
{
try
{
requestMessage = DeserializeRequest (context);
return methodInfo;
}
catch (Exception ex)
{
SerializeFault (context, requestMessage, ex);
return null;
}
}
public override void ProcessRequest (HttpContext context)
{
Context = context;
SoapServerMessage responseMessage = null;
try
{
if (requestMessage == null) {
requestMessage = DeserializeRequest (context);
}
if (methodInfo != null && methodInfo.OneWay) {
context.Response.BufferOutput = false;
context.Response.StatusCode = 202;
context.Response.Flush ();
context.Response.Close ();
Invoke (context, requestMessage);
} else {
responseMessage = Invoke (context, requestMessage);
SerializeResponse (context.Response, responseMessage);
}
}
catch (Exception ex)
{
if (methodInfo != null && methodInfo.OneWay) {
context.Response.StatusCode = 500;
context.Response.Flush ();
context.Response.Close ();
} else {
SerializeFault (context, requestMessage, ex);
}
}
finally {
IDisposable disp = requestMessage.Server as IDisposable;
requestMessage = null;
if (disp != null)
disp.Dispose();
}
}
SoapServerMessage DeserializeRequest (HttpContext context)
{
HttpRequest request = context.Request;
Stream stream = request.InputStream;
//using (stream)
//{
string soapAction = null;
string ctype;
Encoding encoding = WebServiceHelper.GetContentEncoding (request.ContentType, out ctype);
if (ctype != "text/xml" && ctype != "application/soap+xml")
throw new WebException ("Content is not XML: " + ctype);
object server = CreateServerInstance ();
SoapServerMessage message = new SoapServerMessage (request, server, stream);
message.SetStage (SoapMessageStage.BeforeDeserialize);
message.ContentType = ctype;
object soapVer = context.Items ["WebServiceSoapVersion"];
if (soapVer != null)
message.SetSoapVersion ((SoapProtocolVersion) soapVer);
// If the routing style is SoapAction, then we can get the method information now
// and set it to the SoapMessage
if (_typeStubInfo.RoutingStyle == SoapServiceRoutingStyle.SoapAction)
{
string headerName = message.IsSoap12 ? "action" : "SOAPAction";
soapAction = message.IsSoap12 ? WebServiceHelper.GetContextAction(request.ContentType) : request.Headers [headerName];
if (soapAction == null) {
if (!message.IsSoap12)
throw new SoapException ("Missing SOAPAction header", WebServiceHelper.ClientFaultCode (message.IsSoap12));
}
else
{
methodInfo = _typeStubInfo.GetMethodForSoapAction (soapAction);
if (methodInfo == null) throw new SoapException ("Server did not recognize the value of HTTP header " + headerName + ": " + soapAction, WebServiceHelper.ClientFaultCode (message.IsSoap12));
message.MethodStubInfo = methodInfo;
}
}
// Execute the high priority global extensions. Do not try to execute the medium and
// low priority extensions because if the routing style is RequestElement we still
// don't have method information
_extensionChainHighPrio = SoapExtension.CreateExtensionChain (_typeStubInfo.SoapExtensions[0]);
stream = SoapExtension.ExecuteChainStream (_extensionChainHighPrio, stream);
SoapExtension.ExecuteProcessMessage (_extensionChainHighPrio, message, stream, false);
// If the routing style is RequestElement, try to get the method name from the
// stream processed by the high priority extensions
if (_typeStubInfo.RoutingStyle == SoapServiceRoutingStyle.RequestElement || (message.IsSoap12 && soapAction == null))
{
MemoryStream mstream;
byte[] buffer = null;
if (stream.CanSeek)
{
buffer = new byte [stream.Length];
for (int n=0; n<stream.Length;)
n += stream.Read (buffer, n, (int)stream.Length-n);
mstream = new MemoryStream (buffer);
}
else
{
buffer = new byte [500];
mstream = new MemoryStream ();
int len;
while ((len = stream.Read (buffer, 0, 500)) > 0)
mstream.Write (buffer, 0, len);
mstream.Position = 0;
buffer = mstream.ToArray ();
}
soapAction = ReadActionFromRequestElement (new MemoryStream (buffer), encoding, message.IsSoap12);
stream = mstream;
methodInfo = (SoapMethodStubInfo) _typeStubInfo.GetMethod (soapAction);
message.MethodStubInfo = methodInfo;
}
// Whatever routing style we used, we should now have the method information.
// We can now notify the remaining extensions
if (methodInfo == null) throw new SoapException ("Method '" + soapAction + "' not defined in the web service '" + _typeStubInfo.LogicalType.WebServiceName + "'", WebServiceHelper.ClientFaultCode (message.IsSoap12));
_extensionChainMedPrio = SoapExtension.CreateExtensionChain (methodInfo.SoapExtensions);
_extensionChainLowPrio = SoapExtension.CreateExtensionChain (_typeStubInfo.SoapExtensions[1]);
stream = SoapExtension.ExecuteChainStream (_extensionChainMedPrio, stream);
stream = SoapExtension.ExecuteChainStream (_extensionChainLowPrio, stream);
SoapExtension.ExecuteProcessMessage (_extensionChainMedPrio, message, stream, false);
SoapExtension.ExecuteProcessMessage (_extensionChainLowPrio, message, stream, false);
// Deserialize the request
StreamReader reader = new StreamReader (stream, encoding, false);
XmlTextReader xmlReader = new XmlTextReader (reader);
try
{
object content;
SoapHeaderCollection headers;
WebServiceHelper.ReadSoapMessage (xmlReader, methodInfo, SoapHeaderDirection.In, message.IsSoap12, out content, out headers);
message.InParameters = (object []) content;
message.SetHeaders (headers);
}
catch (Exception ex)
{
throw new SoapException ("Could not deserialize Soap message", WebServiceHelper.ClientFaultCode (message.IsSoap12), ex);
}
// Notify the extensions after deserialization
message.SetStage (SoapMessageStage.AfterDeserialize);
SoapExtension.ExecuteProcessMessage (_extensionChainHighPrio, message, stream, false);
SoapExtension.ExecuteProcessMessage (_extensionChainMedPrio, message, stream, false);
SoapExtension.ExecuteProcessMessage (_extensionChainLowPrio, message, stream, false);
return message;
//}
}
string ReadActionFromRequestElement (Stream stream, Encoding encoding, bool soap12)
{
string envNS = soap12 ?
WebServiceHelper.Soap12EnvelopeNamespace :
WebServiceHelper.SoapEnvelopeNamespace;
try
{
StreamReader reader = new StreamReader (stream, encoding, false);
XmlTextReader xmlReader = new XmlTextReader (reader);
xmlReader.MoveToContent ();
xmlReader.ReadStartElement ("Envelope", envNS);
while (! (xmlReader.NodeType == XmlNodeType.Element && xmlReader.LocalName == "Body" && xmlReader.NamespaceURI == envNS))
xmlReader.Skip ();
xmlReader.ReadStartElement ("Body", envNS);
xmlReader.MoveToContent ();
return xmlReader.LocalName;
}
catch (Exception ex)
{
string errmsg = "The root element for the request could not be determined. ";
errmsg += "When RoutingStyle is set to RequestElement, SoapExtensions configured ";
errmsg += "via an attribute on the method cannot modify the request stream before it is read. ";
errmsg += "The extension must be configured via the SoapExtensionTypes element in web.config ";
errmsg += "or the request must arrive at the server as clear text.";
throw new SoapException (errmsg, WebServiceHelper.ServerFaultCode (soap12), ex);
}
}
void SerializeResponse (HttpResponse response, SoapServerMessage message)
{
SoapMethodStubInfo methodInfo = message.MethodStubInfo;
if ((message.ContentEncoding != null) && (message.ContentEncoding.Length > 0))
response.AppendHeader("Content-Encoding", message.ContentEncoding);
response.ContentType = message.IsSoap12 ?
"application/soap+xml; charset=utf-8" :
"text/xml; charset=utf-8";
if (message.Exception != null) response.StatusCode = 500;
Stream responseStream = response.OutputStream;
Stream outStream = responseStream;
bool bufferResponse = (methodInfo == null || methodInfo.MethodAttribute.BufferResponse);
response.BufferOutput = bufferResponse;
try
{
// While serializing, process extensions in reverse order
if (bufferResponse)
{
outStream = SoapExtension.ExecuteChainStream (_extensionChainHighPrio, outStream);
outStream = SoapExtension.ExecuteChainStream (_extensionChainMedPrio, outStream);
outStream = SoapExtension.ExecuteChainStream (_extensionChainLowPrio, outStream);
message.SetStage (SoapMessageStage.BeforeSerialize);
SoapExtension.ExecuteProcessMessage (_extensionChainLowPrio, message, outStream, true);
SoapExtension.ExecuteProcessMessage (_extensionChainMedPrio, message, outStream, true);
SoapExtension.ExecuteProcessMessage (_extensionChainHighPrio, message, outStream, true);
}
XmlTextWriter xtw = WebServiceHelper.CreateXmlWriter (outStream);
if (message.Exception == null)
WebServiceHelper.WriteSoapMessage (xtw, methodInfo, SoapHeaderDirection.Out, message.OutParameters, message.Headers, message.IsSoap12);
else if (methodInfo != null) {
if (message.IsSoap12)
WebServiceHelper.WriteSoapMessage (xtw, methodInfo, SoapHeaderDirection.Fault, new Soap12Fault (message.Exception), message.Headers, message.IsSoap12);
else
{
WebServiceHelper.WriteSoapMessage (xtw, methodInfo, SoapHeaderDirection.Fault, new Fault (message.Exception), message.Headers, message.IsSoap12);
}
}
else {
if (message.IsSoap12)
WebServiceHelper.WriteSoapMessage (xtw, SoapBindingUse.Literal, Soap12Fault.Serializer, null, new Soap12Fault (message.Exception), null, message.IsSoap12);
else
{
WebServiceHelper.WriteSoapMessage (xtw, SoapBindingUse.Literal, Fault.Serializer, null, new Fault (message.Exception), null, message.IsSoap12);
}
}
if (bufferResponse)
{
message.SetStage (SoapMessageStage.AfterSerialize);
SoapExtension.ExecuteProcessMessage (_extensionChainLowPrio, message, outStream, true);
SoapExtension.ExecuteProcessMessage (_extensionChainMedPrio, message, outStream, true);
SoapExtension.ExecuteProcessMessage (_extensionChainHighPrio, message, outStream, true);
}
xtw.Flush ();
}
catch (Exception ex)
{
// If the response is buffered, we can discard the response and
// serialize a new Fault message as response.
if (bufferResponse) throw ex;
// If it is not buffered, we can't rollback what has been sent,
// so we can only close the connection and return.
responseStream.Close ();
return;
}
}
void SerializeFault (HttpContext context, SoapServerMessage requestMessage, Exception ex)
{
SoapException soex = ex as SoapException;
if (soex == null) soex = new SoapException (ex.ToString (), WebServiceHelper.ServerFaultCode (requestMessage != null && requestMessage.IsSoap12), ex);
SoapServerMessage faultMessage;
if (requestMessage != null)
faultMessage = new SoapServerMessage (context.Request, soex, requestMessage.MethodStubInfo, requestMessage.Server, requestMessage.Stream);
else
faultMessage = new SoapServerMessage (context.Request, soex, null, null, null);
object soapVer = context.Items ["WebServiceSoapVersion"];
if (soapVer != null)
faultMessage.SetSoapVersion ((SoapProtocolVersion) soapVer);
SerializeResponse (context.Response, faultMessage);
context.Response.End ();
return;
}
private SoapServerMessage Invoke (HttpContext ctx, SoapServerMessage requestMessage)
{
SoapMethodStubInfo methodInfo = requestMessage.MethodStubInfo;
// Assign header values to web service members
requestMessage.UpdateHeaderValues (requestMessage.Server, methodInfo.Headers);
// Fill an array with the input parameters at the right position
object[] parameters = new object[methodInfo.MethodInfo.Parameters.Length];
ParameterInfo[] inParams = methodInfo.MethodInfo.InParameters;
for (int n=0; n<inParams.Length; n++)
parameters [inParams[n].Position] = requestMessage.InParameters [n];
// Invoke the method
try
{
object[] results = methodInfo.MethodInfo.Invoke (requestMessage.Server, parameters);
requestMessage.OutParameters = results;
}
catch (TargetInvocationException ex)
{
throw ex.InnerException;
}
// Check that headers with MustUnderstand flag have been understood
foreach (SoapHeader header in requestMessage.Headers)
{
if (header.MustUnderstand && !header.DidUnderstand)
throw new SoapHeaderException ("Header not understood: " + header.GetType(), WebServiceHelper.MustUnderstandFaultCode (requestMessage.IsSoap12));
}
// Collect headers that must be sent to the client
requestMessage.CollectHeaders (requestMessage.Server, methodInfo.Headers, SoapHeaderDirection.Out);
return requestMessage;
}
}
}

View File

@@ -1,86 +0,0 @@
//
// System.Web.Services.Protocols.MatchAttribute.cs
//
// Author:
// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Tim Coleman, 2002
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.Web.Services.Protocols {
[AttributeUsage (AttributeTargets.All, Inherited = true)]
public sealed class MatchAttribute : Attribute {
#region Fields
int capture;
int group;
bool ignoreCase;
int maxRepeats;
string pattern;
#endregion
#region Constructors
public MatchAttribute (string pattern)
{
ignoreCase = false;
maxRepeats = -1;
this.pattern = pattern;
group = 1;
}
#endregion // Constructors
#region Properties
public int Capture {
get { return capture; }
set { capture = value; }
}
public int Group {
get { return group; }
set { group = value; }
}
public bool IgnoreCase {
get { return ignoreCase; }
set { ignoreCase = value; }
}
public int MaxRepeats {
get { return maxRepeats; }
set { maxRepeats = value; }
}
public string Pattern {
get { return pattern; }
set { pattern = value; }
}
#endregion // Properties
}
}

View File

@@ -1,50 +0,0 @@
//
// System.Web.Services.Protocols.MimeParameterReader.cs
//
// Author:
// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Tim Coleman, 2002
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Web;
namespace System.Web.Services.Protocols {
public abstract class MimeParameterReader : MimeFormatter {
#region Constructors
protected MimeParameterReader ()
{
}
#endregion // Constructors
#region Methods
public abstract object[] Read (HttpRequest request);
#endregion // Methods
}
}

View File

@@ -1,43 +0,0 @@
//
// System.Web.Services.Protocols.MimeReturnWriter.cs
//
// Author:
// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Tim Coleman, 2002
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.IO;
using System.Web;
namespace System.Web.Services.Protocols {
internal abstract class MimeReturnWriter : MimeFormatter {
#region Methods
public abstract void Write (HttpResponse response, Stream outputStream, object returnValue);
#endregion // Methods
}
}

View File

@@ -1,122 +0,0 @@
//
// System.Web.Services.Protocols.PatternMatcher.cs
//
// Author:
// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Tim Coleman, 2002
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Web.Services;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Collections;
namespace System.Web.Services.Protocols
{
public sealed class PatternMatcher
{
Type _returnType;
MatchInfo[] _matchInfos;
public PatternMatcher (Type type)
{
_returnType = type;
FieldInfo[] fields = type.GetFields ();
ArrayList matchInfos = new ArrayList ();
foreach (FieldInfo field in fields)
{
object[] ats = field.GetCustomAttributes (typeof(MatchAttribute), true);
if (ats.Length == 0) continue;
MatchInfo mi = new MatchInfo ();
mi.Field = field;
mi.Match = (MatchAttribute) ats[0];
RegexOptions opts = RegexOptions.Multiline;
if (mi.Match.IgnoreCase) opts |= RegexOptions.IgnoreCase;
mi.Regex = new Regex (mi.Match.Pattern, opts);
matchInfos.Add (mi);
}
_matchInfos = (MatchInfo[]) matchInfos.ToArray (typeof(MatchInfo));
}
public object Match (string text)
{
object ob = Activator.CreateInstance (_returnType);
foreach (MatchInfo mi in _matchInfos)
{
MatchCollection matches = mi.Regex.Matches (text);
object res = null;
if (mi.Field.FieldType.IsArray)
{
int max = mi.Match.MaxRepeats;
if (max == -1) max = matches.Count;
Type elemType = mi.Field.FieldType.GetElementType();
Array array = Array.CreateInstance (elemType, max);
for (int n=0; n<max; n++)
array.SetValue (mi.GetMatchValue (matches[n], elemType), n);
res = array;
}
else if (matches.Count > 0)
res = mi.GetMatchValue (matches[0], mi.Field.FieldType);
mi.Field.SetValue (ob, res);
}
return ob;
}
}
class MatchInfo
{
public FieldInfo Field;
public MatchAttribute Match;
public Regex Regex;
const string GroupError = "{0} is not a valid group index for match '{1}'. The highest valid group index for this match is {2}";
const string CaptureError = "{0} is not a valid capture index for match '{1}'. The highest valid capture index for this match is {2}";
public object GetMatchValue (Match match, Type castType)
{
if (Match.Group >= match.Groups.Count)
throw new Exception (string.Format (GroupError, Match.Group, Field.Name, match.Groups.Count-1));
Group group = match.Groups [Match.Group];
if (Match.Capture >= group.Captures.Count)
throw new Exception (string.Format (CaptureError, Match.Capture, Field.Name, group.Captures.Count-1));
string val = group.Captures [Match.Capture].Value;
return Convert.ChangeType (val, castType);
}
}
}

View File

@@ -1,73 +0,0 @@
//
// ServerProtocol.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.Web.Services.Protocols
{
public abstract class ServerProtocol
{
protected ServerProtocol ()
{
}
[MonoTODO]
protected HttpContext Context {
get { throw new NotImplementedException (); }
}
[MonoTODO]
protected HttpRequest Request {
get { throw new NotImplementedException (); }
}
[MonoTODO]
protected HttpResponse Response {
get { throw new NotImplementedException (); }
}
[MonoTODO]
protected virtual object Target {
get { throw new NotImplementedException (); }
}
[MonoTODO]
protected void AddToCache (Type protocolType, Type serverType, object value)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected object GetFromCache (Type protocolType, Type serverType)
{
throw new NotImplementedException ();
}
}
}

View File

@@ -1,43 +0,0 @@
//
// ServerProtocolFactory.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.Web.Services.Protocols
{
public abstract class ServerProtocolFactory
{
protected ServerProtocolFactory ()
{
}
protected abstract ServerProtocol CreateIfRequestCompatible (HttpRequest request);
}
}

View File

@@ -1,266 +0,0 @@
//
// System.Web.Services.Protocols.SoapDocumentationHandler.cs
//
// Author:
// Lluis Sanchez Gual (lluis@ximian.com)
//
// Copyright (C) Ximian, Inc. 2003
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Web;
using System.IO;
using System.Globalization;
using System.Xml;
using System.Text;
using System.Xml.Serialization;
using System.Xml.Schema;
using System.Web.Compilation;
using System.Web.Services.Description;
using System.Web.Services.Discovery;
using System.Web.Services.Configuration;
using System.Configuration;
using System.CodeDom;
using System.CodeDom.Compiler;
using Microsoft.CSharp;
using System.Web.UI;
namespace System.Web.Services.Protocols
{
internal class SoapDocumentationHandler: WebServiceHandler
{
SoapTypeStubInfo _typeStubInfo;
ServiceDescriptionCollection _descriptions;
XmlSchemas _schemas;
string _url;
IHttpHandler _pageHandler = null;
public SoapDocumentationHandler (Type type, HttpContext context): base (type)
{
_url = context.Request.Url.ToString();
int i = _url.IndexOf ('?');
if (i != -1) _url = _url.Substring (0,i);
_typeStubInfo = (SoapTypeStubInfo) TypeStubManager.GetTypeStub (ServiceType, "Soap");
HttpRequest req = context.Request;
string key = null;
if (req.QueryString.Count == 1) {
key = req.QueryString.GetKey (0);
if (key == null)
key = req.QueryString [0];
if (key != null)
key = key.ToLower (CultureInfo.InvariantCulture);
}
if (key == "wsdl" || key == "schema" || key == "code" || key == "disco")
return;
string help = WebServicesSection.Current.WsdlHelpGenerator.Href;
string path = Path.GetDirectoryName (ConfigurationManager.OpenMachineConfiguration().FilePath);
string appPath = AppDomain.CurrentDomain.GetData (".appPath").ToString ();
string vpath;
if (path.StartsWith (appPath)) {
vpath = path.Substring (appPath.Length);
vpath = vpath.Replace ("\\", "/");
} else {
vpath = "/";
}
if (vpath.EndsWith ("/"))
vpath += help;
else
vpath += "/" + help;
string physPath = Path.Combine (path, help);
if (!File.Exists (physPath))
throw new InvalidOperationException ("Documentation page '" + physPath + "' not found");
_pageHandler = PageParser.GetCompiledPageInstance (vpath, physPath, context);
}
internal IHttpHandler PageHandler {
get { return _pageHandler; }
}
public override bool IsReusable
{
get { return false; }
}
public override void ProcessRequest (HttpContext context)
{
if (_pageHandler != null)
{
context.Items["wsdls"] = GetDescriptions ();
context.Items["schemas"] = GetSchemas ();
_pageHandler.ProcessRequest (context);
}
else
{
HttpRequest req = context.Request;
string key = req.QueryString.GetKey (0);
if (key == null)
key = req.QueryString [0];
if (key != null)
key = key.ToLower (CultureInfo.InvariantCulture);
if (key == "wsdl") GenerateWsdlDocument (context, req.QueryString ["wsdl"]);
else if (key == "schema") GenerateSchema (context, req.QueryString ["schema"]);
else if (key == "code") GenerateCode (context, req.QueryString ["code"]);
else if (key == "disco") GenerateDiscoDocument (context);
else throw new Exception ("This should never happen");
}
}
void GenerateWsdlDocument (HttpContext context, string wsdlId)
{
int di = 0;
if (wsdlId != null && wsdlId != "") di = int.Parse (wsdlId);
context.Response.ContentType = "text/xml; charset=utf-8";
XmlTextWriter xtw = new XmlTextWriter (context.Response.OutputStream, new UTF8Encoding (false));
xtw.Formatting = Formatting.Indented;
GetDescriptions() [di].Write (xtw);
}
void GenerateDiscoDocument (HttpContext context)
{
ServiceDescriptionCollection descs = GetDescriptions ();
DiscoveryDocument doc = new DiscoveryDocument ();
ContractReference cref = new ContractReference ();
cref.Ref = _url + "?wsdl";
cref.DocRef = _url;
doc.References.Add (cref);
foreach (ServiceDescription desc in descs)
foreach (Service ser in desc.Services)
foreach (Port port in ser.Ports)
{
SoapAddressBinding sab = port.Extensions.Find (typeof(SoapAddressBinding)) as SoapAddressBinding;
if (sab != null)
{
System.Web.Services.Discovery.SoapBinding dsb = new System.Web.Services.Discovery.SoapBinding ();
dsb.Address = sab.Location;
dsb.Binding = port.Binding;
doc.AdditionalInfo.Add (dsb);
}
}
context.Response.ContentType = "text/xml; charset=utf-8";
XmlTextWriter xtw = new XmlTextWriter (context.Response.OutputStream, new UTF8Encoding (false));
xtw.Formatting = Formatting.Indented;
doc.Write (xtw);
}
void GenerateSchema (HttpContext context, string schemaId)
{
int di = -1;
if (schemaId != null && schemaId != "") {
try {
di = int.Parse (schemaId);
} catch {
XmlSchemas xss = GetSchemas ();
for (int i = 0; i < xss.Count; i++) {
if (xss [i].Id == schemaId) {
di = i;
break;
}
}
}
if (di < 0)
throw new InvalidOperationException (String.Format ("HTTP parameter 'schema' needs to specify an Id of a schema in the schemas. {0} points to nowhere.", schemaId));
}
context.Response.ContentType = "text/xml; charset=utf-8";
XmlTextWriter xtw = new XmlTextWriter (context.Response.OutputStream, new UTF8Encoding (false));
xtw.Formatting = Formatting.Indented;
GetSchemas() [di].Write (xtw);
}
void GenerateCode (HttpContext context, string langId)
{
context.Response.ContentType = "text/plain; charset=utf-8";
CodeNamespace codeNamespace = new CodeNamespace();
CodeCompileUnit codeUnit = new CodeCompileUnit();
codeUnit.Namespaces.Add (codeNamespace);
ServiceDescriptionImporter importer = new ServiceDescriptionImporter();
foreach (ServiceDescription sd in GetDescriptions ())
importer.AddServiceDescription(sd, null, null);
foreach (XmlSchema sc in GetSchemas())
importer.Schemas.Add (sc);
importer.Import(codeNamespace, codeUnit);
if (langId == null || langId == "") langId = "cs";
CodeDomProvider provider = GetProvider (langId);
ICodeGenerator generator = provider.CreateGenerator();
CodeGeneratorOptions options = new CodeGeneratorOptions();
generator.GenerateCodeFromCompileUnit(codeUnit, context.Response.Output, options);
}
private CodeDomProvider GetProvider(string langId)
{
// FIXME these should be loaded dynamically using reflection
CodeDomProvider provider;
switch (langId.ToUpper())
{
case "CS":
provider = new CSharpCodeProvider();
break;
default:
throw new Exception("Unknown language: " + langId);
}
return provider;
}
internal ServiceDescriptionCollection GetDescriptions ()
{
if (_descriptions == null)
{
ServiceDescriptionReflector reflector = new ServiceDescriptionReflector ();
reflector.Reflect (ServiceType,_url);
_schemas = reflector.Schemas;
_descriptions = reflector.ServiceDescriptions;
}
return _descriptions;
}
internal XmlSchemas GetSchemas()
{
GetDescriptions();
return _schemas;
}
}
}

View File

@@ -1,101 +0,0 @@
//
// System.Web.Services.Protocols.SoapHeaderException.cs
//
// Author:
// Tim Coleman (tim@timcoleman.com)
//
// Copyright (C) Tim Coleman, 2002
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Runtime.Serialization;
using System.Xml;
namespace System.Web.Services.Protocols
{
[Serializable]
public class SoapHeaderException : SoapException {
#region Constructors
public SoapHeaderException ()
: this ("SOAP header error", XmlQualifiedName.Empty)
{
}
public SoapHeaderException (string message, XmlQualifiedName code)
: base (message, code)
{
}
public SoapHeaderException (string message, XmlQualifiedName code, Exception innerException)
: base (message, code, innerException)
{
}
public SoapHeaderException (string message, XmlQualifiedName code, string actor)
: base (message, code, actor)
{
}
public SoapHeaderException (string message, XmlQualifiedName code, string actor, Exception innerException)
: base (message, code, actor, innerException)
{
}
public SoapHeaderException (
string message,
XmlQualifiedName code,
string actor,
string role,
string lang,
SoapFaultSubCode subcode,
Exception innerException)
: base (message, code, actor, role, lang, null, subcode, innerException)
{
}
public SoapHeaderException (
string message,
XmlQualifiedName code,
string actor,
string role,
SoapFaultSubCode subcode,
Exception innerException)
: base (message, code, actor, role, null, subcode, innerException)
{
}
protected SoapHeaderException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
}
#endregion // Constructors
}
}

View File

@@ -1,115 +0,0 @@
//
// SoapHeaderHandling.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell, Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Reflection;
using System.Xml;
using System.Xml.Serialization;
namespace System.Web.Services.Protocols
{
public sealed class SoapHeaderHandling
{
// static members
[MonoTODO]
public static void EnsureHeadersUnderstood (SoapHeaderCollection headers)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static void GetHeaderMembers (
SoapHeaderCollection headers,
object target,
SoapHeaderMapping [] mappings,
SoapHeaderDirection direction,
bool client)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static void SetHeaderMembers (
SoapHeaderCollection headers,
object target,
SoapHeaderMapping [] mappings,
SoapHeaderDirection direction,
bool client)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static void WriteHeaders (
XmlWriter writer,
XmlSerializer serializer,
SoapHeaderCollection headers,
SoapHeaderMapping [] mappings,
SoapHeaderDirection direction,
bool isEncoded,
string defaultNS,
bool serviceDefaultIsEncoded,
string envelopeNS)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static void WriteUnknownHeaders (
XmlWriter writer,
SoapHeaderCollection headers,
string envelopeNS)
{
throw new NotImplementedException ();
}
// instance members
public SoapHeaderHandling ()
{
}
[MonoTODO]
public string ReadHeaders (
XmlReader reader,
XmlSerializer serializer,
SoapHeaderCollection headers,
SoapHeaderMapping [] mappings,
SoapHeaderDirection direction,
string envelopeNS,
string encodingStyle,
bool checkRequiredHeaders)
{
throw new NotImplementedException ();
}
}
}

Some files were not shown because too many files have changed in this diff Show More