3

I need to test a wcf wsHttpBinding service using SOAPUI. The service config:

<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
  <baseAddressPrefixFilters>
    <add prefix="http://myserver/myservice/"/>
  </baseAddressPrefixFilters>
</serviceHostingEnvironment>

<behaviors>
  <endpointBehaviors>
    <behavior name="EPBehavior">
      <wsdlExtensions location="http://myserver/myservice/service.svc" singleFile="true" />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="Servicebehavior">
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceMetadata httpGetEnabled="true"/>
      <serviceCredentials>
        <clientCertificate>
          <authentication customCertificateValidatorType="myApp.ValidadorCertificado, myApp" certificateValidationMode="Custom" />
        </clientCertificate>
        <serviceCertificate findValue="Serial_of_service_certificate_here" x509FindType="FindBySerialNumber" />
      </serviceCredentials>
    </behavior>
  </serviceBehaviors>
</behaviors>

<services>
  <service behaviorConfiguration="Servicebehavior" name="myApp.myService">
    <endpoint address="/Java" behaviorConfiguration="EPBehavior"
      binding="wsHttpBinding" bindingConfiguration="ConfiguracionEnlaceJava"
      name="JavaEP" bindingNamespace="http://services.company.es/myservice"
      contract="myApp.myContract" />
  </service>
</services>

<bindings>
  <wsHttpBinding>
    <binding name="ConfiguracionEnlaceJava">
      <security>
        <message clientCredentialType="Certificate" negotiateServiceCredential="false" establishSecurityContext="false" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>

<extensions>
  <behaviorExtensions>
    <add name="wsdlExtensions" type="WCFExtras.Wsdl.WsdlExtensionsConfig, WCFExtras, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
  </behaviorExtensions>
</extensions>

As you can see, the service uses message security with certificate and also need a valid certificate from the client (a custom validation is used to verify it). I've read this article https://www.soapui.org/soapui-projects/ws-security.html but cannot get it to work for this scenario. I have a client in .Net working, this is the config:

<system.serviceModel>
<behaviors>
  <endpointBehaviors>
    <behavior name="ClientCredentialsBehavior">
      <clientCredentials>
        <clientCertificate findValue="Serial_of_client_certificate_here" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySerialNumber" />
        <serviceCertificate>
          <authentication revocationMode="NoCheck" />
          <defaultCertificate findValue="Serial_of_service_certificate_here" storeLocation="LocalMachine" storeName="TrustedPeople" x509FindType="FindBySerialNumber" />
        </serviceCertificate>
      </clientCredentials>
    </behavior>
  </endpointBehaviors>
</behaviors>

<bindings>
  <wsHttpBinding>
    <binding name="BindingJavaEP">
      <security>
        <message clientCredentialType="Certificate" negotiateServiceCredential="false" establishSecurityContext="false" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<client>
  <endpoint address="http://myserver/myservice/service.svc/Java" behaviorConfiguration="ClientCredentialsBehavior"
    binding="wsHttpBinding" bindingConfiguration="BindingJavaEP"
    contract="myApp.myContract" name="JavaEP">
    <identity>
      <certificate encodedValue="base64_public_key_service_certificate_here" />
    </identity>
  </endpoint>
</client>

Can anyone help please?

Thanks in advance.

Cabuxa.Mapache
  • 762
  • 1
  • 7
  • 19

0 Answers0