최근에 달린 레몬펜 쪽지

Jay Style

블로그 이미지
fahnel

Article Category

분류 전체보기 (11)
Innovation (1)
Project (1)
Database (2)
.NET (1)
ASP (0)
JavaScript (0)
etc (6)

Recent Comment

Recent Trackback

Calendar

«   2010/03   »
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Archive

My Link

  • Total3,456
  • Today1
  • Yesterday2
  1. 2010/02/05
    .NET : WCF

<WCF Step by Step>
  • DAAB 로 DB 연결

    • Microsoft patterns & practices : Enterprise Library : Enterprise Library Configuration 로 커넥션 스트링 생성 (web.config)
    • 참조

      Microsoft.Practices.EnterpriseLibrary.Data

      Microsoft.Practices.EnterpriseLibrary.Common

      Microsoft.Practices.ObjectBuilder2

  • web.config 설정 시 <configuration></configuration> 자식 노드로 <system.serviceModel> 노드 추가

    • serviceModel 예제 -> 각 노드 및 세부 애트리뷰트 정리 필요.

      <system.serviceModel>
          <services>

             <service name="Products.ProductsServiceImpl" behaviorConfiguration="ProductsBehavior">
                <endpoint address="" binding="basicHttpBinding" contract="Products.IProductsService" />
             </service>
         </services>
         <behaviors>
              <serviceBehaviors>
               <behavior name="ProductsBehavior">
                  <serviceDebug includeExceptionDetailInFaults="true" />  <!-- 개발 시 서비스 Debug 시 필요함.(삽질했음. 주의 할 것) -->
                  <serviceMetadata httpGetEnabled="true" />
               </behavior>
            </serviceBehaviors>
         </behaviors>
      </system.serviceModel>

  • Service Definition File (서비스와 같은 이름으로 생성. [프로젝트명.svc])

    • 예제

      <%@ ServiceHost Service = "Products.ProductsServiceImpl" Debug="true" %> <!-- Debug="true" 는 위에꺼 삽질하느라 임의로 넣었음. -->
      <%@ Assembly Name = "ProductsService" %>

  • 기본 구조

    • 데이터 계약

      [DataContract]

      public class Product {  }

    • 서 비스 계약

      [ServiceContract]

      public interface IProductsService {  }

    • 서 비스 계약 구현

      public class ProductsServiceImpl : IProductsService {  }

  • 참고 서적 및 사이트

 

 

이 글은 스프링노트에서 작성되었습니다.

Trackback 0 and Comment 0