c# - WCF service show exception when securing service with wshttpbinding and username authentication -


i have created workflowservice in .net 4.0

i trying secure (wcf) service , used following link see how done.

i followed instructions, when define servicebehavior everthing works fine. configuration this:

<behaviors>       <servicebehaviors>         <behavior>          <servicecredentials name="servicebehavior">             <usernameauthentication usernamepasswordvalidationmode="membershipprovider"               membershipprovidername="aspnetsqlmembershipprovider" />           </servicecredentials>           <servicemetadata httpgetenabled="true" />           <servicedebug includeexceptiondetailinfaults="false" />         </behavior>       </servicebehaviors>     </behaviors> 

my bindings specified this:

<bindings>       <wshttpbinding>         <binding name="centraladminbinding">           <security mode="transportwithmessagecredential">             <transport clientcredentialtype="none"/>             <message clientcredentialtype="username"/>             </security>         </binding>       </wshttpbinding>     </bindings> 

when call url see xamlx service, following error shown:

could not find base address matches scheme https endpoint binding basichttpbinding. registered base address schemes [http]

how can handle error ? not use https @ still error.

i tried change basichttpbinding instead of wshttp, gives similar error.

when changing securitymode message following error : the service certificate not provided. specify service certificate in servicecredentials

is there way use configuration without certificate?

transportwithmessagecredential means want use transport security , send credential in message. transport security in case means https. first realease of wcf demanded user name , password can used secured communication. later on ms released patch allows workaround avoid https still not recommended. in .net 4.0 patch directly included.

if want use message credentials without secured communication have create custom binding similar this:

<bindings>   <custombinding>     <binding name="httpwithauthentication">       <security authenticationmode="usernameovertransport" allowinsecuretranpsort="true" />       <context /> <!-- needed durable worklfows -->       <textmessageencoding messageversion="soap12addressing10" />       <httptransport />     </binding>   </custombinding> </bindings> 

problem allowinsecurtransport is "quick fix" not integrate wcf features. example when use service not able generate wsdl / metadata because part still requires secure communication.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -