SOAP Web サービスを使用しようとしていますが、WSDL が壊れているため、.xml をカスタマイズする必要がありnode-soap
ます。
私が望む理想的な SOAP エンベロープは次のようなものです。
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<getImagesDefinition xmlns="http://services.example.com/"/>
</Body>
</Envelope>
これまでのところnodejs
、サービスを呼び出す必要があるコードは次のとおりです。
var soap = require('soap');
var url = 'http://www.example.com/services/imagesizes?wsdl';
soap.createClient(url, function(err, client) {
client.setEndpoint('http://www.example.com/services/imagesizes');
client.getImagesDefinition(null, function(err, result) {
console.log(result);
});
console.log(client.lastRequest)
});
WSDL
ファイルで壊れているため、エンドポイントを手動で設定する必要がありました
印刷の際の封筒client.lastRequest
はこんな感じです。
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="http://services.example.com/">
<soap:Body>
<getImagesDefinition />
</soap:Body>
</soap:Envelope>
<tns:getImagesDefinition />
リクエストの代わりに本文の名前空間プレフィックスを強制できれば、<getImagesDefinition />
完全に機能することを私は知っています。
強制する方法はありますか?
tns
それがデフォルトの無視された名前空間であるというドキュメントを読んだので、これを実行して変更しようとしました:
var options = {
ignoredNamespaces: {
namespaces: [],
override: true
}
}
そのオブジェクトをメソッドに送信しますがsoap.createClient
、エンベロープに違いはありません。
これを強制する方法はありますか?それとも理想的な SOAP エンベロープにたどり着くのでしょうか?
ありがとう!