Consuming a Default WCF Service in SoapUI
When you create a WCF service (using the template in Visual Studio 2008) and try to test it in soapUI you get the following error:
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.
The reason for this is that the default WCF binding (wsHttpBinding) implements a security context token which is not supported in soapUI.
To disable the security context token requirement in the binding add the following to your web-config:
<system.serviceModel> <bindings> <wsHttpBinding> <binding name="wsHttpBindingNoSCT"> <security mode="None"> <transport clientCredentialType="None" /> <message establishSecurityContext="false" /> </security> </binding> </wsHttpBinding> </bindings> </system.serviceModel>
Then change the service endpoint configuration to use the new binding (set the bindingConfiguration to the name specified above):
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpBindingNoSCT" contract="WcfService1.IService1">
You should now be able to test this service using soapUI.
Note that you will have to check the “Add default was:To” in the WS-Addressing settings for the request in soapUI as the wsHttpBinding requires WS-Addressing action headers.