Search code examples
wcfweb-servicesnode.jssoapsvc

Handling wcf services from nodejs


I am trying to access soap URL,I came across different file types i.e. .asmx and .svc. I used the node-soap module for handling .asmx services. For .svc I came across wcf.js below is the code

var BasicHttpBinding = require('wcf.js').BasicHttpBinding
, Proxy = require('wcf.js').Proxy
, binding = new BasicHttpBinding()
, proxy = new Proxy(binding, "https://webservice.kareo.com/services/soap/2.1/")
, message = '<Envelope xmlns=' +
        '"http://schemas.xmlsoap.org/soap/envelope/">' +
             '<Header />' +
               '<Body>' +
                 '<GetData xmlns="http://tempuri.org/">' +
                   '<value>GetAppointments</value>' +
                 '</GetData>' +
                '</Body>' +
           '</Envelope>'

proxy.send(message, "http://www.kareo.com/api/schemas/KareoServices/GetAppointments",       function(response, ctx) {
console.log(response)
});

I could not understand what has to be passed as message as an input for wcf web service.

Can Anyone provide me some idea regarding this? It will be really helpful.

Advance Thanks


Solution

  • The message should contain the raw soap wcf expects. You can get it by using WCF logging or Fiddler on an existing working c# client.