首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >azure simplygon cloud -“请求的资源不支持http方法‘POST’。”

azure simplygon cloud -“请求的资源不支持http方法‘POST’。”
EN

Stack Overflow用户
提问于 2018-02-08 00:27:10
回答 1查看 71关注 0票数 0

我对simplygon cloud示例有一个问题。BasicPipeline应用程序会引发一个"SPL processing failed for asset with modeluri“,更准确地说是一个”请求的资源不支持http method‘POST’“。worker.OnWorkFailed上的异常。我的azure连接设置是正确的。但可能还有一些其他的azure设置可能不太好。

代码:

代码语言:javascript
复制
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();
            }
        }
    }
EN

回答 1

Stack Overflow用户

发布于 2018-08-10 23:11:45

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

https://simplygonclouddoc.simplygon.com/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48668679

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档