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?

3 Answers 3

22

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

0
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.

1
  • 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 5, 2014 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.