+2006-12-19 Atsushi Enomoto <atsushi@ximian.com>
+
+ * SoapHttpClientProtocol.cs :
+ Don't use HTTP header when SoapVersion is Soap12.
+ * HttpSoapWebServiceHandler.cs :
+ With SOAP 1.2 message we can only use Body content.
+ Set correct Content-Type for SOAP 1.2 message.
+ * Fault12.cs : added null check.
+ * SoapClientMessage.cs :
+ Set correct Content-Type for SOAP 1.2 message.
+ * WebServiceHandlerFactory.cs :
+ don't reject SOAP 1.2 protocol here.
+
2006-12-18 Atsushi Enomoto <atsushi@ximian.com>
* WebServiceHandlerFactory.cs,
{
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 ();
static Soap12FaultCode CreateFaultCode (SoapFaultSubCode code)
{
+ if (code == null)
+ throw new ArgumentNullException ("code");
Soap12FaultCode ret = new Soap12FaultCode ();
ret.Value = code.Code;
if (code.SubCode != null)
// 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);
// If the routing style is RequestElement, try to get the method name from the
// stream processed by the high priority extensions
+#if NET_2_0
+ if (_typeStubInfo.RoutingStyle == SoapServiceRoutingStyle.RequestElement ||
+ message.SoapVersion == SoapProtocolVersion.Soap12)
+#else
if (_typeStubInfo.RoutingStyle == SoapServiceRoutingStyle.RequestElement)
+#endif
{
MemoryStream mstream;
byte[] buffer = null;
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;
this.client = client;
this.url = url;
Parameters = parameters;
+ if (SoapVersion == SoapProtocolVersion.Soap12)
+ ContentType = "application/soap+xml";
}
#endregion
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;
}
supported = WSConfig.IsSupported (protocol);
if (!supported) {
switch (protocol) {
+ case WSProtocol.HttpSoap12:
case WSProtocol.HttpSoap:
supported = WSConfig.IsSupported (WSProtocol.HttpSoap12);
break;
throw new InvalidOperationException ("Unsupported request format.");
switch (protocol) {
+ case WSProtocol.HttpSoap12:
case WSProtocol.HttpSoap:
handler = GetTypeHandler (context, new HttpSoapWebServiceHandler (type));
break;
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
{