2013-03-14 233 views

回答

0

的技巧是使用的app.config和配置所有的安全設置,有...:

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <system.serviceModel> 
    <bindings> 
     <webHttpBinding> 
     <binding name="MyBindingName" > 
      <security mode="Transport"> 
      <transport clientCredentialType="Windows" /> 
      </security> 
     </binding> 
     </webHttpBinding> 
    </bindings> 
    <services> 
     <service name="{you service type name including the namespace i.e. myapplication.myservice}"> 
     <endpoint address="" binding="webHttpBinding" bindingConfiguration="MyBindingName" contract="System.Data.Services.IRequestHandler"> 
     </endpoint> 
     </service> 
    </services> 
    </system.serviceModel> 
</configuration> 

詳細答案見this question