Forum Discussion

Younes's avatar
Younes
New Contributor
12 years ago

SOAPUI doesn't work with WCF service

Hello,

I have a problem, i try to consume my web services developed in WCF.

They works well with a C# client.

These Web Services required an authentification with an x509 certificate, i try a lot of kinds of configurations (in WS-Security-Configurations tab) with the right keystore, with the right certificate (that i used with my C# client).

I just sign the message, not encrypt, so i had only the signature in outgoing configuration.

When i request the Web Service via SOAPUI, i have an error like "An error occurred when verifying security for the message" or "Bad context token".

It's possible to consume WCF Web service with SOAPUI ?


I have the same problem with Web Services with a windows authentification (kerberos) (which works with my c# client), any security header is generated in my soap request even if i fill the right credential and select the authentification type.

My web.config file of web services


<?xml version="1.0"?>

<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<machineKey decryptionKey="AutoGenerate" validationKey="AutoGenerate" />
</system.web>

<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="wsHttpEndpointBinding">
<security>
<message clientCredentialType="Certificate" negotiateServiceCredential="false" establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>

<behaviors>
<serviceBehaviors>
<!-- Behavior of the Certificate authentication web service -->
<behavior name="WebService.ServiceBehaviorCertificateAuth">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceCredentials>
<clientCertificate>
<authentication certificateValidationMode="PeerTrust" />
</clientCertificate>
<serviceCertificate findValue="ServerCertificate" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName"/>
</serviceCredentials>
</behavior>

<!-- Behavior of the Windows authentication web service -->
<behavior name="WebService.ServiceBehaviorWindowsAuth">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>

<!-- Proxy Web Service for external access by Certificate authentication-->
<service name="WebService.ServiceCertificateAuth" behaviorConfiguration="WebService.ServiceBehaviorCertificateAuth">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpEndpointBinding" contract="WebService.IService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>

<!-- Proxy Web Service for external access by Windows authentication-->
<!-- By default wsHttpBinding is configured with Message security and Windows authentication -> do not need a 'bindingConfiguration' -->
<service name="WebService.ServiceWindowsAuth" behaviorConfiguration="WebService.ServiceBehaviorWindowsAuth">
<endpoint address="" binding="wsHttpBinding" contract="WebService.IService">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
</configuration>

3 Replies

  • Hi,

    It's possible to consume WCF Web service with SOAPUI ?


    Yes, it is possible.

    They works well with a C# client.


    Can you compare the request you are generating in your C# client with the one created in SoapUI?

    I have the same problem with Web Services with a windows authentification (kerberos) (which works with my c# client), any security header is generated in my soap request even if i fill the right credential and select the authentification type.


    We do support Kerberos authentication, please see this link:
    http://www.soapui.org/SOAP-and-WSDL/spn ... ation.html
  • Younes's avatar
    Younes
    New Contributor
    Hi, thank you for your response,

    I've tried to follow this tutorial without success