'Unable to construct a SOAP request with NodeJS

The WSDL in question is under the following URL: https://bmdweb.bmd.at/bmdntcswsdev/bmdntcsws.dll/wsdl/IBMDSOAPNTCS

I was provided with a sample log-output of how the XML should be constructed.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.bmd.at/" xmlns:types="http://www.bmd.at/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

<q1:Login xmlns:q1="http://www.bmd.at/wws">

<ALoginRequest href="#id1" />

</q1:Login>

<q2:TBMDLoginRequest id="id1" xsi:type="q2:TBMDLoginRequest" xmlns:q2="http://www.bmd.at/soap">

<Auth href="#id2" />

</q2:TBMDLoginRequest>

<q3:TBMDPlainText id="id2" xsi:type="q3:TBMDPlainText" xmlns:q3="http://www.bmd.at/soap">

<Username xsi:type="xsd:string">xxxxUSER</Username>

<Password xsi:type="xsd:string">xxxxPASSWORD</Password>

<DBAlias xsi:type="xsd:string">xxxxDBALIAS</DBAlias>

</q3:TBMDPlainText>

</soap:Body>

</soap:Envelope>

Problem

I simply cannot figure out how to construct this XML using https://www.npmjs.com/package/soap. The part, where ALoginRequest is within the Login element, while everything else is outside of it, confuses me.

Efforts

When I try this: const login = await client.LoginAsync({ALoginRequest: {Auth: {TBMDPlainText: auth}}}), I get the following output.

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:tns="http://www.bmd.at/" xmlns:ns1="http://www.bmd.at/soap" xmlns:ns2="http://www.bmd.at/wws"><soap:Body><tns:Login><ALoginRequest><Auth><TBMDPlainText><Username>xxxx</Username><Password>xxxx</Password><DBAlias>xxxx</DBAlias></TBMDPlainText></Auth></ALoginRequest></tns:Login></soap:Body></soap:Envelope>

Can anyone provide me any hints?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source