私は、角度4でインターフェイスできるリモートサーバーへの一連のエンドポイントを作成するためにnpm soapパッケージを試しています。私はドキュメントを読みましたが、まだ分かりませんその使用法。以下はWSDLです。以下のエンドポイントとのインターフェイスに使用できるクライアントを作成するにはどうすればよいですか。ここにWSDLがあります。authヘッダー付きのnpm石鹸
http://208.180.122.191:8081/niku/wsdl/Query/ts_pending_approvals?tenantId=clarity
私の期待は、私は次のように応答を得るべきであるということです。
var soap = require('soap');
var url = 'http://208.180.122.191:8081/niku/wsdl/Query/ts_pending_approvals?tenantId=clarity';
var args = {Username: "jdoe", Password: "*******"};
soap.createClient(url, function(err, client) {
client.Login(args, function(err, result) {
console.log(result);
});
});
私は(client.describe())はconsole.logを呼び出すと、私は次を得る:
{ ts_pending_approvalsQueryService:
{ ts_pending_approvalsQueryService:
{ Query: [Object],
Login: [Object],
WrappedLogin: [Object],
Logout: [Object] } } }
しかし、私はloginを呼び出してユーザー名とパスワードを渡すと、私は定義されません。 SoapUIを使用して、以下を使用してリクエストを正常に完了できました。私の質問は、ノードでこれをどのようにシミュレートするかです。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:quer="http://www.niku.com/xog/Query">
<soapenv:Header/>
<soapenv:Body>
<quer:Login>
<quer:Username>jdoe</quer:Username>
<quer:Password>******</quer:Password>
</quer:Login>
</soapenv:Body>
</soapenv:Envelope>