More than a week I'm trying to create communication between javascript(running on node.js) clientside script and WCF(SOAP) service.
Communication is throught: XML, POST method
xmlhttp.setRequestHeader('Content-Type', 'text/xml; charset=utf-8');
URL and XML which I'm sending to service is defined as:
soapRequest('http://winserver:8735/ReportsListsService',
`<?xml version="1.0" encoding="UTF-8"?><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://tempuri.org/IReportsListsService/GetClients</Action>
</s:Header>
<s:Body>
<GetClients xmlns="http://tempuri.org/" />
</s:Body>
</s:Envelope>`);
This is my service, currently trying call simplest method GetClients
using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Web;
using tt4t.Dispatching.ApplicationServer.Data.CommonData;
namespace tt4t.Dispatching.ApplicationServer.Data.Reports.Lists
{
[ServiceContract]
public interface IReportsListsService : IMicroservice
{
[OperationContract]
IEnumerable<Client> GetClients();
}
}
But getting this error in chrome debug console
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring xml:lang="en-US">The incoming message contains a SOAP header representing the WS-Addressing 'Action', yet the HTTP transport is configured with AddressingVersion.None. As a result, the message is being dropped. If this is not desired, then update your HTTP binding to support a different AddressingVersion.</faultstring></s:Fault></s:Body></s:Envelope>
This error responds to this line of my xml request
<s:Header>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IReportsListsService/GetClients</Action>
</s:Header>
Full code: here
The problem was missing
xmlhttp.setRequestHeader('SOAPAction', "http://tempuri.org/IReportsListsService/GetClients");