Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -63,13 +63,8 @@ namespace System.Web.Services.Protocols
}
public static XmlSerializer Serializer =
#if NET_2_0
new Fault12Serializer ();
#else
null;
#endif
#if NET_2_0
public Soap12Fault (SoapException ex)
{
@@ -114,7 +109,6 @@ namespace System.Web.Services.Protocols
return (src == null) ? null :
new SoapFaultSubCode (src.Value, GetSoapFaultSubCode (src.Subcode));
}
#endif
public Soap12FaultCode Code;

View File

@@ -1,4 +1,3 @@
#if NET_2_0
using System;
using System.Xml;
using System.Xml.Schema;
@@ -646,4 +645,3 @@ namespace System.Web.Services.Protocols
}
}
#endif

View File

@@ -35,9 +35,7 @@ using System.IO;
using System.Threading;
namespace System.Web.Services.Protocols {
#if NET_2_0
[System.Runtime.InteropServices.ComVisible (true)]
#endif
public abstract class HttpSimpleClientProtocol : HttpWebClientProtocol {
#region Fields
@@ -183,7 +181,6 @@ namespace System.Web.Services.Protocols {
return returnReader.Read (response, response.GetResponseStream ());
}
#if NET_2_0
protected void InvokeAsync (string methodName, string requestUrl, object[] parameters, SendOrPostCallback callback)
{
@@ -206,7 +203,6 @@ namespace System.Web.Services.Protocols {
else
info.Callback (args);
}
#endif
#endregion // Methods
}

View File

@@ -125,11 +125,7 @@ namespace System.Web.Services.Protocols
string soapAction = null;
string ctype;
Encoding encoding = WebServiceHelper.GetContentEncoding (request.ContentType, out ctype);
#if NET_2_0
if (ctype != "text/xml" && ctype != "application/soap+xml")
#else
if (ctype != "text/xml")
#endif
throw new WebException ("Content is not XML: " + ctype);
object server = CreateServerInstance ();
@@ -137,11 +133,9 @@ namespace System.Web.Services.Protocols
SoapServerMessage message = new SoapServerMessage (request, server, stream);
message.SetStage (SoapMessageStage.BeforeDeserialize);
message.ContentType = ctype;
#if NET_2_0
object soapVer = context.Items ["WebServiceSoapVersion"];
if (soapVer != null)
message.SetSoapVersion ((SoapProtocolVersion) soapVer);
#endif
// If the routing style is SoapAction, then we can get the method information now
// and set it to the SoapMessage
@@ -317,21 +311,17 @@ namespace System.Web.Services.Protocols
if (message.Exception == null)
WebServiceHelper.WriteSoapMessage (xtw, methodInfo, SoapHeaderDirection.Out, message.OutParameters, message.Headers, message.IsSoap12);
else if (methodInfo != null) {
#if NET_2_0
if (message.IsSoap12)
WebServiceHelper.WriteSoapMessage (xtw, methodInfo, SoapHeaderDirection.Fault, new Soap12Fault (message.Exception), message.Headers, message.IsSoap12);
else
#endif
{
WebServiceHelper.WriteSoapMessage (xtw, methodInfo, SoapHeaderDirection.Fault, new Fault (message.Exception), message.Headers, message.IsSoap12);
}
}
else {
#if NET_2_0
if (message.IsSoap12)
WebServiceHelper.WriteSoapMessage (xtw, SoapBindingUse.Literal, Soap12Fault.Serializer, null, new Soap12Fault (message.Exception), null, message.IsSoap12);
else
#endif
{
WebServiceHelper.WriteSoapMessage (xtw, SoapBindingUse.Literal, Fault.Serializer, null, new Fault (message.Exception), null, message.IsSoap12);
}
@@ -370,11 +360,9 @@ namespace System.Web.Services.Protocols
faultMessage = new SoapServerMessage (context.Request, soex, requestMessage.MethodStubInfo, requestMessage.Server, requestMessage.Stream);
else
faultMessage = new SoapServerMessage (context.Request, soex, null, null, null);
#if NET_2_0
object soapVer = context.Items ["WebServiceSoapVersion"];
if (soapVer != null)
faultMessage.SetSoapVersion ((SoapProtocolVersion) soapVer);
#endif
SerializeResponse (context.Response, faultMessage);
context.Response.End ();

View File

@@ -37,9 +37,7 @@ using System.Web.Services;
using System.Collections;
namespace System.Web.Services.Protocols {
#if NET_2_0
[System.Runtime.InteropServices.ComVisible (true)]
#endif
public abstract class HttpWebClientProtocol : WebClientProtocol {
#region Fields
@@ -93,13 +91,11 @@ namespace System.Web.Services.Protocols {
set { cookieContainer = value; }
}
#if NET_2_0
[DefaultValue (false)]
public bool EnableDecompression {
get { return enableDecompression; }
set { enableDecompression = value; }
}
#endif
[Browsable (false)]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
@@ -190,7 +186,6 @@ namespace System.Web.Services.Protocols {
return response;
}
#if NET_2_0
Hashtable mappings = new Hashtable ();
internal void RegisterMapping (object userState, WebClientAsyncResult result)
@@ -231,20 +226,10 @@ namespace System.Web.Services.Protocols {
{
throw new NotImplementedException ();
}
#else
internal void UnregisterMapping (object userState)
{
}
internal void RegisterMapping (object userState, WebClientAsyncResult result)
{
}
#endif
#endregion // Methods
}
#if NET_2_0
internal class InvokeAsyncInfo
{
public SynchronizationContext Context;
@@ -258,5 +243,4 @@ namespace System.Web.Services.Protocols {
Context = SynchronizationContext.Current;
}
}
#endif
}

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.ComponentModel;
@@ -50,4 +49,3 @@ namespace System.Web.Services.Protocols
}
}
#endif

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
namespace System.Web.Services.Protocols
{
@@ -38,4 +37,3 @@ namespace System.Web.Services.Protocols
);
}
#endif

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
namespace System.Web.Services.Protocols
{
@@ -72,4 +71,3 @@ namespace System.Web.Services.Protocols
}
}
#endif

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
namespace System.Web.Services.Protocols
{
@@ -42,4 +41,3 @@ namespace System.Web.Services.Protocols
}
}
#endif

View File

@@ -34,11 +34,7 @@ using System.Collections;
namespace System.Web.Services.Protocols
{
#if NET_2_0
public
#else
internal
#endif
class ServerType
{
LogicalTypeInfo type;
@@ -70,9 +66,7 @@ namespace System.Web.Services.Protocols
SoapServiceRoutingStyle routingStyle;
TypeStubInfo soapProtocol;
#if NET_2_0
TypeStubInfo soap12Protocol;
#endif
TypeStubInfo httpGetProtocol;
TypeStubInfo httpPostProtocol;
@@ -106,11 +100,7 @@ namespace System.Web.Services.Protocols
else if (t.GetCustomAttributes (typeof(SoapRpcServiceAttribute), true).Length > 0) {
o = t.GetCustomAttributes (typeof(SoapRpcServiceAttribute), true);
SoapRpcServiceAttribute at = (SoapRpcServiceAttribute) o[0];
#if NET_2_0
bindingUse = at.Use;
#else
bindingUse = SoapBindingUse.Encoded;
#endif
routingStyle = at.RoutingStyle;
if (bindingUse == SoapBindingUse.Default)
bindingUse = SoapBindingUse.Encoded;
@@ -120,7 +110,6 @@ namespace System.Web.Services.Protocols
string sep = WebServiceNamespace.EndsWith ("/") ? "" : "/";
WebServiceAbstractNamespace = WebServiceNamespace + sep + "AbstractTypes";
#if NET_2_0
MethodInfo [] type_methods;
if (typeof (WebClientProtocol).IsAssignableFrom (Type))
type_methods = Type.GetMethods (BindingFlags.Instance | BindingFlags.Public);
@@ -146,9 +135,6 @@ namespace System.Web.Services.Protocols
}
type_methods = (MethodInfo []) list.ToArray (typeof (MethodInfo));
}
#else
MethodInfo [] type_methods = Type.GetMethods (BindingFlags.Instance | BindingFlags.Public);
#endif
logicalMethods = LogicalMethodInfo.Create (type_methods, LogicalMethodTypes.Sync);
}

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Xml;
@@ -69,4 +68,3 @@ namespace System.Web.Services.Protocols
}
}
#endif

View File

@@ -59,10 +59,8 @@ namespace System.Web.Services.Protocols {
this.client = client;
this.url = url;
Parameters = parameters;
#if NET_2_0
if (SoapVersion == SoapProtocolVersion.Soap12)
ContentType = "application/soap+xml";
#endif
}
#endregion
@@ -89,12 +87,10 @@ namespace System.Web.Services.Protocols {
get { return url; }
}
#if NET_2_0
[System.Runtime.InteropServices.ComVisible(false)]
public override SoapProtocolVersion SoapVersion {
get { return client.SoapVersion; }
}
#endif
#endregion // Properties

View File

@@ -77,13 +77,8 @@ namespace System.Web.Services.Protocols
if (key == "wsdl" || key == "schema" || key == "code" || key == "disco")
return;
#if NET_2_0
string help = WebServicesSection.Current.WsdlHelpGenerator.Href;
string path = Path.GetDirectoryName (ConfigurationManager.OpenMachineConfiguration().FilePath);
#else
string help = WSConfig.Instance.WsdlHelpPage;
string path = Path.GetDirectoryName (WSConfig.Instance.ConfigFilePath);
#endif
string appPath = AppDomain.CurrentDomain.GetData (".appPath").ToString ();
string vpath;
if (path.StartsWith (appPath)) {

View File

@@ -35,9 +35,7 @@ using System.Xml;
namespace System.Web.Services.Protocols
{
#if NET_2_0
[Serializable]
#endif
public class SoapException : SystemException
{
#region Fields
@@ -52,21 +50,17 @@ namespace System.Web.Services.Protocols
XmlQualifiedName code;
XmlNode detail;
#if NET_2_0
string lang;
string role;
SoapFaultSubCode subcode;
#endif
#endregion
#region Constructors
#if NET_2_0
public SoapException ()
: this ("SOAP error", XmlQualifiedName.Empty)
{
}
#endif
public SoapException (string message, XmlQualifiedName code)
: base (message)
@@ -110,7 +104,6 @@ namespace System.Web.Services.Protocols
this.detail = detail;
}
#if NET_2_0
public SoapException (string message, XmlQualifiedName code, SoapFaultSubCode subcode)
: base (message)
{
@@ -134,7 +127,6 @@ namespace System.Web.Services.Protocols
this.lang = lang;
}
#if NET_2_0
protected SoapException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
@@ -157,7 +149,6 @@ namespace System.Web.Services.Protocols
info.AddValue ("role", role);
info.AddValue ("subcode", subcode);
}
#endif
public static bool IsClientFaultCode (XmlQualifiedName code)
{
@@ -187,7 +178,6 @@ namespace System.Web.Services.Protocols
return false;
}
#endif
#endregion // Constructors
@@ -205,7 +195,6 @@ namespace System.Web.Services.Protocols
get { return detail; }
}
#if NET_2_0
[System.Runtime.InteropServices.ComVisible(false)]
public string Lang {
get { return lang; }
@@ -226,7 +215,6 @@ namespace System.Web.Services.Protocols
public string Node {
get { return actor; }
}
#endif
#endregion // Properties
}
}

View File

@@ -104,30 +104,18 @@ namespace System.Web.Services.Protocols {
static void InitializeGlobalExtensions ()
{
globalExtensions = new ArrayList[2];
#if NET_2_0
if (WebServicesSection.Current == null) return;
SoapExtensionTypeElementCollection exts = WebServicesSection.Current.SoapExtensionTypes;
#else
ArrayList exts = WSConfig.Instance.ExtensionTypes;
#endif
if (exts == null) return;
#if NET_2_0
foreach (SoapExtensionTypeElement econf in exts)
#else
foreach (WSExtensionConfig econf in exts)
#endif
{
if (globalExtensions [(int)econf.Group] == null) globalExtensions [(int)econf.Group] = new ArrayList ();
ArrayList destList = globalExtensions [(int) econf.Group];
bool added = false;
for (int n=0; n<destList.Count && !added; n++)
#if NET_2_0
if (((SoapExtensionTypeElement)destList [n]).Priority > econf.Priority) {
#else
if (((WSExtensionConfig)destList [n]).Priority > econf.Priority) {
#endif
destList.Insert (n, econf);
added = true;
}
@@ -148,11 +136,7 @@ namespace System.Web.Services.Protocols {
exts [group] = new SoapExtensionRuntimeConfig [globList.Count];
for (int n=0; n<globList.Count; n++)
{
#if NET_2_0
SoapExtensionTypeElement econf = (SoapExtensionTypeElement) globList [n];
#else
WSExtensionConfig econf = (WSExtensionConfig) globList [n];
#endif
SoapExtensionRuntimeConfig typeconf = new SoapExtensionRuntimeConfig ();
typeconf.Type = econf.Type;
SoapExtension ext = (SoapExtension) Activator.CreateInstance (econf.Type);

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Xml;
@@ -62,4 +61,3 @@ namespace System.Web.Services.Protocols
}
}
#endif

View File

@@ -43,10 +43,8 @@ namespace System.Web.Services.Protocols {
bool didUnderstand;
bool mustUnderstand;
#if NET_2_0
string role;
bool relay;
#endif
#endregion // Fields
@@ -64,11 +62,9 @@ namespace System.Web.Services.Protocols {
actor = elem.GetAttribute ("actor", WebServiceHelper.SoapEnvelopeNamespace);
string me = elem.GetAttribute ("mustUnderstand", WebServiceHelper.SoapEnvelopeNamespace);
if (me != "") EncodedMustUnderstand = me;
#if NET_2_0
role = elem.GetAttribute ("role", WebServiceHelper.Soap12EnvelopeNamespace);
me = elem.GetAttribute ("mustUnderstand", WebServiceHelper.Soap12EnvelopeNamespace);
if (me != "") EncodedMustUnderstand12 = me;
#endif
}
#endregion // Constructors
@@ -112,7 +108,6 @@ namespace System.Web.Services.Protocols {
set { mustUnderstand = value; }
}
#if NET_2_0
[DefaultValue ("0")]
[SoapAttribute ("mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")]
@@ -164,7 +159,6 @@ namespace System.Web.Services.Protocols {
set { role = value; }
}
#endif
#endregion // Properties
}

View File

@@ -33,19 +33,15 @@ using System.Xml;
namespace System.Web.Services.Protocols
{
#if NET_2_0
[Serializable]
#endif
public class SoapHeaderException : SoapException {
#region Constructors
#if NET_2_0
public SoapHeaderException ()
: this ("SOAP header error", XmlQualifiedName.Empty)
{
}
#endif
public SoapHeaderException (string message, XmlQualifiedName code)
: base (message, code)
@@ -67,7 +63,6 @@ namespace System.Web.Services.Protocols
{
}
#if NET_2_0
public SoapHeaderException (
string message,
@@ -100,7 +95,6 @@ namespace System.Web.Services.Protocols
: base (info, context)
{
}
#endif
#endregion // Constructors
}

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Reflection;
using System.Xml;
@@ -114,4 +113,3 @@ namespace System.Web.Services.Protocols
}
}
#endif

View File

@@ -32,11 +32,7 @@ using System.Reflection;
namespace System.Web.Services.Protocols
{
#if NET_2_0
public
#else
internal
#endif
sealed class SoapHeaderMapping // It used to be HeaderInfo class until Mono 1.2
{
MemberInfo member;

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