Calling an API that uses a WCF channel

Hello

I am using Node-RED 4.1.1, Node.js v24.00.0, and Windows 10 Enterprise 2016 LTSB version 1607.

I am working to connect a device that can only be accessed through a remoteAPI via a WCF channel. The way we are doing it is to produce an external piece of code that can make it function as a basic REST API, then we connect it to Node-RED:

Is there anything that can handle this using only Node-RED?

Welcome to the forums @Chrisoutdoor,
Not many Windows developers here :grin:

Do you have access to the WSDL endpoint?
I ask as there is a soap package for Node JS : https://www.npmjs.com/package/soap

Quick example from AI (so may not be correct)

const soap = require('soap');
const url = 'http://example.com/Service.svc?wsdl';

soap.createClient(url, function(err, client) {
  if (err) return console.error('SOAP client error:', err);

  client.MyOperation({ param1: 'value' }, function(err, result) {
    if (err) return console.error('Service call error:', err);
    console.log('Result:', result);
  });
});

it should work for the HTTP Bindings, but not sure about Socket Bindings

I used (developed) WCF API's a lot many years ago in work, but we have since moved our API's over to more traditional technologies.

You may be able to use this Node JS module in a function node, or build a complete custom Node RED Node around it.

EDIT


There is also this Node (unverified - but uses that Same Module I mentioned): node-red-contrib-webservices (node) - Node-RED

Search : Library - Node-RED

If nothing else, there is a Node.js package called wcf.js that enables working with WCF services by providing a WCF-compatible SOAP client. It supports various WCF bindings such as BasicHttpBinding , WSHttpBinding , and CustomBinding , and includes features like MTOM encoding, WS-Addressing, transport and message security, and username or certificate-based authentication. https://www.npmjs.com/package/wcf

You may be able to use that with a function node?

1 Like

I think it’s

https://www.npmjs.com/package/wcf.js :slightly_smiling_face:

/wcf is for webpack - for a minute I thought I was going mad :zany_face:

1 Like

hello @marcus-j-davies
Thanks for your response. A few things changed since i posted. I learnt that the API is custom, then my work was delayed for personal reasons, so the boss went back to a previous plan. Oh well.
Just for completeness, here is the basics from a chat-GPT attempt at making it work direct from Node-RED:

TL:DR, It is a custom API so can't do it.

1. Extracted info from RemoteAPITestClient.exe.config

From the config you pasted:

1.1 WCF bindings

Two custom bindings are defined:

<bindings>
  <customBinding>
    <binding name="longSendNamedPipeBinding" ...>
      <binaryMessageEncoding ... />
      <namedPipeTransport ... />
    </binding>

    <binding name="longSendTcpBinding" ...>
      <binaryMessageEncoding ... />
      <tcpTransport ... portSharingEnabled="true" />
    </binding>
  </customBinding>
</bindings>

So:

  • longSendNamedPipeBinding
    • Protocol: net.pipe (Named Pipes, local-only)
    • Encoding: binaryMessageEncoding (WCF-specific binary)
    • Timeouts: long send/receive, huge message sizes
  • longSendTcpBinding
    • Protocol: net.tcp (TCP, not HTTP)
    • Encoding: binaryMessageEncoding (WCF-specific binary)
    • Port sharing enabled
    • Again, this is WCF’s own binary framing, not raw JSON/XML.

1.2 The actual Nova Remote API endpoints :bullseye:

This is the gold:

<client>
  <!-- Endpoints for Nova remote API. -->
  <endpoint
    name="LocalNovaConnection"
    address="net.pipe://localhost/Infratec/remoteAPI"
    binding="customBinding"
    bindingConfiguration="longSendNamedPipeBinding"
    contract="FOSS.Nova.CoreServer.RemoteAPI.Client.Contract.INovaRemoteAPI"/>

  <endpoint
    name="RemoteNovaConnection"
    address="net.tcp://localhost:8899/Nova/remoteAPI"
    binding="customBinding"
    bindingConfiguration="longSendTcpBinding"
    contract="FOSS.Nova.CoreServer.RemoteAPI.Client.Contract.INovaRemoteAPI"/>
</client>

So we now know:

  • Service contract:
    FOSS.Nova.CoreServer.RemoteAPI.Client.Contract.INovaRemoteAPI
    (this is the WCF interface your .NET proxy uses)
  • Local endpoint (on same PC only):
    LocalNovaConnection →
    net.pipe://localhost/Infratec/remoteAPI
    Binding: customBinding/longSendNamedPipeBinding
  • Remote endpoint (TCP, potentially from another machine):
    RemoteNovaConnection →
    net.tcp://localhost:8899/Nova/remoteAPI
    Binding: customBinding/longSendTcpBinding

If another PC connects over the LAN, its address would look like:

net.tcp://<NovaPCNameOrIP>:8899/Nova/remoteAPI

1.3 No HTTP / SOAP endpoint

Important: there is no basicHttpBinding, wsHttpBinding, .svc URL, or http://... endpoint defined here.

Everything is:

  • net.pipe://... (Named Pipes, local only)
  • net.tcp://... with WCF customBinding (binary)

That matches the Remote API manual: they expect clients to use their .NET proxy and WCF, not generic HTTP/SOAP.


2. What this means for Node-RED (hard truth + good workaround)

You originally asked for:

“code that i can use in Node-RED using either HTTP, Websocket, TCP, or UDP, to connect to WCF”.

Given what we now know:

  • The Nova Remote API uses net.tcp + customBinding + binaryMessageEncoding.
  • Node-RED’s tcp node can only send/receive raw bytes; it does not understand WCF’s binary framing, channel handshakes, message headers, duplex callbacks, etc.
  • There is no HTTP/SOAP endpoint we can just point a SOAP node at.
  • WebSocket and UDP are not used for the actual Remote API calls (UDP is only used for discovery in the .NET library).

So:

:cross_mark: Direct Node-RED → Nova Remote API is not feasible

You cannot realistically point Node-RED straight at:

net.tcp://localhost:8899/Nova/remoteAPI

and expect it to work. You’d have to re-implement the WCF protocol in JavaScript, including duplex callbacks, addressing headers, etc. That’s insane-level work and very brittle.