How to add custom soap headers in wcf?

Check out the WCF Extras on Codeplex – it’s an easy extension library for WCF which offers – among other things – custom SOAP headers. Another option is to use WCF message contracts in your WCF service – this also easily allows you to define and set WCF SOAP headers. [MessageContract] public class BankingTransaction { … Read more

Is WCF ClientBase thread safe?

Yes, it is thread-safe. However, you should know that WCF will automatically serialize the execution of CalculateSomething when it is called from more than one thread using the same ClientBase instance. So if you were expecting CalculateSomething to run concurrently then you will have to rethink your design. Take a look at this answer for … Read more

What is WCF in simple terms?

WCF – Windows Communication Framework – is Microsoft’s framework to make inter-process communication easier. It let’s you do this communication through various means, plain old asmx web services, Remoting, MS Message Queuing, and a couple more. It let’s you talk with other .NET apps, or non-Microsoft technologies (like J2EE). It’s extensible enough to allow for … Read more

Why does my WCF service give the message ‘does not have a Binding with the None MessageVersion’?

This is simply happening because you have configured a single endpointBehavior for both the SOAP and REST endpoints but the SOAP endpoint can’t have the webHttp behavior. You need to split these apart so that they are: <endpointBehaviors> <behavior name=”SOAPDemoEndpointBehavior”> <ipFilter/> </behavior> <behavior name=”RESTDemoEndpointBehavior”> <ipFilter/> <webHttp /> </behavior> </endpointBehaviors> and then your endpoints should be: … Read more

How does a WCF server inform a WCF client about changes? (Better solution then simple polling, e.g. Comet or long polling)

It sounds to me like you already know the answer: use long polling. 🙂 So I guess the only thing left to explain is how you might be able to accomplish this with WCF and in the most efficient manner possible. The basics: First, decide how long you want each “long poll” to be. For … Read more

Make ASP.NET WCF convert dictionary to JSON, omitting “Key” & “Value” tags

The .NET dictionary class won’t serialize any other way than the way you described. But if you create your own class and wrap the dictionary class then you can override the serializing/deserializing methods and be able to do what you want. See example below and pay attention to the “GetObjectData” method. [Serializable] public class AjaxDictionary<TKey, … Read more

WCF Exception: Could not find a base address that matches scheme http for the endpoint

Your configuration should look similar to that. You may have to change <transport clientCredentialType=”None” proxyCredentialType=”None” /> depending on your needs for authentication. The config below doesn’t require any authentication. <bindings> <basicHttpBinding> <binding name=”basicHttpBindingConfiguration”> <security mode=”Transport”> <transport clientCredentialType=”None” proxyCredentialType=”None” /> </security> </binding> </basicHttpBinding> </bindings> <services> <service name=”XXX”> <endpoint name=”AAA” address=”” binding=”basicHttpBinding” bindingConfiguration=”basicHttpBindingConfiguration” contract=”YourContract” /> </service> <services> … Read more

Invalid WS Security Header – IRS ACA SOAP Request

It sounds like we’re on the same path; maybe we can help each other out. I ended up doing security by configuration: <security enableUnsecuredResponse=”true” authenticationMode=”MutualCertificate” messageSecurityVersion=”WSSecurity10WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10″ /> You’ll also need to override the identity DNS value for your endpoint with whoever your certificate was issued to. Put this inside your <endpoint> tags <identity> <dns value=”[Issued … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)