2017-11-15 7 views
1

ノードjsのsoap requestを呼び出すためにnode-soapライブラリを使用しています。私のように引数を作成している。このためnode-soapを使用してsoapリクエストで重複した名前空間を作成

<soapenv:Envelope > 
    <soapenv:Header/> 
    <soapenv:Body> 
     <typ:uploadFileToUcm> 
     <typ:document> 
      <erp:Content></erp:Content> 
      <erp:FileName>?</erp:FileName> 
      <!--Optional:--> 
      <erp:ContentType>?</erp:ContentType> 
      <!--Optional:--> 
      <erp:DocumentTitle>?</erp:DocumentTitle> 
      <!--Optional:--> 
      <erp:DocumentAuthor>?</erp:DocumentAuthor> 
      <!--Optional:--> 
      <erp:DocumentSecurityGroup>?</erp:DocumentSecurityGroup> 
      <!--Optional:--> 
      <erp:DocumentAccount>?</erp:DocumentAccount> 
      <!--Optional:--> 
      <erp:DocumentName>?</erp:DocumentName> 
      <!--Optional:--> 
      <erp:DocumentId>?</erp:DocumentId> 
     </typ:document> 
     </typ:uploadFileToUcm> 
    </soapenv:Body> 
</soapenv:Envelope> 

var args = { 
    document : { 
    Content: byteArray, //create byte array to assign content 
    FileName: 'Abc12341', 
    ContentType: 'zip', 
    DocumentTitle: 'Abc12341', 
    DocumentAuthor: 'Abc12341', 
    DocumentSecurityGroup: 'abc', 
    DocumentAccount: 'c/c/c', 
    DocumentName: 'Abc12341' 
    //DocumentId : //no data available in java file 
    } 
} 

ととして渡す:

client.method(args, function (err, result) { 

}); 

が、client.lastrequestを印刷するには、リクエストのペイロードフォーマットは次の通りです

ペイロードに重複する名前空間があります:

<soap:Body> 
<types:uploadFileToUcm 
    xmlns:types="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/types/" 
    xmlns="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/types/"> 
    <types:document> 
     <ns0:Content xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/">UEsDBBQAAAAIAAuEaEue7VBfgQAAAGoBAAAcAAAASW52VHJhbnNhY3Rpb25zSW50ZXJmYWNlLmNzdvPMK0vNK8kvqlTwL0pXCA021AEBIBlgYGBsYGQK5ASXJnnmlcGkMICljmsikDIyMDTXNzTUNzBWMDCwAiMdHd/M4uTUnJzEvNT80mKFoNTk1MyCEuzG6OhYgAhfN3cdI3NLc2MDQ0MdY1MDIwMzM0McNiMBYx0jhLZBB1z9XHi5AFBLAQIUABQAAAAIAAuEaEue7VBfgQAAAGoBAAAcAAAAAAAAAAEAIAAAAAAAAABJbnZUcmFuc2FjdGlvbnNJbnRlcmZhY2UuY3N2UEsFBgAAAAABAAEASgAAALsAAAAAAA==</ns0:Content> 
     <ns0:FileName 
      xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/" 
      xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/">Abc12341</ns0:FileName> 
     <ns0:ContentType 
      xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/" 
      xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/">zip</ns0:ContentType> 
     <ns0:DocumentTitle 
      xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/" 
      xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/">Abc12341</ns0:DocumentTitle> 
     <ns0:DocumentAuthor 
      xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/" 
      xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/">Abc12341</ns0:DocumentAuthor> 
     <ns0:DocumentSecurityGroup 
      xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/" 
      xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/">FAFusionImportExport</ns0:DocumentSecurityGroup> 
     <ns0:DocumentAccount 
      xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/" 
      xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/">scm/inventoryTransaction/import</ns0:DocumentAccount> 
     <ns0:DocumentName 
      xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/" 
      xmlns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/">Abc12341</ns0:DocumentName> 
    </types:document> 
    </types:uploadFileToUcm> 
</soap:Body> 

ここで、ns0はすべてのパラメータで繰り返されています。

問題は私がargsを渡している方法である可能性があります。

この問題を解決するにはどうすればよいですか?

答えて

0

私はnode-soapと同じ問題を抱えていましたので、私は別のノードライブラリを使いました。ノードソープをベースにした強い石鹸を試してみましょうが、明らかに完全な書き換えであり、同じ寄稿者の多くはhttps://github.com/strongloop/strong-soapです。以下に示すように

npm install strong-soap 

オラクルのERP統合のSOAP APIの(importBulkData、uploadFileToUcmなど)を呼び出すコードは、許可の例外を除いて基本的に同じです。

var soap = require('strong-soap').soap; 

var data = {}; 
//code to build base64 zip file goes here 

var url = 'https://<host>/publicFinancialCommonErpIntegration/ErpIntegrationService?WSDL'; 
var args = { 
    "document": { 
     "Content": data, 
     "FileName": "glBudgetData.zip", 
     "ContentType": "zip", 
     "DocumentTitle": "glBudgetData.zip", 
     "DocumentAuthor": "casey.brown", 
     "DocumentSecurityGroup": "FAFusionImportExport", 
     "DocumentAccount": "fin$/budgetBalance$/import$", 
     "DocumentName": "UCM91004" 
    } 
}; 

var options = {}; 

soap.createClient(url, options, function(err, client) { 
    client.setSecurity(new soap.BasicAuthSecurity('casey.brown', '<your password here>')); 
    client.uploadFileToUcm(args, function(err, result) { 
     console.log(result); 
}); 

コマンドラインで実行し、出力され{結果:「2047316」}インポートされたファイル(複数可)のUCMドキュメントIDです。

幸運を祈る!

+0

これは質問に対する答えを提供しません。十分な[評判](https://stackoverflow.com/help/whats-reputation)があれば、[投稿にコメントする]ことができます(https://stackoverflow.com/help/privileges/comment)。代わりに、[質問者からの明確化を必要としない回答を提供する](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-c​​an- i-do-代わりに)。 - [レビューから](/レビュー/低品質の投稿/ 18505097) – ndmeiri

+0

これは本当に質問に答えるものではありません。別の質問がある場合は、[質問する](https://stackoverflow.com/questions/ask)をクリックして質問することができます。十分な[評判](https://stackoverflow.com/help/)があれば、この問題にもっと注意を払うために[奨励金を追加](https://stackoverflow.com/help/privileges/set-bounties)することもできます何が評判か)。 - [レビューから](レビュー/低品質の投稿/ 18505097) – Michal

+0

申し訳ありませんが、私は上記の編集が十分に質問に答えることを願っています。 –

関連する問題