Exemplo n.º 1
0
        // --------------------------------------------------------[]
        private static void ProceedSubmissionTask( EbaySubmissionTask task )
        {
            task.AssertCanBeProceeded();

            Response< MipGetFeedSubmissionOverallStatusResult > statusResponse = null;

            try {
                var args = task.Args;
                var submission = new MipFeedSubmissionDescriptor(
                    args.MipFeedDescriptor,
                    task.EbaySubmissionResponse.Result.MipSubmissionId );

                statusResponse = MipConnector.Instance.GetFeedSubmissionOverallStatus( submission );
                statusResponse.Check();

                task.MipFeedSubmissionOverallStatus = statusResponse.Result.Status;
                task.EbaySubmissionResponse.Result.MipItemId = statusResponse.Result.MipItemId;

                task.AddProceedInfo( GetProceedInfo( statusResponse ) );
            }
            catch {
                task.MipFeedSubmissionOverallStatus = MipFeedSubmissionOverallStatus.Failure;
                task.AddProceedInfo( GetProceedInfo( statusResponse ) );
            }
            task.WasUpdatedNow();
        }
Exemplo n.º 2
0
        public static void DemoshopStoreTask_Serialization()
        {
            var storeTask = new DemoshopStoreTask();
            var submissionTask1 = new EbaySubmissionTask();
            var submissionTask2 = new EbaySubmissionTask();
            storeTask.AddSubTasks( submissionTask1, submissionTask2 );
            submissionTask2.AbstractResponse = new ChannelResponse< EbaySubmissionResult >(
                new Exception( "Test Exception" ) );

            var str = storeTask.ToYamlString( SerializationOptions.EmitDefaults );

            Console.WriteLine( str );

            Assert.That( str.Contains( "SubTasks:" ), "Contains SubTasks" );
            Assert.That( str.Contains( "Test Exception" ), "Contains Test Exception" );
        }
Exemplo n.º 3
0
        // --------------------------------------------------------[]
        private static void DoRunSubmissionTask( EbaySubmissionTask task )
        {
            try {
                var args = task.Args;

                CreateFeedFile( args.MipFeedDescriptor );

                var mipResponse = MipConnector.Instance.SubmitFeed( args.MipFeedDescriptor );

                EraseFeedFolder( args.MipFeedDescriptor );

                mipResponse.Check();

                task.EbaySubmissionResponse = new ChannelResponse< EbaySubmissionResult > {
                    Result = new EbaySubmissionResult { MipSubmissionId = mipResponse.Result.FeedSubmissionId },
                    InnerResponses = { mipResponse }
                };
                task.MipFeedSubmissionOverallStatus = MipFeedSubmissionOverallStatus.InProgress;
            }
            catch( Exception exception ) {
                task.EbaySubmissionResponse = new ChannelResponse< EbaySubmissionResult >( exception );
            }
            task.WasUpdatedNow();
        }
Exemplo n.º 4
0
 // --------------------------------------------------------[]
 private void DoProceedTask( EbaySubmissionTask task )
 {
     switch( task.ChannelMethod ) {
         case ChannelMethod.Submit :
             ProceedSubmissionTask( task );
             break;
         default :
             throw new SpreadbotException( "Unexpected Task Channel Method: [{0}]", task.ChannelMethod );
     }
 }