rendered paste bodyIndex: System.Web.Services.Protocols/WebServiceHandlerFactory.cs
===================================================================
--- System.Web.Services.Protocols/WebServiceHandlerFactory.cs ( 69654)
+++ System.Web.Services.Protocols/WebServiceHandlerFactory.cs ()
@@ -113,6 +113,7 @@
supported = WSConfig.IsSupported (protocol);
if (!supported) {
switch (protocol) {
+ case WSProtocol.HttpSoap12:
case WSProtocol.HttpSoap:
supported = WSConfig.IsSupported (WSProtocol.HttpSoap12);
break;
@@ -131,6 +132,7 @@
throw new InvalidOperationException ("Unsupported request format.");
switch (protocol) {
+ case WSProtocol.HttpSoap12:
case WSProtocol.HttpSoap:
handler = GetTypeHandler (context, new HttpSoapWebServiceHandler (type));
break;
@@ -173,7 +175,12 @@
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
{
Index: System.Web.Services.Protocols/SoapClientMessage.cs
===================================================================
--- System.Web.Services.Protocols/SoapClientMessage.cs ( 69654)
+++ System.Web.Services.Protocols/SoapClientMessage.cs ()
@@ -59,6 +59,8 @@
this.client = client;
this.url = url;
Parameters = parameters;
+ if (SoapVersion == SoapProtocolVersion.Soap12)
+ ContentType = "application/soap+xml";
}
#endregion
Index: System.Web.Services.Protocols/Fault12.cs
===================================================================
--- System.Web.Services.Protocols/Fault12.cs ( 69654)
+++ System.Web.Services.Protocols/Fault12.cs ()
@@ -75,7 +75,8 @@
{
Code = new Soap12FaultCode ();
Code.Value = ex.Code;
- Code.Subcode = CreateFaultCode (ex.SubCode);
+ if (ex.SubCode != null)
+ Code.Subcode = CreateFaultCode (ex.SubCode);
Node = ex.Node;
Role = ex.Role;
Reason = new Soap12FaultReason ();
@@ -99,6 +100,8 @@
static Soap12FaultCode CreateFaultCode (SoapFaultSubCode code)
{
+ if (code == null)
+ throw new ArgumentNullException ("code");
Soap12FaultCode ret = new Soap12FaultCode ();
ret.Value = code.Code;
if (code.SubCode != null)
Index: System.Web.Services.Protocols/HttpSoapWebServiceHandler.cs
===================================================================
--- System.Web.Services.Protocols/HttpSoapWebServiceHandler.cs ( 69654)
+++ System.Web.Services.Protocols/HttpSoapWebServiceHandler.cs ()
@@ -143,7 +143,12 @@
// If the routing style is SoapAction, then we can get the method information now
// and set it to the SoapMessage
+#if NET_2_0
+ if (_typeStubInfo.RoutingStyle == SoapServiceRoutingStyle.SoapAction &&
+ message.SoapVersion != SoapProtocolVersion.Soap12)
+#else
if (_typeStubInfo.RoutingStyle == SoapServiceRoutingStyle.SoapAction)
+#endif
{
soapAction = request.Headers ["SOAPAction"];
if (soapAction == null) throw new SoapException ("Missing SOAPAction header", SoapException.ClientFaultCode);
@@ -272,7 +277,13 @@
if ((message.ContentEncoding != null) && (message.ContentEncoding.Length > 0))
response.AppendHeader("Content-Encoding", message.ContentEncoding);
+#if NET_2_0
+ response.ContentType = message.SoapVersion == SoapProtocolVersion.Soap12 ?
+ "application/soap+xml; charset=utf-8" :
+ "text/xml; charset=utf-8";
+#else
response.ContentType = "text/xml; charset=utf-8";
+#endif
if (message.Exception != null) response.StatusCode = 500;
Stream responseStream = response.OutputStream;
Index: System.Web.Services.Protocols/SoapHttpClientProtocol.cs
===================================================================
--- System.Web.Services.Protocols/SoapHttpClientProtocol.cs ( 69654)
+++ System.Web.Services.Protocols/SoapHttpClientProtocol.cs ()
@@ -202,7 +202,12 @@
WebRequest request = GetWebRequest (uri);
request.Method = "POST";
WebHeaderCollection headers = request.Headers;
+#if NET_2_0
+ if (message.SoapVersion != SoapProtocolVersion.Soap12)
+ headers.Add ("SOAPAction", "\"" + message.Action + "\"");
+#else
headers.Add ("SOAPAction", "\"" + message.Action + "\"");
+#endif
request.ContentType = message.ContentType + "; charset=utf-8";
return request;
}