+2007-02-01 Konstantin Triger <kostat@mainsoft.com>
+
+ * ProtocolReflector.cs: throw if not conformant, but declared to be.
+
2007-01-25 Konstantin Triger <kostat@mainsoft.com>
* ServiceDescriptionReflector.cs: describe only supported bindings and
port.Binding = new XmlQualifiedName (binding.Name, binfo.Namespace);
service.Ports.Add (port);
}
+
+#if NET_2_0
+ if (binfo.WebServiceBindingAttribute != null && binfo.WebServiceBindingAttribute.ConformsTo != WsiProfiles.None && String.IsNullOrEmpty (binfo.WebServiceBindingAttribute.Name)) {
+ BasicProfileViolationCollection violations = new BasicProfileViolationCollection ();
+ if (!WebServicesInteroperability.CheckConformance (binfo.WebServiceBindingAttribute.ConformsTo, desc, violations))
+ throw new InvalidOperationException (violations [0].ToString ());
+ }
+#endif
}
bool ImportBindingContent (ServiceDescription desc, TypeStubInfo typeInfo, string url, BindingInfo binfo)
+2007-02-01 Konstantin Triger <kostat@mainsoft.com>
+
+ * TypeStubManager.cs, Methods.cs: refactor BindingInfo contruction to contain
+ either declared Bindings or a default one.
+
2007-02-01 Konstantin Triger <kostat@mainsoft.com>
* HttpSimpleWebServiceHandler.cs: Provide better error info.
Hashtable[] header_serializers = new Hashtable [3];
Hashtable[] header_serializers_byname = new Hashtable [3];
Hashtable methods_byaction = new Hashtable ();
-#if NET_2_0
- WsiProfiles wsi_claims = WsiProfiles.None;
-#endif
+
// Precomputed
internal SoapParameterStyle ParameterStyle;
internal SoapServiceRoutingStyle RoutingStyle;
{
xmlImporter = new XmlReflectionImporter ();
soapImporter = new SoapReflectionImporter ();
-
- object [] o;
-
- o = Type.GetCustomAttributes (typeof (WebServiceBindingAttribute), false);
-
+
if (typeof (SoapHttpClientProtocol).IsAssignableFrom (Type))
{
- if (o.Length == 0)
+ if (Bindings.Count == 0 || ((BindingInfo)Bindings[0]).WebServiceBindingAttribute == null)
throw new InvalidOperationException ("WebServiceBindingAttribute is required on proxy class '" + Type + "'.");
- if (o.Length > 1)
+ if (Bindings.Count > 1)
throw new InvalidOperationException ("Only one WebServiceBinding attribute may be specified on type '" + Type + "'.");
-
- // Remove the default binding, it is not needed since there is always
- // a binding attribute.
- Bindings.Clear ();
-#if NET_2_0
- WebServiceBindingAttribute wsba = (WebServiceBindingAttribute) o [0];
- if (wsba.EmitConformanceClaims)
- wsi_claims = wsba.ConformsTo;
-#endif
}
-
- foreach (WebServiceBindingAttribute at in o)
- AddBinding (new BindingInfo (at, LogicalType.WebServiceNamespace));
- o = Type.GetCustomAttributes (typeof (SoapDocumentServiceAttribute), false);
+ object [] o = Type.GetCustomAttributes (typeof (SoapDocumentServiceAttribute), false);
if (o.Length == 1){
SoapDocumentServiceAttribute a = (SoapDocumentServiceAttribute) o [0];
SoapExtensions = SoapExtension.GetTypeExtensions (Type);
}
-#if NET_2_0
- public override WsiProfiles WsiClaims {
- get { return wsi_claims; }
- }
-#endif
-
public override XmlReflectionImporter XmlImporter
{
get { return xmlImporter; }
{
this.logicalType = logicalTypeInfo;
- defaultBinding = logicalType.WebServiceName + ProtocolName;
- BindingInfo binfo = new BindingInfo (defaultBinding, logicalType.WebServiceNamespace);
- Bindings.Add (binfo);
+ object [] o = Type.GetCustomAttributes (typeof (WebServiceBindingAttribute), false);
+
+ string defaultBindingName = logicalType.WebServiceName + ProtocolName;
+ if (o.Length > 0)
+ foreach (WebServiceBindingAttribute at in o)
+ AddBinding (new BindingInfo (at, defaultBindingName, LogicalType.WebServiceNamespace));
+ else
+ AddBinding (new BindingInfo (null, defaultBindingName, logicalType.WebServiceNamespace));
}
#if NET_2_0
- public virtual WsiProfiles WsiClaims {
- get { return WsiProfiles.None; }
+ public WsiProfiles WsiClaims {
+ get {
+ return (((BindingInfo) Bindings [0]).WebServiceBindingAttribute != null) ?
+ ((BindingInfo) Bindings [0]).WebServiceBindingAttribute.ConformsTo : WsiProfiles.None;
+ }
}
#endif
internal class BindingInfo
{
- public BindingInfo (WebServiceBindingAttribute at, string ns)
- {
- Name = at.Name;
- Namespace = at.Namespace;
- if (Namespace == "") Namespace = ns;
- Location = at.Location;
- }
-
- public BindingInfo (string name, string ns)
+ public BindingInfo (WebServiceBindingAttribute at, string name, string ns)
{
- Name = name;
- Namespace = ns;
+ if (at != null) {
+ Name = at.Name;
+ Namespace = at.Namespace;
+ Location = at.Location;
+ WebServiceBindingAttribute = at;
+ }
+
+ if (Name == null || Name.Length == 0)
+ Name = name;
+
+ if (Namespace == null || Namespace.Length == 0)
+ Namespace = ns;
}
- public string Name;
- public string Namespace;
- public string Location;
+ public readonly string Name;
+ public readonly string Namespace;
+ public readonly string Location;
+ public readonly WebServiceBindingAttribute WebServiceBindingAttribute;
}
//