8

I have WCF WebService with UserName Authentication and not able to test it with SoapUI.

Here you have web.config:

<behaviors>
      <serviceBehaviors>
        <behavior name="FHPBusinessLogicService.ServiceBehavior">
          <serviceCredentials type="FHPBusinessLogicService.Security.PasswordServiceCredentials, FHPBusinessLogicService">
            <userNameAuthentication userNamePasswordValidationMode="Custom" />
          </serviceCredentials>
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <serviceAuthorization principalPermissionMode="Custom" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <basicHttpBinding>
        <binding name="ServiceConf" maxReceivedMessageSize="65536" >
          <readerQuotas maxStringContentLength="65536" maxArrayLength="65536" maxBytesPerRead="65536" />
          <security mode="TransportWithMessageCredential"  >
            <message clientCredentialType="UserName"  />
            
          </security>
         
        </binding>
      </basicHttpBinding>
    </bindings>

On SoapUI i'm receiving:

An error occurred when verifying security for the message

I'm testing it on my local machine, local IIS 7 server.

Any suggestions?

Amit Joshi
  • 15,448
  • 21
  • 77
  • 141
cziz13
  • 81
  • 1
  • 1
  • 3

3 Answers3

22

In the 'Request Properties' in SoapUI in section 'Wss-Password Type' just select option 'PasswordText'. That will do the thing

Johnny
  • 425
  • 3
  • 15
0

I think you need to add WS-Security Configuration to your request. Read this http://www.soapui.org/SOAP-and-WSDL/applying-ws-security.html

And see the section under "Username". And then in your testsuite in soapUI, be sure to add the ws-security conf you just created. That worked for me.

Martin
  • 1,521
  • 3
  • 18
  • 35
  • 1
    I don't know what a "keystore file" is. Why does the article assume that I do, and that I have one ready to use? **edit** I can now see that there's a link at the top of the page that covers this. – Tom W Feb 05 '14 at 10:33
0

The other "dumb" thing that could be causing this error is that you left the Username field blank in your Auth... even if your Service doesn't care about the Username, you still need to provide some value there.

Serj Sagan
  • 28,927
  • 17
  • 154
  • 183