在SoapUi上使用UserName身份验证测试的WCF WebService

czi*_*z13 8 authentication wcf soapui username

我有使用UserName身份验证的WCF WebService,无法使用Soapui进行测试.

这里有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>
Run Code Online (Sandbox Code Playgroud)

在Soapui上我收到:验证邮件的安全性时发生错误

我正在我的本地机器上测试它,本地iis 7服务器.

有什么建议?

Joh*_*nny 20

在SoapUI的"请求属性"的"Wss-Password Type"部分中,只需选择" PasswordText " 选项.那会做的