0

I have a problem with the simplygon cloud examples. The BasicPipeline application raises a "SPL processing failed for asset with modeluri" and more precisely a "The requested resource does not support http method 'POST'." exception on worker.OnWorkFailed. My azure connection settings seams to be correct. But there are maybe some other azure settings that might be not ok.

Code:

SimplygonCloudExamples.BasicPipeline
    {
        /// <summary>
        /// A very simple pipeline.
        /// 
        /// Takes a few arguments, all URIs pointing to Azure Blob Storage files/folders:
        /// ModelUri: Should point to a single asset on the azure blob storage of compatible format.
        /// SplUri:  Should point to a single SPL file on the azure blob storage.
        /// OutputUri:  Should point to a Azure Blob Storage folder with writing permissions.
        /// 
        /// Outputs progress percentage to console.
        /// </summary>
        class BasicPipelineProgram
        {
            // This method sets all the needed arguments to get running.
            static void SetSettingsManuallyInCode()
            {
                // The model to process
                Settings.Set("ModelUri", Settings.BlobStorageBasePath + Settings.BlobStorageContainerName + @"/Input/teapot.obj");

                // The SPL to use
                Settings.Set("SplUri", Settings.BlobStorageBasePath + Settings.BlobStorageContainerName + @"/SPLs/reduction_example_2018-07-2--17-02-03.spl");

                // The output location
                Settings.Set("OutputUri", Settings.BlobStorageBasePath + Settings.BlobStorageContainerName + @"/Output");
            }

            static void Main(string[] args)
            {
                // make sure we serialize materials correctly (numbers should use . not ,)
                Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US");

                Settings.SetCommandLineArgs(args);

                SetSettingsManuallyInCode();


                System.IO.FileInfo splFile = new AzureFile(Settings.AzureConnectionString, Settings.GetAsUri("SplUri")).DownloadToLocalTempFile();

                // Make sure we have all the arguments we need for this basic pipeline example


                // Initialize the Cloud API
                API.SimplygonCloudAPIBaseURL = Settings.SimplygonCloudAPIBaseURL;
                API.SimplygonCloudAPIKey = Settings.SimplygonCloudAPIKey;

                Worker worker = new Worker();
                List<Uri> textureUris = Settings.GetAsUriList("TextureUris");

                string sasToken = AzureUtility.GetSasToken_ReadWrite(Settings.AzureConnectionString, Settings.BlobStorageContainerName);

                // Do the pipeline work
                var SPLWork = new SPLProcessingWork(
                    assetPost: new AssetPost(Settings.GetAsUri("ModelURI"), sasToken),
                    splPost: new SPLPost(Settings.GetAsUri("SplUri"), sasToken),
                    storageContainerSasToken: sasToken,
                    outputUri: Settings.GetAsUri("OutputUri"),
                    onProcessingProgress: (asset, job) =>
                    {
                        // Note: this is in another thread, but Console.WriteLine handles concurrency for us
                        Console.WriteLine("Job Status: " + job.Status + (job.Status == JobStatus.Processing ? ", Processing progress: " + (job.ProgressPercentage).ToString("0") + "%" : ""));
                    },
                    processingSettings: new ProcessingSettings()
                    {
                        OutputFileName = "bob"
                    }
                );

                worker.OnWorkFailed = (workThatFailed, exception) =>
                {
                    if (workThatFailed is SPLProcessingWork)
                    {
                        Console.WriteLine("SPL processing failed for asset with modeluri: " + (workThatFailed as SPLProcessingWork).AssetPost.ModelUri);
                    }
                    worker.Stop();
                };

                worker.ScheduleWork(SPLWork);
                worker.Start();

                foreach(var outAsset in SPLWork.OutputAssets)
                {
                    AzureFile outFile = new AzureFile(Settings.AzureConnectionString, outAsset.ModelUri);
                    System.IO.FileInfo downloaded = outFile.DownloadToLocalTempFile();
                    Console.WriteLine(downloaded.FullName);
                }


                // Run until we have finished
                Console.WriteLine("Done! Press enter to quit.");
                Console.ReadLine();
            }
        }
    }
Steve D
  • 38
  • 1
  • 9

1 Answers1

0

You'll want to check your Settings.cs script and make sure you're using the correct values for SimplygonCloudAPIBaseURL. It should look something like this: https://mysimplygonapi.azurewebsites.net.

https://simplygonclouddoc.simplygon.com/

anothernode
  • 5,100
  • 13
  • 43
  • 62
BTruong
  • 11
  • 4