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

@@ -40,10 +40,8 @@ using System.Web.Services.Configuration;
using System.Web.SessionState;
using System.Web.UI;
using System.Collections.Specialized;
#if NET_2_0
using WSConfig = System.Web.Services.Configuration.WebServicesSection;
using WSProtocol = System.Web.Services.Configuration.WebServiceProtocols;
#endif
namespace System.Web.Services.Protocols
{
@@ -99,50 +97,30 @@ namespace System.Web.Services.Protocols
public IHttpHandler GetHandler (HttpContext context, string verb, string url, string filePath)
{
#if TARGET_J2EE
string fp = url;
#else
string fp = filePath != null ? filePath.Replace (HttpRuntime.AppDomainAppPath, "/").Replace (Path.DirectorySeparatorChar, '/') : null;
#endif
Type type;
#if NET_2_0
type = BuildManager.GetCompiledType (url);
#else
type = WebServiceParser.GetCompiledType (fp, context);
#endif
WSProtocol protocol = GuessProtocol (context, verb);
#if NET_2_0
context.Items ["WebServiceSoapVersion"] =
protocol == WSProtocol.HttpSoap12 ?
SoapProtocolVersion.Soap12 :
SoapProtocolVersion.Default;
#endif
bool supported = false;
IHttpHandler handler = null;
supported = WSConfig.IsSupported (protocol);
if (!supported) {
switch (protocol) {
#if NET_2_0
default:
if (((protocol & WSProtocol.AnyHttpSoap) != WSProtocol.Unknown) &&
(WSConfig.Current.EnabledProtocols & WSProtocol.AnyHttpSoap) != WSProtocol.Unknown)
throw new InvalidOperationException ("Possible SOAP version mismatch.");
break;
#endif
case WSProtocol.HttpPost:
if (WSConfig.IsSupported (WSProtocol.HttpPostLocalhost)) {
#if NET_2_0
supported = context.Request.IsLocal;
#else
string localAddr = context.Request.ServerVariables ["LOCAL_ADDR"];
supported = localAddr != null &&
(localAddr == context.Request.ServerVariables ["REMOTE_ADDR"] ||
IPAddress.IsLoopback (IPAddress.Parse (localAddr)));
#endif
}
break;
}
@@ -197,12 +175,8 @@ namespace System.Web.Services.Protocols
if (context.Request.RequestType == "GET")
return WSProtocol.Documentation;
else
#if NET_2_0
return context.Request.Headers ["SOAPAction"] != null ?
WSProtocol.HttpSoap : WSProtocol.HttpSoap12;
#else
return WSProtocol.HttpSoap;
#endif
}
else
{