azure simplygon cloud - "请求的资源不支持http方法' POST'。"

时间:2018-02-07 16:27:10

标签: azure simplygon

我对simplegon云示例有疑问。 BasicPipeline应用程序使用modeluri"来提升资产的SPL处理失败率。更准确地说是一个"请求的资源不支持http方法' POST'。" worker.OnWorkFailed上的异常。我的天蓝色连接设置接缝是正确的。但也许还有其他一些天蓝色的设置可能还不行。

代码:

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();
            }
        }
    }

1 个答案:

答案 0 :(得分:0)

您将要检查Settings.cs脚本,并确保您使用的SimplygonCloudAPIBaseURL值正确。它看起来应该像这样:https://mysimplygonapi.azurewebsites.net

https://simplygonclouddoc.simplygon.com/