当我使用 nodejs sdk 翻译文件时失败
When I used nodejs sdk to translate file is failed
当我用nodejs sdk翻译文件失败时
我已经上传了 ifc 文件。我使用 nodejs SDK - ForgeSDK.DerivativesApi 将“ifc”翻译成“svf”。但是当我检查作业过程时,我得到了“TranslationWorker-InternalFailure”错误。
根据 sdk 参考(forge sdk for nodejs on github )。我的 post body 是:
{
"input":{
"urn":"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Ym9pbGVyL2JyaWRnZTIuaWZj"
},
"output":{
"formats":[{
"type":"svf",
"views":["2d","3d"]
}]
}
当我使用 postman 调用“https://developer.api.autodesk.com/modelderivative/v2/designdata/{urn}/manifest”时 api.It 回复我:
{
"Result": {
"statusCode": 200,
"headers": {
"access-control-allow-credentials": "true",
"access-control-allow-origin": "*",
"content-type": "application/json; charset=utf-8",
"date": "Tue, 06 Mar 2018 09:16:00 GMT",
"x-ads-app-identifier": "platform-viewing-2018.01.02.49.b4217d5-production",
"x-ads-duration": "212 ms",
"x-ads-startup-time": "Mon Feb 26 02:55:52 UTC 2018",
"content-length": "439",
"connection": "Close"
},
"body": {
"type": "manifest",
"hasThumbnail": "false",
"status": "failed",
"progress": "complete",
"region": "US",
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Ym9pbGVyL2JyaWRnZTIuaWZj",
"version": "1.0",
"derivatives": [
{
"name": "bridge2.ifc",
"hasThumbnail": "false",
"status": "failed",
"progress": "complete",
"messages": [
{
"type": "error",
"message": "Unrecoverable exit code from extractor: -1073741829",
"code": "TranslationWorker-InternalFailure"
}
],
"outputType": "svf"
}
]
}
}
但是当我使用 postman 调用“https://developer.api.autodesk.com/modelderivative/v2/designdata/job”时 api
翻译成功。
api 和 sdk 有什么不同?
这是我使用 NPM 翻译的内容
var translateFile = function(encodedURN){
logs(chalk.bold.green("**** Translating file derivative"));
var postJob =
{
input: {
urn: encodedURN
},
output: {
formats: [
{
type: "svf",
views: ["2d", "3d"]
}
]
}
};
return new Promise(function(resolve, reject) {
derivativesApi.translate(postJob, {}, oAuth2TwoLegged, oAuth2TwoLegged.getCredentials()).then(
function(res){
resolve(res);
},function(err){
reject(err);
}
)
});
};
如果你也想测试它,我有一个节点上传器示例,使用 NPM 调用来完成整个过程。
https://github.com/jaimerosales/modelderivative-nodejs-tutorial
当我用nodejs sdk翻译文件失败时
我已经上传了 ifc 文件。我使用 nodejs SDK - ForgeSDK.DerivativesApi 将“ifc”翻译成“svf”。但是当我检查作业过程时,我得到了“TranslationWorker-InternalFailure”错误。
根据 sdk 参考(forge sdk for nodejs on github )。我的 post body 是:
{
"input":{
"urn":"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Ym9pbGVyL2JyaWRnZTIuaWZj"
},
"output":{
"formats":[{
"type":"svf",
"views":["2d","3d"]
}]
}
当我使用 postman 调用“https://developer.api.autodesk.com/modelderivative/v2/designdata/{urn}/manifest”时 api.It 回复我:
{
"Result": {
"statusCode": 200,
"headers": {
"access-control-allow-credentials": "true",
"access-control-allow-origin": "*",
"content-type": "application/json; charset=utf-8",
"date": "Tue, 06 Mar 2018 09:16:00 GMT",
"x-ads-app-identifier": "platform-viewing-2018.01.02.49.b4217d5-production",
"x-ads-duration": "212 ms",
"x-ads-startup-time": "Mon Feb 26 02:55:52 UTC 2018",
"content-length": "439",
"connection": "Close"
},
"body": {
"type": "manifest",
"hasThumbnail": "false",
"status": "failed",
"progress": "complete",
"region": "US",
"urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Ym9pbGVyL2JyaWRnZTIuaWZj",
"version": "1.0",
"derivatives": [
{
"name": "bridge2.ifc",
"hasThumbnail": "false",
"status": "failed",
"progress": "complete",
"messages": [
{
"type": "error",
"message": "Unrecoverable exit code from extractor: -1073741829",
"code": "TranslationWorker-InternalFailure"
}
],
"outputType": "svf"
}
]
}
}
但是当我使用 postman 调用“https://developer.api.autodesk.com/modelderivative/v2/designdata/job”时 api 翻译成功。
api 和 sdk 有什么不同?
这是我使用 NPM 翻译的内容
var translateFile = function(encodedURN){
logs(chalk.bold.green("**** Translating file derivative"));
var postJob =
{
input: {
urn: encodedURN
},
output: {
formats: [
{
type: "svf",
views: ["2d", "3d"]
}
]
}
};
return new Promise(function(resolve, reject) {
derivativesApi.translate(postJob, {}, oAuth2TwoLegged, oAuth2TwoLegged.getCredentials()).then(
function(res){
resolve(res);
},function(err){
reject(err);
}
)
});
};
如果你也想测试它,我有一个节点上传器示例,使用 NPM 调用来完成整个过程。
https://github.com/jaimerosales/modelderivative-nodejs-tutorial