Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF WebService with UserName Authentication test on SoapUI

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?

like image 522
cziz13 Avatar asked Nov 13 '12 11:11

cziz13


People also ask

Can we test WCF service in SoapUI?

Open soapUI and set the following settings. Make sure the service's wsdl path is correct. Double click on Request # node and navigate to the request window on the right. Fill the method parameters denoted by “?”.

How do I pass a user ID and password in SOAP header?

ClientCridentials. UserName. Password = "testPass"; In this way you can pass username, password in the header to a SOAP WCF Service.

How do I use authentication in SoapUI?

Go to File > Preferences. Switch to the HTTP Settings tab. To enable preemptive authentication, select the Authenticate preemptively check box.


1 Answers

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

like image 126
Johnny Avatar answered Oct 05 '22 16:10

Johnny