How to use the ws.js.Addr function in ws

To help you get started, we’ve selected a few ws examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yaronn / ws.js / examples / sample.js View on Github external
"<header>" +
            "" +
              "" +
                "123" +
              "" +
            "" +
          ""

var ctx =  { request: request
           , url: "http://localhost:7171/Service/soap11wsa0408" //can also send to www.google.com if just testing the pipeline
           , action: "http://tempuri.org/IService/GetData"
           , contentType: "text/xml"
           }


var handlers =  [ new ws.Addr("http://schemas.xmlsoap.org/ws/2004/08/addressing")
                , new ws.Http()
                ]

ws.send(handlers, ctx, function(ctx) {
  console.log("response: " + ctx.response);
})
</header>
github yaronn / wcf.js / lib / wcf.js View on Github external
function AddAddressing(addr, handlers)
{
  if (!addr) return
  var v = messageVersionToAddressingVersion(addr)
  //we unshift and not pop. wsa channel must be first so it is before security.
  //otherwise security cannot sign the wsa.
  if (v) handlers.unshift(new ws.Addr(v))
}
github yaronn / ws.js / examples / signature.js View on Github external
{ "key": fs.readFileSync("client.pem").toString()})
var signature = new ws.Signature(x509)
signature.addReference("//*[local-name(.)='Body']")
signature.addReference("//*[local-name(.)='Timestamp']")

//validateResponseSignature determines if we should validate any incoming signature.
var sec = new ws.Security({"validateResponseSignature": true},
  [ x509,
  signature
  ])

//only required if you specified validateResponseSignature as true
sec.options.responseKeyInfoProvider = new FileKeyInfo("server_public.pem")

var handlers =
  [ new ws.Addr("http://www.w3.org/2005/08/addressing")
  , sec
  , new ws.Http()
  ]

request = "" +
          "<header>" +
            "" +
              "" +
                "123" +
              "" +
            "" +
          ""

var ctx =   { request: request
  , url: "http://localhost:7171/Service/sign_body_timestamp_wsa"
  , action: "http://tempuri.org/IService/GetData"
</header>

ws

Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js

MIT
Latest version published 6 months ago

Package Health Score

89 / 100
Full package analysis