How do I figure out what a WCF service is expecting?

Problem

I am using Node.js and wcf.js module (npm install wcf.js) The service i am trying to consume is https://webservice.kareo.com/services/soap/2.1/

I have figure out that this https://webservice.kareo.com/services/soap/2.1/KareoServices.svc?xsd=xsd0 contains what the service is looking to receive and that these https://webservice.kareo.com/services/soap/2.1/KareoServices.svc?wsdl=wsdl0 are the uri's to submit them to.

How in the world do i figure out how I am supposed to structure the request? This is the example given to my by wcf.js

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)
});
Problem courtesy of: Vartan Arabyan

Solution

According to the wsdl this service uses BasicHttpBinding, which means no ws-secrutiy or addressing are used. In this case wcf.js does not bring you much added value on top of just using request but nevertheless you can still use wcf.js. You need to set correctly 3 values - url, soapaction (the second param in the proxy ctor) and the soap. I recommend getting all 3 values by generating a c# client to this service, verifying the client works, and then setting up fiddler and pointing the client to "http://localhost:8888" so you will see in fiddler all 3 values and can configure them.

Solution courtesy of: Yaron Naveh

Discussion

I don't have any experience with wcf.js but, if you just need to see how you should structure you soap envelope to make a request I would suggest you fire up wcftestclient and connect to the service. Once connected you can call any of the operations and view the soap message. Here is an empty request to the GetAppointments operation.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
      <s:Header>
        <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://www.kareo.com/api/schemas/KareoServices/GetAppointments</Action>
      </s:Header>
      <s:Body>
        <GetAppointments xmlns="http://www.kareo.com/api/schemas/">
          <request xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
            <RequestHeader i:nil="true" />
            <Fields i:nil="true" />
            <Filter i:nil="true" />
          </request>
        </GetAppointments>
      </s:Body>
    </s:Envelope>
Discussion courtesy of: Dan Carlstedt

This recipe can be found in it's original form on Stack Over Flow.