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


I am using Node.js and wcf.js module (npm install wcf.js) The service i am trying to consume is

I have figure out that this contains what the service is looking to receive and that these 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, "")
  , message = '<Envelope xmlns=' +
            '"">' +
                 '<Header />' +
                   '<Body>' +
                     '<GetData xmlns="">' +
                       '<value>GetAppointments</value>' +
                     '</GetData>' +
                    '</Body>' +

proxy.send(message, "", function(response, ctx) {
Problem courtesy of: Vartan Arabyan


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


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="">
        <Action s:mustUnderstand="1" xmlns=""></Action>
        <GetAppointments xmlns="">
          <request xmlns:i="">
            <RequestHeader i:nil="true" />
            <Fields i:nil="true" />
            <Filter i:nil="true" />
Discussion courtesy of: Dan Carlstedt

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