출처: https://lockdown.tistory.com/154 [나의 삶은 하은이를 중심으로~]

  • Web.Config
    <system.serviceModel>

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/><!-- asp.net 상호작용을 위한 설정 -->

    <behaviors>

    <serviceBehaviors>

     <behavior name="StatisticsServiceBehavior">            
    
       <serviceMetadata httpGetEnabled="true" />
    
       <serviceDebug includeExceptionDetailInFaults="true" />          
    
     </behavior>        

    </serviceBehaviors>

    <endpointBehaviors><!-- 스크립트를 통한 동작 허용 설정 -->

     <behavior name="StatisticsServiceAjaxBehavior"><
    
       <enableWebScript/>
    
     </behavior>

    </endpointBehaviors>

    </behaviors>

    <services>

    <service name="Infotops.LMS.WebSite.AdminSite.Services.StatisticsService"

            behaviorConfiguration="StatisticsServiceBehavior">
    
     <endpoint behaviorConfiguration="StatisticsServiceAjaxBehavior" 
    
               address="" 
    
               binding="webHttpBinding" 
    
               contract="Infotops.LMS.WebSite.AdminSite.Services.IStatisticsService">
    
     </endpoint><!-- 종점 바인딩 설정 -->

    </service>

    </services>

    </system.serviceModel>

public interface IStatisticsService {
[OperationContract]

    [WebInvoke(BodyStyle=WebMessageBodyStyle.WrappedRequest,Method="POST")]

    string GetStudyResultReportList(string companyId, string studyStartDate);

}

[AspNetCompatibilityRequirements(RequirementsMode=AspNetCompatibilityRequirementsMode.Allowed)]

public class StatisticsService : IStatisticsService {

    public string GetStudyResultReportList(string companyId, string studyStartDate)

    {
           return string.Empty;
    }

}

출처: https://lockdown.tistory.com/154 [나의 삶은 하은이를 중심으로~]