VS NET Web Service Microsoft Korea Windows DNA
VS. NET에서의 Web Service Microsoft Korea
차 례 □ 사업 개요 ○ Windows DNA 2000환경 ○. NET 응용프로그램 ○ Web Service란? ○ Web Service의 의미는? ○ Web Service를 사용해야 하는 이유 ○ Web Services 구조 ○ Discovery Document ○ Service Description Language ○ Wire Formats ○ Protocols ○ 호출방법 ○ 웹서비스 작성방법 ○ Demo ○ Questions
Agenda l l Web Service란 ? Web Service가 사용되야 하는 이유 Web Service의 작성방법 Web Service를 사용하는 방법
Windows DNA 2000 환경 웹 서비스로 제공 B 2 B 무역거래 공급자 A Firewall 공급자 B Rich and Reach Windows DNA App 다양한 클라이언트 환경 SQL Server, Oracle, DB 2 Inventory 전자상거래 물품주문 수행
. NET 응용프로그램 XM L XML Web Service Web Application L M HT Client XML Web Service L M X XML Web Service “Block Services” 구축 Client
Example Hello World
Web Services 구조 l Web Service (ASP. Net에서 ASMX 파일 호출) – Web Service 메서드의 구현 l Service Description Language (SDL) – Web Service를 설명 – 다른 연결된 정보 설명 l Discovery Documents (DISCO) – Web Service 생성 ASMX SCL XSD DISCO SCL
Discovery Document l l 웹서비스를 찾아내는 방법 *. disco 파일 사용 웹 서비스가 어디 있는지 알려주는 XML 파일 필수요소는 아님 <? xml version="1. 0" ? > <disco: discovery xmlns: disco="http: //schemas. xmlsoap. org/disco xmlns: scl="http: //schemas. xmlsoap. org/disco/scl"> <scl: contract. Ref ref="http: //My. Web. Server/User. Name. asmx? SDL"/> </disco: discovery>
Service Description Language l l 웹 서비스의 내용을 알아내는 방법 Web Service는 SDL을 이용 – Service Description Language l l 클라이언트와 서버와의 계약 설명 – 가능한 프로시저 – Arguments – Return값 – 데이터 형식 l http: //localhost/webservice. asmx? SDL
Wire Formats l 잘못된 생각: – Proprietary – Binary l 기본 형식은. . : – XML 바탕의 사용 – HTTP Get – HTTP Post – SOAP
Protocols l 기본: HTTP GET 와 POST – Primitives (integers, strings, etc) – Primitives 배열 l SOAP – 기본 구조 – Enumerations – 클래스 – XML 데이터셋 – 배열
호출방법 l HTTP GET – http: //localhost/webservice. asmx? arg 1=2&arg 2=4 l HTTP Post – 폼과 같은 UUEncoded 인수의 사용 l SOAP – XML 요청 형식을 설명 l Test 페이지 자동 생성 – http: //localhost/webservice. asmx
웹서비스 작성방법 l Inline Code 형식 <%@ Web. Service Language="C#" Class="Math" %> using System. Web. Services; public class Math : Web. Service { [ Web. Method ] public int Add(int num 1, int num 2) { return num 1+num 2; } } l Code Behind – VS. Net 에서 사용
Questions http: //www. microsoft. com
- Slides: 20