Beispiel #1
0
        public TInfoShop getInfo(TInfoShop_Input ShopInfo)
        {
            object[] results = this.Invoke("getInfo", new object[] {
                ShopInfo
            });

            return((TInfoShop)(results[0]));
        }
Beispiel #2
0
 /// <remarks/>
 public System.IAsyncResult BegingetInfo(TInfoShop_Input ShopInfo, System.AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("getInfo", new object[] {
         ShopInfo
     }, callback, asyncState));
 }
		public void shopInStoreDatabase() 
		{
			Console.WriteLine("Test shopInStoreDatabase");

			// create a shop
			TCreateShop Shop_create = new TCreateShop();
			Shop_create.Alias = ALIAS;
			Shop_create.Database = "Store";
			Shop_create.ImportFiles = new String[0];
			Shop_create.ShopAlias = ALIAS;
			Shop_create.ShopType = "ECom100";
			Shop_create.DomainName = "mydomain.com";
            Shop_create.SecondaryDomains = new string[] { "herdomain.com", "hisdomain.com" };
            Shop_create.HasSSLCertificateSpecified = true;
            Shop_create.HasSSLCertificate = true;
            Shop_create.IsTrialShopSpecified = true;
            Shop_create.IsTrialShop = true;
            Shop_create.IsInternalTestShopSpecified = false;
            Shop_create.IsInternalTestShop = false;
            Shop_create.MerchantLogin = "******";
            Shop_create.MerchantPassword = "******";
            Shop_create.MerchantEMail = "*****@*****.**";

            // optionally set some shop attributes
            TAttribute attribute = new TAttribute();
            attribute.Type = "String";
            attribute.Name = "AdditionalHtmlHead";
            attribute.Value = "<meta name=\"keywords\", content=\"webservice test\" />";
            Shop_create.Attributes = new TAttribute[] { attribute };

			Console.WriteLine("shopConfigService.create");
			int ShopID = shopConfigService.create(Shop_create);

			Assert.Greater(ShopID, 0, "shop created in Store database");

			// test if a shop reference exists
			TShopRef shopRef = new TShopRef();
			shopRef.Alias = ALIAS;

			Console.WriteLine("shopConfigService.exists");
			bool exists = shopConfigService.exists(shopRef);
			
			Assert.IsTrue(exists, "exists?");

			// get information about a shop
            TInfoShop_Input infoShopInput = new TInfoShop_Input();
            infoShopInput.Alias = ALIAS;
            infoShopInput.Attributes = new string[] { "AdditionalHtmlHead" }; // optional

            Console.WriteLine("shopConfigService.getInfo");
            TInfoShop Shop_out = shopConfigService.getInfo(infoShopInput);
			
			Assert.AreEqual(Shop_create.ShopType, Shop_out.ShopType, "ShopType");
			Assert.AreEqual(Shop_create.HasSSLCertificate, Shop_out.HasSSLCertificate, "HasSSLCertificate");
			Assert.AreEqual(Shop_create.IsTrialShop, Shop_out.IsTrialShop, "IsTrialShop");
			Assert.AreEqual(Shop_create.IsInternalTestShop, Shop_out.IsInternalTestShop, "IsInternalTestShop");
			Assert.AreEqual(Shop_create.DomainName, Shop_out.DomainName, "DomainName");
            Assert.AreEqual(Shop_create.SecondaryDomains, Shop_out.SecondaryDomains, "SecondaryDomains");
			Assert.AreEqual(Shop_create.Database, Shop_out.Database, "Database");
            Assert.AreEqual(Shop_create.MerchantLogin, Shop_out.MerchantLogin, "MerchantLogin");
            Assert.AreEqual(Shop_create.MerchantEMail, Shop_out.MerchantEMail, "MerchantEMail");
            Assert.IsNotNull(Shop_out.Attributes, attribute.Value, "updates Attributes exist");
            Assert.AreEqual(1, Shop_out.Attributes.Length, "number of updates Attributes exist");
            Assert.AreEqual(Shop_create.Attributes[0].Value, Shop_out.Attributes[0].Value, "updated Attributes");
            
            // update the shop
			// - change shop type
			// - change flags HasSSLCertificate, IsTrialShop, IsInternalTestShop 
			// - change domain
			TUpdateShop Shop_update = new TUpdateShop();
			Shop_update.Alias = ALIAS;
			Shop_update.Database = "Store";
			Shop_update.ShopType = "ECom1000";
            Shop_update.HasSSLCertificateSpecified = true;
            Shop_update.HasSSLCertificate = false;
            Shop_update.IsTrialShopSpecified = true;
            Shop_update.IsTrialShop = false;
            Shop_update.IsInternalTestShopSpecified = true;
            Shop_update.IsInternalTestShop = true;
            Shop_update.DomainName = "yourdomain.com";
            Shop_update.SecondaryDomains = new string[] { "ourdomain.com", "theirdomain.com" };
            Shop_update.MarkedForDelete = true;
            Shop_update.ShopAlias = ALIAS3;
            Shop_update.MerchantLogin = "******";
            Shop_update.MerchantPassword = "******";
            Shop_update.MerchantEMail = "*****@*****.**";

            // optinally set some shop attributes
            attribute.Value = "<meta name=\"keywords\", content=\"webservice test update\" />";
            Shop_update.Attributes = new TAttribute[] { attribute };
			
			Console.WriteLine("shopConfigService.update");
			shopConfigService.update(Shop_update);

			// get information about the updated shop
			Console.WriteLine("shopConfigService.getInfo");
            Shop_out = shopConfigService.getInfo(infoShopInput);

			Assert.AreEqual(Shop_update.ShopType, Shop_out.ShopType, "updated ShopType");
			Assert.AreEqual(Shop_update.HasSSLCertificate, Shop_out.HasSSLCertificate, "updated HasSSLCertificate");
			Assert.AreEqual(Shop_update.IsTrialShop, Shop_out.IsTrialShop, "updated IsTrialShop");
			Assert.AreEqual(Shop_update.IsInternalTestShop, Shop_out.IsInternalTestShop, "updated IsInternalTestShop");
			Assert.AreEqual(Shop_update.DomainName, Shop_out.DomainName, "updated DomainName");
            Assert.AreEqual(Shop_update.SecondaryDomains, Shop_out.SecondaryDomains, "updated SecondaryDomains");
            Assert.AreEqual(Shop_create.Database, Shop_out.Database, "updated Database");
            Assert.IsNotNull(Shop_out.MarkedForDelOn);
            Assert.AreEqual(Shop_update.ShopAlias, Shop_out.ObjectAlias, "updated ObjectAlias");
            Assert.AreEqual(OBJECTPATH, Shop_out.ObjectPath, "updated ObjectPath");
            Assert.AreEqual(Shop_update.MerchantLogin, Shop_out.MerchantLogin, "updated MerchantLogin");
            Assert.AreEqual(Shop_update.MerchantEMail, Shop_out.MerchantEMail, "updated MerchantEMail");
            Assert.IsNotNull(Shop_out.Attributes, "updates Attributes exist");
            Assert.AreEqual(1, Shop_out.Attributes.Length, "number of updates Attributes exist");
            Assert.AreEqual(Shop_update.Attributes[0].Value, Shop_out.Attributes[0].Value, "updated Attributes");

			// WARNING: this can be very slow if there are many shops
			Console.WriteLine("shopConfigService.getAllInfo");
			TInfoShop[] Shops_out = shopConfigService.getAllInfo();

            Console.WriteLine("shopConfigService.setSecondaryDomains");
            string[] secondaryDomains = new string[]{ "invaliddomain.com", "updateddomain.com" };
            shopConfigService.setSecondaryDomains(shopRef, secondaryDomains);
            Shop_out = shopConfigService.getInfo(infoShopInput);
            Assert.AreEqual(secondaryDomains, Shop_out.SecondaryDomains, "set SecondaryDomains");

            //test rename shopref
            TUpdateShop Shop_update_Temp = new TUpdateShop();
            Shop_update_Temp.Alias = ALIAS;
            Shop_update_Temp.NewAlias = ALIAS2;

            //rename shopref
            Console.WriteLine("shopConfigService.update");
            shopConfigService.update(Shop_update_Temp);

            TInfoShop_Input infoShopInputTemp = new TInfoShop_Input();
            infoShopInputTemp.Alias = ALIAS2;

            // get information about the updated shop
            Console.WriteLine("shopConfigService.getInfo");
            Shop_out = shopConfigService.getInfo(infoShopInputTemp);

            Assert.AreEqual(ALIAS2, Shop_out.Alias, "updated ShopRefAlias");

            Shop_update_Temp.Alias = ALIAS2;
            Shop_update_Temp.NewAlias = ALIAS;

            Console.WriteLine("shopConfigService.update");
            shopConfigService.update(Shop_update_Temp);

            // get information about the updated shop
            Console.WriteLine("shopConfigService.getInfo");
            Shop_out = shopConfigService.getInfo(infoShopInput);

            Assert.AreEqual(ALIAS, Shop_out.Alias, "get old ShopRefAlias");

			// delete the shop data (leaves the shop history in PBO)
			Console.WriteLine("shopConfigService.delete");
			shopConfigService.delete(shopRef);

			Console.WriteLine("shopConfigService.exists");
			exists = shopConfigService.exists(shopRef);
			Assert.IsTrue(exists, "shop history still exists");

			Console.WriteLine("shopConfigService.getInfo");
			Shop_out = shopConfigService.getInfo(infoShopInput);
			Assert.IsTrue(Shop_out.IsDeleted, "flag IsDeleted was set");
			// Assert.IsNull(Shop_out.Database, "data was removed from store database");

			// delete the shop completely (including history)
			Console.WriteLine("shopConfigService.deleteShopRef");
			shopConfigService.deleteShopRef(shopRef);

			// check that the shop is really deleted
			Console.WriteLine("shopConfigService.exists");
			exists = shopConfigService.exists(shopRef);
			Assert.IsFalse(exists, "shop is deleted completely");
		}
		public void shopInDefaultDatabase()
		{
			Console.WriteLine("Test shopInDefaultDatabase");

			// create a new shop in the default database using default import file
			TCreateShop Shop_create = new TCreateShop();
			Shop_create.Alias = ALIAS;
			Shop_create.Database = "Store";
			Shop_create.ImportFiles = null;
			Shop_create.ShopAlias = ALIAS;
			Shop_create.WebServerScriptNamePart = ALIAS;
			Shop_create.ShopType = "ECom100";
			Shop_create.DomainName = "mydomain.com";
            Shop_create.HasSSLCertificateSpecified = true;
            Shop_create.HasSSLCertificate = false;
            Shop_create.IsTrialShopSpecified = true;
            Shop_create.IsTrialShop = false;
            Shop_create.IsInternalTestShopSpecified = true;
            Shop_create.IsInternalTestShop = false;
			
			Console.WriteLine("shopConfigService.create");
			int ShopID = shopConfigService.create( Shop_create );
			
			Assert.Greater( ShopID, 0, "create in default database" );

			// check in which database the shop was actually created
            TInfoShop_Input infoShopInput = new TInfoShop_Input();
            infoShopInput.Alias = ALIAS;

			Console.WriteLine("shopConfigService.getInfo");
            TInfoShop Shop_out = shopConfigService.getInfo(infoShopInput);

			Assert.IsNotNull( Shop_out.Database, "default database name" );

			// delete the shop completely (including history)
            TShopRef shopRef = new TShopRef();
            shopRef.Alias = ALIAS;
            
            Console.WriteLine("shopConfigService.deleteShopRef");
			shopConfigService.deleteShopRef(shopRef);
		}
Beispiel #5
0
 /// <remarks/>
 public System.IAsyncResult BegingetInfo(TInfoShop_Input ShopInfo, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("getInfo", new object[] {
                 ShopInfo}, callback, asyncState);
 }
Beispiel #6
0
 public TInfoShop getInfo(TInfoShop_Input ShopInfo) {
     object[] results = this.Invoke("getInfo", new object[] {
                 ShopInfo});
     return ((TInfoShop)(results[0]));
 }