You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@yaronn I am trying to consume a WCF service using NodeJS. I tried BasicHttpBinding with security mode="TransportWithMessageCredential". It is working fine. But if I try to consume the service with WsHttpBinding and security mode="TransportWithMessageCredential",
*The following error is thrown:
*
"The message could not be processed. This is most likely because the action 'http://tempuri.org/IService1/GetData' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding."
@yaronn I am trying to consume a WCF service using NodeJS. I tried BasicHttpBinding with security mode="TransportWithMessageCredential". It is working fine. But if I try to consume the service with WsHttpBinding and security mode="TransportWithMessageCredential",
*The following error is thrown:
*
"The message could not be processed. This is most likely because the action 'http://tempuri.org/IService1/GetData' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding."
This is my NodeJS Code
var WSHttpBinding = require('wcf.js').WSHttpBinding
, Proxy = require('wcf.js').Proxy
, binding = new WSHttpBinding(
{
SecurityMode: "TransportWithMessageCredential"
, TransportClientCredentialType:"None"
, MessageClientCredentialType: "UserName"
})
, proxy = new Proxy(binding, "https://localhost:44301/Service1.svc")
, message =
'<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">'+ '<Body>'+ '<GetData xmlns="http://tempuri.org/">'+ '<value>12345</value>'+ '</GetData>'+ '</Body>'+ '</Envelope>'
proxy.ClientCredentials.Username.Username = "xyz"
proxy.ClientCredentials.Username.Password = "xyz"
proxy.send(message, "http://tempuri.org/IService1/GetData", function(response, ctx) {
console.log(response)
});
This is my web config
<bindings> <wsHttpBinding> <binding name="WsHttpBinding" maxReceivedMessageSize="104857600" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00" messageEncoding="Text" textEncoding="utf-8"> <security mode="TransportWithMessageCredential"> <transport clientCredentialType="None"/> <message clientCredentialType="UserName"/> </security> </binding> </wsHttpBinding> </bindings> <services> <service name="WcfService1.Service1" behaviorConfiguration="DefaultServiceBehaviors"> <endpoint address="" binding="wsHttpBinding" contract="WcfService1.IService1" name="WsHttpEndpoint" bindingConfiguration="WsHttpBinding"/> </service> </services>
The text was updated successfully, but these errors were encountered: