Enterprise library with workflow service

Enterprise library里面的Validation Application Block提供了对WCF集成支持,但是基于WCF的Workflow Service不支持

Integrating the Validation Application Block

http://msdn.microsoft.com/en-us/library/ff650801

通过配置的方式,validate WCF:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0.3" />
  </system.web>
  <system.serviceModel> 
      <extensions>
        <behaviorExtensions>
          <add name="validation"
                     type="Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF.ValidationElement,
             Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF" />
        </behaviorExtensions>
      </extensions>
    <behaviors>
      <endpointBehaviors>
        <behavior name="ValidationBehavior">          
          <validation enabled="true"/>
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service name="Service1">
        <endpoint binding="basicHttpBinding"
          contract="IService"
          behaviorConfiguration="ValidationBehavior" />
      </service>
    </services>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>

没有仔细去了解默认的Validation ruleset的实现些什么功能,如何自定义ruleset!

 

posted @ 2012-05-25 10:48  Leo Tang  阅读(157)  评论(0)    收藏  举报