Created
June 21, 2012 22:26
-
-
Save yaronn/2968996 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wcf = require 'wcf.js' | |
fs = require 'fs' | |
sec = new wcf.SecurityBindingElement | |
AuthenticationMode: "MutualCertificate" | |
ValidateResponseSignature: true | |
binding = new wcf.CustomBinding [ | |
sec | |
new wcf.TextMessageEncodingBindingElement MessageVersion: "Soap11WSAddressing10" | |
new wcf.HttpTransportBindingElement() | |
] | |
proxy = new wcf.Proxy binding, "http://localhost:7171/Service/sign_body_timestamp_wsa" | |
proxy.ClientCredentials.ClientCertificate.Certificate = | |
fs.readFileSync("client.pem").toString() | |
proxy.ClientCredentials.ServiceCertificate.DefaultCertificate = | |
fs.readFileSync("server_public.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