WebServiceExporter should generate WebServiceBinding attribute with WSI basic profile 1.1 by default. [SPRNET-869]

This commit is contained in:
bbaia
2008-08-05 13:16:21 +00:00
parent f12d845982
commit 852b83a4c6
2 changed files with 126 additions and 4 deletions

View File

@@ -121,6 +121,57 @@ namespace Spring.Web.Services
Assert.AreEqual(wse.Namespace, wsa.Namespace);
}
#if NET_2_0
[Test]
public void CreatesDefaultWebServiceBindingAttribute()
{
wse.ObjectName = "CreatesDefaultWebServiceBindingAttribute";
wse.TargetName = "noDecoratedService";
wse.AfterPropertiesSet();
Type proxyType = wse.ObjectType;
object[] attrs = proxyType.GetCustomAttributes(typeof(WebServiceBindingAttribute), true);
Assert.IsNotEmpty(attrs);
Assert.AreEqual(1, attrs.Length);
WebServiceBindingAttribute wsba = attrs[0] as WebServiceBindingAttribute;
Assert.AreEqual(WsiProfiles.BasicProfile1_1, wsba.ConformsTo);
}
[Test]
public void CreatesWebServiceBindingAttributeWithNoWsiProfile()
{
wse.ObjectName = "CreatesWebServiceBindingAttributeWithNoWsiProfile";
wse.TargetName = "noDecoratedService";
wse.WsiProfile = WsiProfiles.None;
wse.AfterPropertiesSet();
Type proxyType = wse.ObjectType;
object[] attrs = proxyType.GetCustomAttributes(typeof(WebServiceBindingAttribute), true);
Assert.IsNotEmpty(attrs);
Assert.AreEqual(1, attrs.Length);
WebServiceBindingAttribute wsba = attrs[0] as WebServiceBindingAttribute;
Assert.AreEqual(WsiProfiles.None, wsba.ConformsTo);
}
[Test]
public void UsesExistingWebServiceBindingAttributeWithDecoratedClass()
{
wse.ObjectName = "UsesExistingWebServiceBindingAttributeWithDecoratedClass";
wse.TargetName = "decoratedService";
wse.AfterPropertiesSet();
Type proxyType = wse.ObjectType;
object[] attrs = proxyType.GetCustomAttributes(typeof(WebServiceBindingAttribute), true);
Assert.IsNotEmpty(attrs);
Assert.AreEqual(1, attrs.Length);
WebServiceBindingAttribute wsba = attrs[0] as WebServiceBindingAttribute;
Assert.AreEqual(WsiProfiles.None, wsba.ConformsTo);
}
#endif
[Test]
public void CreatesDefaultWebMethodAttributeWithNoDecoratedMethod()
{
@@ -264,6 +315,9 @@ namespace Spring.Web.Services
}
[WebService(Name = "Decorated service")]
#if NET_2_0
[WebServiceBinding(ConformsTo=WsiProfiles.None)]
#endif
public class DecoratedService : IService
{
[WebMethod(Description="SomeMethod description")]