Author: atsushi
Date: 2006-11-30 02:06:59 -0500 (Thu, 30 Nov 2006)
New Revision: 68734
Modified:
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Description/ChangeLog
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Description/HttpSimpleProtocolReflector.cs
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpGetTypeStubInfo.cs
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpPostTypeStubInfo.cs
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpSimpleTypeStubInfo.cs
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/Methods.cs
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/ServerType.cs
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/XmlReturnReader.cs
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/XmlReturnWriter.cs
Log:
2006-11-30 Atsushi Enomoto <[EMAIL PROTECTED]>
* ServerType.cs : Now LogicalTypeInfo became this type to implement
this class (and SoapTypeStubInfo to SoapServerType later).
* TypeStubManager.cs : so, split LogicalTypeInfo from here.
* XmlReturnReader.cs, XmlReturnWriter.cs, Methods.cs,
HttpSimpleTypeStubInfo.cs, HttpGetTypeStubInfo.cs,
HttpPostTypeStubInfo.cs : LogicalTypeInfo -> ServerType.
* HttpSimpleProtocolReflector.cs : LogicalTypeInfo -> ServerType.
Modified:
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Description/ChangeLog
===================================================================
---
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Description/ChangeLog
2006-11-30 06:59:32 UTC (rev 68733)
+++
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Description/ChangeLog
2006-11-30 07:06:59 UTC (rev 68734)
@@ -1,5 +1,9 @@
2006-11-30 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * HttpSimpleProtocolReflector.cs : LogicalTypeInfo -> ServerType.
+
+2006-11-30 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* SoapHeaderFaultBinding.cs, NamedItem.cs, SoapBinding.cs,
MimeXmlBinding.cs, SoapBodyBinding.cs, MimeContentBinding.cs,
SoapHeaderBinding.cs, HttpBinding.cs: cosmetic 2.0 API fixes.
Modified:
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Description/HttpSimpleProtocolReflector.cs
===================================================================
---
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Description/HttpSimpleProtocolReflector.cs
2006-11-30 06:59:32 UTC (rev 68733)
+++
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Description/HttpSimpleProtocolReflector.cs
2006-11-30 07:06:59 UTC (rev 68734)
@@ -68,7 +68,7 @@
protected override bool ReflectMethod ()
{
- LogicalTypeInfo ti = TypeStubManager.GetLogicalTypeInfo
(ServiceType);
+ ServerType ti = TypeStubManager.GetLogicalTypeInfo
(ServiceType);
HttpOperationBinding sob = new HttpOperationBinding();
sob.Location = "/" + MethodStubInfo.Name;
OperationBinding.Extensions.Add (sob);
Modified:
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog
===================================================================
---
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog
2006-11-30 06:59:32 UTC (rev 68733)
+++
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog
2006-11-30 07:06:59 UTC (rev 68734)
@@ -1,5 +1,14 @@
2006-11-30 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * ServerType.cs : Now LogicalTypeInfo became this type to implement
+ this class (and SoapTypeStubInfo to SoapServerType later).
+ * TypeStubManager.cs : so, split LogicalTypeInfo from here.
+ * XmlReturnReader.cs, XmlReturnWriter.cs, Methods.cs,
+ HttpSimpleTypeStubInfo.cs, HttpGetTypeStubInfo.cs,
+ HttpPostTypeStubInfo.cs : LogicalTypeInfo -> ServerType.
+
+2006-11-30 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* SoapHttpClientProtocol.cs : looks like (only) the last Text is used
instead of the first one in .net.
Modified:
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpGetTypeStubInfo.cs
===================================================================
---
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpGetTypeStubInfo.cs
2006-11-30 06:59:32 UTC (rev 68733)
+++
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpGetTypeStubInfo.cs
2006-11-30 07:06:59 UTC (rev 68734)
@@ -43,7 +43,7 @@
internal class HttpGetTypeStubInfo : HttpSimpleTypeStubInfo
{
- public HttpGetTypeStubInfo (LogicalTypeInfo logicalTypeInfo):
base (logicalTypeInfo)
+ public HttpGetTypeStubInfo (ServerType logicalTypeInfo): base
(logicalTypeInfo)
{
}
Modified:
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpPostTypeStubInfo.cs
===================================================================
---
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpPostTypeStubInfo.cs
2006-11-30 06:59:32 UTC (rev 68733)
+++
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpPostTypeStubInfo.cs
2006-11-30 07:06:59 UTC (rev 68734)
@@ -43,7 +43,7 @@
internal class HttpPostTypeStubInfo : HttpSimpleTypeStubInfo
{
- public HttpPostTypeStubInfo (LogicalTypeInfo logicalTypeInfo):
base (logicalTypeInfo)
+ public HttpPostTypeStubInfo (ServerType logicalTypeInfo): base
(logicalTypeInfo)
{
}
Modified:
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpSimpleTypeStubInfo.cs
===================================================================
---
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpSimpleTypeStubInfo.cs
2006-11-30 06:59:32 UTC (rev 68733)
+++
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpSimpleTypeStubInfo.cs
2006-11-30 07:06:59 UTC (rev 68734)
@@ -97,7 +97,7 @@
internal class HttpSimpleTypeStubInfo : TypeStubInfo
{
- public HttpSimpleTypeStubInfo (LogicalTypeInfo
logicalTypeInfo): base (logicalTypeInfo)
+ public HttpSimpleTypeStubInfo (ServerType logicalTypeInfo):
base (logicalTypeInfo)
{
}
Modified:
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/Methods.cs
===================================================================
---
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/Methods.cs
2006-11-30 06:59:32 UTC (rev 68733)
+++
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/Methods.cs
2006-11-30 07:06:59 UTC (rev 68734)
@@ -504,7 +504,7 @@
internal XmlReflectionImporter xmlImporter;
internal SoapReflectionImporter soapImporter;
- public SoapTypeStubInfo (LogicalTypeInfo logicalTypeInfo)
+ public SoapTypeStubInfo (ServerType logicalTypeInfo)
: base (logicalTypeInfo)
{
xmlImporter = new XmlReflectionImporter ();
Modified:
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/ServerType.cs
===================================================================
---
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/ServerType.cs
2006-11-30 06:59:32 UTC (rev 68733)
+++
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/ServerType.cs
2006-11-30 07:06:59 UTC (rev 68734)
@@ -27,17 +27,128 @@
// 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.Web.Services;
+using System.Web.Services.Description;
-#if NET_2_0
-
namespace System.Web.Services.Protocols
{
- public class ServerType
+ //
+ // This class has information abou a web service. Through providess
+ // access to the TypeStubInfo instances for each protocol.
+ //
+#if NET_2_0
+ public
+#else
+ internal
+#endif
+ class ServerType // It was LogicalTypeInfo until Mono 1.2.
{
- public ServerType (Type type)
+ LogicalMethodInfo[] logicalMethods;
+
+ internal string WebServiceName;
+ internal string WebServiceNamespace;
+ internal string WebServiceAbstractNamespace;
+ internal string Description;
+ internal Type Type;
+ bool useEncoded;
+
+ TypeStubInfo soapProtocol;
+ TypeStubInfo httpGetProtocol;
+ TypeStubInfo httpPostProtocol;
+
+ public ServerType (Type t)
{
+ this.Type = t;
+
+ object [] o = Type.GetCustomAttributes (typeof
(WebServiceAttribute), false);
+ if (o.Length == 1){
+ WebServiceAttribute a = (WebServiceAttribute) o
[0];
+ WebServiceName = (a.Name != string.Empty) ?
a.Name : Type.Name;
+ WebServiceNamespace = (a.Namespace !=
string.Empty) ? a.Namespace : WebServiceAttribute.DefaultNamespace;
+ Description = a.Description;
+ } else {
+ WebServiceName = Type.Name;
+ WebServiceNamespace =
WebServiceAttribute.DefaultNamespace;
+ }
+
+ // Determine the namespaces for literal and encoded
schema types
+
+ useEncoded = false;
+
+ o = t.GetCustomAttributes
(typeof(SoapDocumentServiceAttribute), true);
+ if (o.Length > 0) {
+ SoapDocumentServiceAttribute at =
(SoapDocumentServiceAttribute) o[0];
+ useEncoded = (at.Use == SoapBindingUse.Encoded);
+ }
+ else if (t.GetCustomAttributes
(typeof(SoapRpcServiceAttribute), true).Length > 0)
+ useEncoded = true;
+
+ string sep = WebServiceNamespace.EndsWith ("/") ? "" :
"/";
+
+ WebServiceAbstractNamespace = WebServiceNamespace + sep
+ "AbstractTypes";
+
+ MethodInfo [] type_methods = Type.GetMethods
(BindingFlags.Instance | BindingFlags.Public);
+ logicalMethods = LogicalMethodInfo.Create
(type_methods, LogicalMethodTypes.Sync);
}
+
+ internal LogicalMethodInfo[] LogicalMethods
+ {
+ get { return logicalMethods; }
+ }
+
+ internal TypeStubInfo GetTypeStub (string protocolName)
+ {
+ lock (this)
+ {
+ switch (protocolName)
+ {
+ case "Soap":
+ if (soapProtocol == null)
soapProtocol = CreateTypeStubInfo (typeof(SoapTypeStubInfo));
+ return soapProtocol;
+ case "HttpGet":
+ if (httpGetProtocol == null)
httpGetProtocol = CreateTypeStubInfo (typeof(HttpGetTypeStubInfo));
+ return httpGetProtocol;
+ case "HttpPost":
+ if (httpPostProtocol == null)
httpPostProtocol = CreateTypeStubInfo (typeof(HttpPostTypeStubInfo));
+ return httpPostProtocol;
+ }
+ }
+ throw new InvalidOperationException ("Protocol " +
protocolName + " not supported");
+ }
+
+ TypeStubInfo CreateTypeStubInfo (Type type)
+ {
+ TypeStubInfo tsi = (TypeStubInfo)
Activator.CreateInstance (type, new object[] {this});
+ tsi.Initialize ();
+ return tsi;
+ }
+
+ internal string GetWebServiceLiteralNamespace (string
baseNamespace)
+ {
+ if (useEncoded) {
+ string sep = baseNamespace.EndsWith ("/") ? ""
: "/";
+ return baseNamespace + sep + "literalTypes";
+ }
+ else
+ return baseNamespace;
+ }
+
+ internal string GetWebServiceEncodedNamespace (string
baseNamespace)
+ {
+ if (useEncoded)
+ return baseNamespace;
+ else {
+ string sep = baseNamespace.EndsWith ("/") ? ""
: "/";
+ return baseNamespace + sep + "encodedTypes";
+ }
+ }
+
+ internal string GetWebServiceNamespace (string baseNamespace,
SoapBindingUse use)
+ {
+ if (use == SoapBindingUse.Literal) return
GetWebServiceLiteralNamespace (baseNamespace);
+ else return GetWebServiceEncodedNamespace
(baseNamespace);
+ }
+
}
}
-
-#endif
Modified:
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs
===================================================================
---
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs
2006-11-30 06:59:32 UTC (rev 68733)
+++
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/TypeStubManager.cs
2006-11-30 07:06:59 UTC (rev 68734)
@@ -85,12 +85,12 @@
Hashtable name_to_method = new Hashtable ();
MethodStubInfo[] methods;
ArrayList bindings = new ArrayList ();
- LogicalTypeInfo logicalType;
+ ServerType logicalType;
string defaultBinding;
ArrayList mappings;
XmlSerializer[] serializers;
- public TypeStubInfo (LogicalTypeInfo logicalTypeInfo)
+ public TypeStubInfo (ServerType logicalTypeInfo)
{
this.logicalType = logicalTypeInfo;
@@ -99,7 +99,7 @@
Bindings.Add (binfo);
}
- public LogicalTypeInfo LogicalType
+ public ServerType LogicalType
{
get { return logicalType; }
}
@@ -238,133 +238,7 @@
public string Location;
}
-
//
- // This class has information abou a web service. Through providess
- // access to the TypeStubInfo instances for each protocol.
- //
- internal class LogicalTypeInfo
- {
- LogicalMethodInfo[] logicalMethods;
-
- internal string WebServiceName;
- internal string WebServiceNamespace;
- string WebServiceLiteralNamespace;
- string WebServiceEncodedNamespace;
- internal string WebServiceAbstractNamespace;
- internal string Description;
- internal Type Type;
- bool useEncoded;
-
- TypeStubInfo soapProtocol;
- TypeStubInfo httpGetProtocol;
- TypeStubInfo httpPostProtocol;
-
- public LogicalTypeInfo (Type t)
- {
- this.Type = t;
-
- object [] o = Type.GetCustomAttributes (typeof
(WebServiceAttribute), false);
- if (o.Length == 1){
- WebServiceAttribute a = (WebServiceAttribute) o
[0];
- WebServiceName = (a.Name != string.Empty) ?
a.Name : Type.Name;
- WebServiceNamespace = (a.Namespace !=
string.Empty) ? a.Namespace : WebServiceAttribute.DefaultNamespace;
- Description = a.Description;
- } else {
- WebServiceName = Type.Name;
- WebServiceNamespace =
WebServiceAttribute.DefaultNamespace;
- }
-
- // Determine the namespaces for literal and encoded
schema types
-
- useEncoded = false;
-
- o = t.GetCustomAttributes
(typeof(SoapDocumentServiceAttribute), true);
- if (o.Length > 0) {
- SoapDocumentServiceAttribute at =
(SoapDocumentServiceAttribute) o[0];
- useEncoded = (at.Use == SoapBindingUse.Encoded);
- }
- else if (t.GetCustomAttributes
(typeof(SoapRpcServiceAttribute), true).Length > 0)
- useEncoded = true;
-
- string sep = WebServiceNamespace.EndsWith ("/") ? "" :
"/";
-
- if (useEncoded) {
- WebServiceEncodedNamespace =
WebServiceNamespace;
- WebServiceLiteralNamespace =
WebServiceNamespace + sep + "literalTypes";
- }
- else {
- WebServiceEncodedNamespace =
WebServiceNamespace + sep + "encodedTypes";
- WebServiceLiteralNamespace =
WebServiceNamespace;
- }
-
- WebServiceAbstractNamespace = WebServiceNamespace + sep
+ "AbstractTypes";
-
- MethodInfo [] type_methods = Type.GetMethods
(BindingFlags.Instance | BindingFlags.Public);
- logicalMethods = LogicalMethodInfo.Create
(type_methods, LogicalMethodTypes.Sync);
- }
-
- public LogicalMethodInfo[] LogicalMethods
- {
- get { return logicalMethods; }
- }
-
- public TypeStubInfo GetTypeStub (string protocolName)
- {
- lock (this)
- {
- switch (protocolName)
- {
- case "Soap":
- if (soapProtocol == null)
soapProtocol = CreateTypeStubInfo (typeof(SoapTypeStubInfo));
- return soapProtocol;
- case "HttpGet":
- if (httpGetProtocol == null)
httpGetProtocol = CreateTypeStubInfo (typeof(HttpGetTypeStubInfo));
- return httpGetProtocol;
- case "HttpPost":
- if (httpPostProtocol == null)
httpPostProtocol = CreateTypeStubInfo (typeof(HttpPostTypeStubInfo));
- return httpPostProtocol;
- }
- }
- throw new InvalidOperationException ("Protocol " +
protocolName + " not supported");
- }
-
- TypeStubInfo CreateTypeStubInfo (Type type)
- {
- TypeStubInfo tsi = (TypeStubInfo)
Activator.CreateInstance (type, new object[] {this});
- tsi.Initialize ();
- return tsi;
- }
-
- public string GetWebServiceLiteralNamespace (string
baseNamespace)
- {
- if (useEncoded) {
- string sep = baseNamespace.EndsWith ("/") ? ""
: "/";
- return baseNamespace + sep + "literalTypes";
- }
- else
- return baseNamespace;
- }
-
- public string GetWebServiceEncodedNamespace (string
baseNamespace)
- {
- if (useEncoded)
- return baseNamespace;
- else {
- string sep = baseNamespace.EndsWith ("/") ? ""
: "/";
- return baseNamespace + sep + "encodedTypes";
- }
- }
-
- public string GetWebServiceNamespace (string baseNamespace,
SoapBindingUse use)
- {
- if (use == SoapBindingUse.Literal) return
GetWebServiceLiteralNamespace (baseNamespace);
- else return GetWebServiceEncodedNamespace
(baseNamespace);
- }
-
- }
-
- //
// Manages type stubs
//
internal class TypeStubManager
@@ -399,23 +273,23 @@
static internal TypeStubInfo GetTypeStub (Type t, string
protocolName)
{
- LogicalTypeInfo tm = GetLogicalTypeInfo (t);
+ ServerType tm = GetLogicalTypeInfo (t);
return tm.GetTypeStub (protocolName);
}
//
// This needs to be thread safe
//
- static internal LogicalTypeInfo GetLogicalTypeInfo (Type t)
+ static internal ServerType GetLogicalTypeInfo (Type t)
{
lock (type_to_manager)
{
- LogicalTypeInfo tm = (LogicalTypeInfo)
type_to_manager [t];
+ ServerType tm = (ServerType) type_to_manager
[t];
if (tm != null)
return tm;
- tm = new LogicalTypeInfo (t);
+ tm = new ServerType (t);
type_to_manager [t] = tm;
return tm;
Modified:
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/XmlReturnReader.cs
===================================================================
---
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/XmlReturnReader.cs
2006-11-30 06:59:32 UTC (rev 68733)
+++
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/XmlReturnReader.cs
2006-11-30 07:06:59 UTC (rev 68734)
@@ -50,7 +50,7 @@
public override object GetInitializer (LogicalMethodInfo
methodInfo)
{
- LogicalTypeInfo sti =
TypeStubManager.GetLogicalTypeInfo (methodInfo.DeclaringType);
+ ServerType sti = TypeStubManager.GetLogicalTypeInfo
(methodInfo.DeclaringType);
object[] ats =
methodInfo.ReturnTypeCustomAttributeProvider.GetCustomAttributes
(typeof(XmlRootAttribute), true);
XmlRootAttribute root = ats.Length > 0 ? ats[0] as
XmlRootAttribute : null;
return new XmlSerializer (methodInfo.ReturnType, null,
null, root, sti.GetWebServiceLiteralNamespace (sti.WebServiceNamespace));
@@ -67,7 +67,7 @@
sers[n] = null;
else
{
- LogicalTypeInfo sti =
TypeStubManager.GetLogicalTypeInfo (metinfo.DeclaringType);
+ ServerType sti =
TypeStubManager.GetLogicalTypeInfo (metinfo.DeclaringType);
object[] ats =
methodInfos[n].ReturnTypeCustomAttributeProvider.GetCustomAttributes
(typeof(XmlRootAttribute), true);
XmlRootAttribute root = ats.Length > 0
? ats[0] as XmlRootAttribute : null;
sers[n] = importer.ImportTypeMapping
(methodInfos[n].ReturnType, root, sti.GetWebServiceLiteralNamespace
(sti.WebServiceNamespace));
Modified:
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/XmlReturnWriter.cs
===================================================================
---
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/XmlReturnWriter.cs
2006-11-30 06:59:32 UTC (rev 68733)
+++
branches/atsushi/mcs/class/System.Web.Services/System.Web.Services.Protocols/XmlReturnWriter.cs
2006-11-30 07:06:59 UTC (rev 68734)
@@ -43,7 +43,7 @@
public override object GetInitializer (LogicalMethodInfo
methodInfo)
{
- LogicalTypeInfo sti =
TypeStubManager.GetLogicalTypeInfo (methodInfo.DeclaringType);
+ ServerType sti = TypeStubManager.GetLogicalTypeInfo
(methodInfo.DeclaringType);
object[] ats =
methodInfo.ReturnTypeCustomAttributeProvider.GetCustomAttributes
(typeof(XmlRootAttribute), true);
XmlRootAttribute root = ats.Length > 0 ? ats[0] as
XmlRootAttribute : null;
@@ -65,7 +65,7 @@
else
{
importer.IncludeTypes
(metinfo.CustomAttributeProvider);
- LogicalTypeInfo sti =
TypeStubManager.GetLogicalTypeInfo (metinfo.DeclaringType);
+ ServerType sti =
TypeStubManager.GetLogicalTypeInfo (metinfo.DeclaringType);
object[] ats =
methodInfos[n].ReturnTypeCustomAttributeProvider.GetCustomAttributes
(typeof(XmlRootAttribute), true);
XmlRootAttribute root = ats.Length > 0
? ats[0] as XmlRootAttribute : null;
sers[n] = importer.ImportTypeMapping
(methodInfos[n].ReturnType, root, sti.GetWebServiceLiteralNamespace
(sti.WebServiceNamespace));
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches