Skip to content

Instantly share code, notes, and snippets.

@yaronn
Created June 19, 2012 19:06
Show Gist options
  • Save yaronn/2955941 to your computer and use it in GitHub Desktop.
Save yaronn/2955941 to your computer and use it in GitHub Desktop.
wcf = require 'wcf.js'
fs = require 'fs'
binding = new wcf.WSHttpBinding
SecurityMode: "Message"
MessageClientCredentialType: "Certificate"
MessageEncoding: "Mtom"
proxy = new wcf.Proxy binding, "http://localhost:7171/Service/"
proxy.ClientCredentials.ClientCertificate.Certificate =
fs.readFileSync("client.pem").toString()
message = "<Envelope xmlns='http://schemas.xmlsoap.org/soap/envelope/'>
<Header />
<Body>
<GetData xmlns='http://tempuri.org/'>
<value>123</value>
</GetData>
</Body>
</Envelope>"
proxy.send message, "http://tempuri.org/IService/GetData",
(message, ctx) -> console.log ctx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment