我有带有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>
在SoapUI上,我收到:我正在本地计算机IIS 7服务器上对其进行测试。
有什么建议么?
最佳答案
在SoapUI的“请求密码类型”部分的“请求属性”中,只需选择选项“ PasswordText ”。那会做的事
关于在SoapUI上进行带有用户名身份验证的WCF Web服务,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13359629/