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.
Thanks alot. It solves my problem.
Thanks a lot! A very helpful post…
Hi there,
I was really happy someone obviously faces the same problem. Is was gong crazy thinking wheter nobody uses SoapUI with WCF?
Still I’m stuck now. Instead of the exception you described I do get the following error instead:
The message with To ‘{0}’ cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver’s EndpointAddresses agree.
Do you have an idea what could be wrong?
This is the relevant part of my web.config:
<!---->
<!--
--><!--
-->
<!--
-->
Hi there,
I was really happy someone obviously faces the same problem. Is was gong crazy thinking wheter nobody uses SoapUI with WCF?
Still I’m stuck now. Instead of the exception you described I do get the following error instead:
The message with To ‘{0}’ cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver’s EndpointAddresses agree.
Do you have an idea what could be wrong?
This is the relevant part of my web.config:
(sorry, don’t know how to post this in this blog)
Solved my problem. Thank you..
A very helpful post… Thank you Very much
Thanks man!
Hi, Thanks a lot for the wonderful piece of information…i have been doing a lot of research on my code thinking that there is something wrong with my code. Iam happy that i got the solution at last from your post, inspite of wasting a lot of time. Thank you once again. Keep the good work going
Thank you this helped me with my project.
Its not working with WCF service using DataContract serialization.
Does it work only with XML Serialization.
Thanks a lot. It worked for me
Thanks to the sky!
Thank you very much!
“The reason for this is that the default WCF binding (wsHttpBinding) implements a security context token which is not supported in soapUI.”
Could you please provide source that soapUI does not support message level security?
@Rothi
For sure you found the solution, but for future use look here:
http://javiercrespoalvez.com/2010/09/using-soapui-to-consume-ws-addressing.html
Hi,
I am using soapUI tool to test my wcf services.It is not working with WSHttpbinding.
Please tell me how to test WSHttpbinding with soapUI tool.In some sites i find below solutions but not working
SOLUTION1
Please follow the steps as mentioned below:
1.)Expose the service for the required Application with Wshttp bindings.
2.)In web.config file add the binding information as given below:
3.)Reset IIS
4.)In SOAP UI Check Whether WS-A is enabled.
Trigger a request in SOAP UI…U will get the corresponding response…
IT IS NOT WORKING
SOLUTION2
[ServiceContract(SessionMode=SessionMode.Required)]
In the above change to [ServiceContract(SessionMode=SessionMode.Allowed)] this is working. But i need to use Required Only
How can i get rid of this problem ?