Hello, I'm having this error in a Firebase Function using soap that was working fine for the last past two years
Error: socket hang up
> at connResetException (node:internal/errors:692:14)
> at TLSSocket.socketOnEnd (node:_http_client:478:23)
> at TLSSocket.emit (node:events:539:35)
> at endReadableNT (node:internal/streams/readable:1345:12)
> at processTicksAndRejections (node:internal/process/task_queues:83:21) {
> code: 'ECONNRESET',
I made no code change no library update in the two weeks before having this issue.
I have posted on StackOverflow if you need more information :
https://stackoverflow.com/questions/73907048/firebase-functions-using-soap-finishing-with-econnreset-socket-hang-up
xs:date
and passing dates that include the time zone? If my remote server sends a valid xs:date
date such as 2022-10-30-07:00
for pacific time, the parser seems to return Invalid Date
even though this complies with the w3 XML schema for DataTypes. To work around the issue I have to save the WSDL locally and hack it so that it comes as a xs:string
then convert that to a Javascript Date
field. Seems unusual it can't deal with regular SOAP specifications that have been around forever.
Hi!
I am new to combining node.js and soap (but not new to them separately)
I have the following snippet:
console.log('About to fetch client');
const res = await fetch(wsdl);
console.log('It is available!');
console.log(await res.text());
const soapClient = createClientAsync(wsdl);
What could cause the last line to throw an error if all the previous lines succeed?
I got back
backend_1 | [ERROR] 16:57:04 TypeError: Cannot read properties of undefined (reading 'create')
TypeError: Cannot read properties of undefined (reading 'create')
at new HttpClient (/var/www/html/node_modules/soap/lib/http.js:40:59)
at Object.open_wsdl (/var/www/html/node_modules/soap/lib/wsdl/index.js:1270:48)
at openWsdl (/var/www/html/node_modules/soap/lib/soap.js:70:16)
at /var/www/html/node_modules/soap/lib/soap.js:48:13
at _requestWSDL (/var/www/html/node_modules/soap/lib/soap.js:76:9)
at createClient (/var/www/html/node_modules/soap/lib/soap.js:94:5)
at /var/www/html/node_modules/soap/lib/soap.js:104:9
at new Promise (<anonymous>)
at Object.createClientAsync (/var/www/html/node_modules/soap/lib/soap.js:103:12)
at /var/www/html/scenes/cabinetScene.js:21:35
How to solve this problem ?
const client = await soap.createClientAsync(urlWSDL, {
wsdl_headers: {Authorization: auth1С}
} );
await client.addHttpHeader('Authorization', auth1С)
const phoneAbonent = phoneClient
const abonent = {phone: phoneAbonent}
client.GetOsobr(abonent, async function (err, res) {
const result = JSON.parse(res.return)
const item = result.data
if (item.length) {
item.forEach(el => {
const numberClient1C = el.phone
ctx.session.osobrPhoneAbonent = numberClient1C
client.GetPhoneName(abonent, async function (err, res) {
const result = JSON.parse(res.return)
const item = await result.data
let name = ''
item.forEach(el => {
name = el.nameo
})
ctx.session.NameAbonet = name
await ctx.replyWithHTML(`\u{1F44B} <b>${name}</b>, `,
Markup
.keyboard([['\u{1F4DD} '\u{1F440} '], ['\u{1F4CB} '], ['\u{1F50D}'], ['\u{1F4CE} ']],)
.oneTime()
.resize())
})
ctx.scene.enter('usercabinet')
})
const soapClient = createClientAsync(wsdl);
request?: req.AxiosInstance;
I have a small question about the project and how it compiles the XML from a WSDL.
right way
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:msv3:v2">
<soap:Header/>
<soap:Body>
<urn:verbindungTesten>
<clientSoftwareKennung>TestClient</clientSoftwareKennung>
</urn:verbindungTesten>
</soap:Body>
</soap:Envelope>
wrong way
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header></soap:Header>
<soap:Body>
<verbindungTesten xmlns="urn:msv3:v2">
<clientSoftwareKennung>TestClient</clientSoftwareKennung>
</verbindungTesten>
</soap:Body>
</soap:Envelope>
Why does the client hook the namespace behind the attribute and SOAPUI does not?
I am using the soap module in Node.js as follows
import soap from "soap";
const ADRES = 'https://tckimlik.nvi.gov.tr/service/kpspublic.asmx?WSDL';
let degerler = {
TCKimlikNo: 11111111111,
Ad: 'YUSUF SEFA',
Soyad: 'SEZER',
DogumYili: 1111
};
soap.createClient(ADRES, (err, client) =\> {
client.TCKimlikNoDogrula(degerler, (err, result) =\> {
if (result.TCKimlikNoDogrulaResult) {
console.log('information is correct');
} else {
console.log('Information is incorrect');
}
});
});
However, I am getting the following error as output.
> soap@1.0.0 start
> node app.js
C:\\laragon\\www\\node-soap\\node_modules\\soap\\lib\\http.js:40
this.\_request = options.request || req\["default"\].create();
^
TypeError: Cannot read properties of undefined (reading 'create')
at new HttpClient (C:\\laragon\\www\\node-soap\\node_modules\\soap\\lib\\http.js:40:59)
at Object.open_wsdl (C:\\laragon\\www\\node-soap\\node_modules\\soap\\lib\\wsdl\\index.js:1270:48)
at openWsdl (C:\\laragon\\www\\node-soap\\node_modules\\soap\\lib\\soap.js:70:16)
at C:\\laragon\\www\\node-soap\\node_modules\\soap\\lib\\soap.js:48:13
at \_requestWSDL (C:\\laragon\\www\\node-soap\\node_modules\\soap\\lib\\soap.js:76:9)
at Object.createClient (C:\\laragon\\www\\node-soap\\node_modules\\soap\\lib\\soap.js:94:5)
at file:///C:/laragon/www/node-soap/app.js:12:6
at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:526:24)
PS C:\\laragon\\www\\node-soap\>
package.json content
{
"name": "soap",
"version": "1.0.0",
"description": "",
"main": "app.js",
"type": "module",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"start": "node app.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.2",
"nodemon": "^2.0.20",
"soap": "^0.45.0"
}
}
What is the reason for this error? Despite all the searches on the internet, I could not find the solution for this. Is there a problem with the version? Where is the error, I can't try this soap module of the believer because of this error.
0.45.0
will also work?
request
option to createClient.
Hello All, I am facing the similar issue what has been asked previously. https://gitter.im/vpulim/node-soap?at=5ba2f9de1ee2ca6502406b9e
However, fix suggested is not working as intended. I am passing object as
{ Foo: Bar: ["One", "Two"] }
Expected
<Foo>
<Bar>One</bar>
<Bar>Two</bar>
</Foo>
Actual
<Foo>
<Bar>
<0>One</0>
<1>Two</1>
</Bar>
</Foo>
2022-11-10 08:10:46.099 [error] - TypeError: Cannot read properties of undefined (reading 'create')
at new HttpClient (/mnt/c/Repos/proj/server/node_modules/soap/src/http.ts:42:52)
at Object.open_wsdl (/mnt/c/Repos/proj/server/node_modules/soap/src/wsdl/index.ts:1416:46)
at openWsdl (/mnt/c/Repos/proj/server/node_modules/soap/src/soap.ts:55:5)
at /mnt/c/Repos/proj/server/node_modules/soap/src/soap.ts:32:7
at _requestWSDL (/mnt/c/Repos/proj/server/node_modules/soap/src/soap.ts:61:5)
at createClient (/mnt/c/Repos/proj/server/node_modules/soap/src/soap.ts:83:3)
at /mnt/c/Repos/proj/server/node_modules/soap/src/soap.ts:93:5
at new Promise (<anonymous>)
at createClientAsync (/mnt/c/Repos/proj/server/node_modules/soap/src/soap.ts:92:10)
createClientAsync
anywhere? I've added axios to package.json
but still get errors when trying to run -> TypeError: Cannot read properties of undefined (reading 'createClientAsync')
# index.ts
import soap from 'soap';
(async () => {
const wsdlUrl = 'http://www.thomas-bayer.com/axis2/services/BLZService?wsdl';
const client = soap.createClientAsync(wsdlUrl);
})()
Hello Vpulim, In npm package https://github.com/vpulim/node-soap, there is a last commit (Upgrade to Formidable 3, Node 14, and audit fix). Wanted to know when will this be released, as I am getting critical vulnerability due to the usage of old formidable version in my application. Right now, when I am trying to update, its updating to its previous commit version(ceb2599f9f1f212d890880a5b1cb1459e812a065) only.
@vpulim can you please provide any information on this?