Forum Discussion

cziz13's avatar
13 years ago

WCF webservice with basicHttpBinding and UserName authentica

Hi Guys,

I have an issue to make a request to WCF webservice with binding as:

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

We are receiving a response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">a:InvalidSecurity</faultcode>
<faultstring xml:lang="pl-PL">An error occurred when verifying security for the message.</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>

I'm testing it locally and service is on my locall IIS 7. When trying to connect with simple .net app all works fine.

Any suggestions?
No RepliesBe the first to reply