vs.net 에서의 web service

Post on 09-Jan-2016

135 Views

Category:

Documents

6 Downloads

Preview:

Click to see full reader

DESCRIPTION

VS.NET 에서의 Web Service. Keon Bok Lee Microsoft Korea. Agenda. Web Service 란 ? Web Service 가 사용되야 하는 이유 Web Service 의 작성방법 Web Service 를 사용하는 방법. 웹 서비스로 제공. B2B 무역거래. 공급자 A. 공급자 B. Firewall. Rich and Reach. SQL Server, Oracle, DB2. Inventory. 전자상거래. 다양한 클라이언트 환경. 물품주문 수행. - PowerPoint PPT Presentation

TRANSCRIPT

VS.NETVS.NET 에서의 에서의 Web ServiceWeb Service

Keon Bok LeeKeon Bok LeeMicrosoft KoreaMicrosoft Korea

AgendaAgenda

Web Service 란 ? Web Service 가 사용되야 하는 이유 Web Service 의 작성방법 Web Service 를 사용하는 방법

전자상거래InventoryInventory

물품주문 수행물품주문 수행

SQL Server, Oracle, DB2 SQL Server, Oracle, DB2

B2B무역거래

공급자 공급자 A A

FirewallFirewall 공급자 공급자 B B

Windows DNA 2000 Windows DNA 2000 환경환경

Windows DNA AppWindows DNA App

Rich and Rich and ReachReach

다양한 클라이언트 환경

웹 서비스로 웹 서비스로 제공제공

Web Web ApplicationApplication

.NET .NET 응용프로그램응용프로그램

Web Web ServiceService

XMLXML

““Block Block Services” Services” 구축구축HTML

HTML

ClientClient

XML

XML

ClientClientXMLXML

Web Web ServiceService

XMLXML

Web Web ServicServic

ee

XMLXML

XM

LX

ML

SOAPSOAPSOAPSOAP 웹 서비스의 사용자는 웹 서비스의 사용자는 XMLXML 을 이용하여 을 이용하여 데이터를 주고 받는다데이터를 주고 받는다 . .

SOAPSOAPContract LanguageContract Language

SOAPSOAPContract LanguageContract Language

웹 서비스는 일정한 형식에 따라 정의됨웹 서비스는 일정한 형식에 따라 정의됨

SOAPSOAPDiscoveryDiscoverySOAPSOAP

DiscoveryDiscovery

추가정보추가정보 :: 웹사이트에서 제공하는 웹 서비스를 요청웹사이트에서 제공하는 웹 서비스를 요청

이러한 기능을 표준 인터넷 프로토콜을 이용이러한 기능을 표준 인터넷 프로토콜을 이용 XML, XSDXML, XSDHTTP, SMTPHTTP, SMTP

Web ServiceWeb Service 란 란 ? ?

개방형 Internet Protocols

Web Web ServiceService

표준 웹 프로토콜을 이용한 구성요소 표준 웹 프로토콜을 이용한 구성요소 사용사용 // 프로그램 작성프로그램 작성

Web ServiceWeb Service 란 란 ??

잘못된 생각 :– 웹서비스는 웹페이지이다 .– 웹 브라우저에서만 사용된다 . – 마이크로소프트에서만 사용되는 기술이다

웹 서비스란 ?:– 표준 인터넷 프로토콜을 이용하여 외부의 프로시저를

호출하는 방법

Web ServiceWeb Service 의 의미는의 의미는 ??

Web Service 의 역활 :– 서비스의 발견– 프로시저의 호출– Argument 전달– 결과 검색

XML 의 사용

ExampleExample

Hello World

Web ServiceWeb Service 를 사용해야 하는 이유를 사용해야 하는 이유

기존의 DCOM 의 문제점

간단함 텍스트 (XML) HTTP

– Stateless– 성능– 신뢰성– 기존의 웹 사이트의 기본구조 사용

Web Services Web Services 구조구조

Web Service (ASP.Net 에서 ASMX 파일 호출 )– Web Service 메서드의 구현

Service Description Language (SDL)– Web Service 를 설명– 다른 연결된 정보 설명

Discovery Documents (DISCO)– Web Service 생성

DISCO

ASMX

XSD

SCL

SCL

Discovery DocumentDiscovery Document

웹서비스를 찾아내는 방법 *.disco 파일 사용 웹 서비스가 어디있는지 알려주는 XML 파일 필수요소는 아님

<?xml version="1.0" ?><disco:discovery

xmlns:disco="http://schemas.xmlsoap.org/disco xmlns:scl="http://schemas.xmlsoap.org/disco/scl">

<scl:contractRef ref="http://MyWebServer/UserName.asmx?SDL"/>

</disco:discovery>

Service Description LanguageService Description Language

웹 서비스의 내용을 알아내는 방법 Web Service 는 SDL 을 이용

– Service Description Language

클라이언트와 서버와의 계약 설명

– 가능한 프로시저– Arguments– Return 값– 데이터 형식

http://localhost/webservice.asmx?SDL

Wire FormatsWire Formats

잘못된 생각 :– Proprietary– Binary

기본 형식은 ..:– XML 바탕의 사용– HTTP Get– HTTP Post– SOAP

ProtocolsProtocols

기본 : HTTP GET 와 POST– Primitives (integers, strings, etc)– Primitives 배열

SOAP– 기본 구조– Enumerations– 클래스– XML 데이터셋– 배열

호출방법호출방법

HTTP GET– http://localhost/webservice.asmx?arg1=2&arg2=4

HTTP Post– 폼과 같은 UUEncoded 인수의 사용

SOAP– XML 요청 형식을 설명

Test 페이지 자동 생성– http://localhost/webservice.asmx

웹서비스 작성방법웹서비스 작성방법

Inline Code 형식

Code Behind– VS.Net 에서 사용

<%@ WebService Language="C#" Class="Math" %>using System.Web.Services;

public class Math : WebService { [ WebMethod ] public int Add(int num1, int num2) {

return num1+num2; }

}

DemoDemo

PocketPC 에서 웹 서비스의 사용

QuestionsQuestions

http://www.microsoft.comhttp://www.devpia.com

top related