public override void StoreAsset(AssetBase asset)
        {
            try
            {
                //  MemoryStream s = new MemoryStream();

                // XmlSerializer xs = new XmlSerializer(typeof(AssetBase));
                //   xs.Serialize(s, asset);
                //  RestClient rc = new RestClient(_assetServerUrl);

                string assetUrl = _assetServerUrl + "/assets/";

                //rc.AddResourcePath("assets");

                // rc.RequestMethod = "POST";
                //  rc.Request(s);
                //m_log.InfoFormat("[ASSET]: Stored {0}", rc);

                m_log.InfoFormat("[GRID ASSET CLIENT]: Sending store request for asset {0}", asset.FullID);

                RestObjectPoster.BeginPostObject <AssetBase>(assetUrl, asset);
            }
            catch (Exception e)
            {
                m_log.ErrorFormat("[GRID ASSET CLIENT]: {0}", e);
            }
        }
Example #2
0
        public override void StoreAsset(AssetBase asset)
        {
            if (m_encryptOnUpload)
            {
                EncryptAssetBase(asset, m_encryptKey);
            }

            try
            {
                string assetUrl = _assetServerUrl + "/assets/";

                m_log.InfoFormat("[CRYPTO GRID ASSET CLIENT]: Sending store request for asset {0}", asset.FullID);

                RestObjectPoster.BeginPostObject <AssetBase>(assetUrl, asset);
            }
            catch (Exception e)
            {
                m_log.ErrorFormat("[CRYPTO GRID ASSET CLIENT]: {0}", e);
            }
        }