admin管理员组文章数量:1022804
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';
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';
本文标签: javascriptSoap request in TypeScriptStack Overflow
版权声明:本文标题:javascript - Soap request in TypeScript - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745568201a2156577.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论