Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- request.log.setActionStart(request.requestID, "FINPT-WEBSERVICE", "webservice");
- var options = {
- hostname: "servicos.portaldasfinancas.gov.pt",
- port: 701,
- path: "/sgdtws/documentosTransporte",
- method: "POST",
- pfx: fs.readFileSync('keys/TesteWebService.pfx'),
- cert: fs.readFileSync('keys/ChavePublicaAT.cer'),
- passphrase: "TESTEwebservice",
- agent: false,
- rejectUnauthorized: false,
- secureProtocol: 'SSLv3_method',
- headers: {
- "Content-Type": "text/xml;charset=UTF-8",
- "SOAPAction": "https://servicos.portaldasfinancas.gov.pt:701/sgdtws/documentosTransporte/",
- }
- };
- //options.agent = new https.Agent(options);
- var reqFinWebs = https.request(options, function(resFinWebs) {
- console.log(resFinWebs.statusCode);
- if(resFinWebs.statusCode==200){
- //....
- });
- reqFinWebs.end(soapXML);
- console.log(soapXML);
- 500
- 500 '<?xml version='1.0' ?>n<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>n<env:Body>n<env:Fault>n<faultcode>env:Client</faultcode>n<faultstring>InternalError</faultstring>n</env:Fault>n</env:Body>n</env:Envelope>n'
- <?xml version='1.0' ?>
- <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
- <env:Body>
- <env:Fault>
- <faultcode>env:Client</faultcode>
- <faultstring>Internal Error</faultstring>
- </env:Fault>
- </env:Body>
- </env:Envelope>
- headers: {
- "Accept": "text/xml",
- "Content-length": soapXML.length,
- "Content-Type": "text/xml;charset=UTF-8",
- "SOAPAction": "https://servicos.portaldasfinancas.gov.pt/sgdtws/documentosTransporte/",
- }
- var ctx = { request: request
- , url: "https://servicios.pami.org.ar/trazamed.WebServiceSDRN"
- , action: "http://localhost:59051/trazamed.WebServiceSDRN"
- , contentType: "text/xml"
- ,location: "http://localhost:59051/trazamed.WebServiceSDRN"
- }
- var handlers = [ new Security({}, [new UsernameToken({username:"testwservice", password:"testwservicepsw"})])
- , new Http()
- ]
- ws.send(handlers, ctx, function(ctx) {
- console.log("response:" + ctx.response);
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement