I'm trying to use TypeScript to run a SOAP request, but I'm getting an error when I pile the code with "tsc myfile.ts". The code:
import Soap from 'soap';
function soapClientServer(){
const url = 'myurl'
Soap.createClient(url, function(err, client){
if(err){
console.log(err)
}else{
console.log('connection with SOAP OK')
client.consultaNFSe({
token: 'mytoken',
cnpj: 'mydata',
nrNota: '',
nrPedido: 'mydata'
}, (err, res) =>{
return console.log(res)
})
}
})
}
export default soapClientServer()
The error:
index.ts:1:8 - error TS1192: Module '"/Users/vinicius.siqueira/Projects/MyPC/soap-typescript/node_modules/soap/lib/soap"' has no default export.
1 import Soap from 'soap';
~~~~
Found 1 error.
Any ideas? Thanks!
I'm trying to use TypeScript to run a SOAP request, but I'm getting an error when I pile the code with "tsc myfile.ts". The code:
import Soap from 'soap';
function soapClientServer(){
const url = 'myurl'
Soap.createClient(url, function(err, client){
if(err){
console.log(err)
}else{
console.log('connection with SOAP OK')
client.consultaNFSe({
token: 'mytoken',
cnpj: 'mydata',
nrNota: '',
nrPedido: 'mydata'
}, (err, res) =>{
return console.log(res)
})
}
})
}
export default soapClientServer()
The error:
index.ts:1:8 - error TS1192: Module '"/Users/vinicius.siqueira/Projects/MyPC/soap-typescript/node_modules/soap/lib/soap"' has no default export.
1 import Soap from 'soap';
~~~~
Found 1 error.
Any ideas? Thanks!
Share Improve this question asked Jul 15, 2020 at 13:26 Vinicius MocciVinicius Mocci 991 gold badge3 silver badges12 bronze badges 1- I'm trying to use this: github./vpulim/node-soap But I'm new to TS, tryin to figure out how to create the same with TypeScript. I've tried with simple node code and worked. – Vinicius Mocci Commented Jul 15, 2020 at 13:43
1 Answer
Reset to default 5import {createClient} from 'soap';
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745568203a4633522.html
评论列表(0条)