XML 튜토리얼

XML 홈 XML 소개 XML 사용 방법 XML 트리 XML 구문 XML 요소 XML 속성 XML 네임스페이스 XML 표시 XML HttpRequest XML 파서 XML DOM XML XPath XML XSLT XML XQuery XML XLink XML 유효성 검사기 XML DTD XML 스키마 XML 서버 XML 예제 XML 퀴즈 XML 인증서

XML AJAX

AJAX 소개 AJAX XMLHttp AJAX 요청 AJAX 응답 AJAX XML 파일 AJAX PHP AJAX ASP AJAX 데이터베이스 AJAX 애플리케이션 AJAX 예제

XML DOM

DOM 소개 DOM 노드 DOM 액세스 DOM 노드 정보 DOM 노드 목록 DOM 순회 DOM 탐색 DOM 값 가져오기 DOM 변경 노드 DOM 제거 노드 DOM 교체 노드 DOM 생성 노드 DOM 추가 노드 DOM 복제 노드 DOM 예제

XPath 튜토리얼

XPath 소개 XPath 노드 XPath 구문 XPath 축 XPath 연산자 XPath 예제

XSLT 튜토리얼

XSLT 소개 XSL 언어 XSLT 변환 XSLT <템플릿> XSLT <값> XSLT <각각> XSLT <정렬> XSLT <만약> XSLT <선택> XSLT 적용 클라이언트의 XSLT 서버의 XSLT XSLT XML 편집 XSLT 예

XQuery 튜토리얼

XQuery 소개 XQuery 예제 XQuery FLWOR 엑스쿼리 HTML XQuery 용어 XQuery 구문 XQuery 추가 XQuery 선택 XQuery 함수

XML DTD

DTD 소개 DTD 빌딩 블록 DTD 요소 DTD 속성 DTD 요소 대 속성 DTD 엔터티 DTD 예

XSD 스키마

XSD 소개 XSD 방법 XSD <스키마> XSD 요소 XSD 속성 XSD 제한 사항

XSD 컴플렉스

XSD 요소 XSD 비어 있음 XSD 요소만 XSD 텍스트만 XSD 혼합 XSD 지표 XSD <모든> XSD <모든 속성> XSD 대체 XSD 예

XSD 데이터

XSD 문자열 XSD 날짜 XSD 숫자 XSD 기타 XSD 참조

서비스

XML 서비스 XML WSDL XML SOAP XML RDF XML RSS

참고문헌

DOM 노드 유형 DOM 노드 DOM 노드 목록 DOM NamedNodeMap DOM 문서 DOM 요소 DOM 속성 DOM 텍스트 DOM CDATA DOM 주석 DOM XMLHttpRequest DOM 파서 XSLT 요소 XSLT/XPath 함수

XML WSDL


  • WSDL은 웹 서비스 설명 언어를 의미합니다.
  • WSDL은 웹 서비스를 설명하는 데 사용됩니다.
  • WSDL은 XML로 작성되었습니다.
  • WSDL은 2007년 6월 26일의 W3C 권장 사항입니다.

WSDL 문서

WSDL 문서는 웹 서비스를 설명합니다. 다음 주요 요소를 사용하여 서비스의 위치와 서비스 방법을 지정합니다.

Element Description
<types> Defines the (XML Schema) data types used by the web service
<message> Defines the data elements for each operation
<portType> Describes the operations that can be performed and the messages involved.
<binding> Defines the protocol and data format for each port type

WSDL 문서의 주요 구조는 다음과 같습니다.

<definitions>

<types>
  data type definitions........
</types>

<message>
  definition of the data being communicated....
</message>

<portType>
  set of operations......
</portType>

<binding>
  protocol and data format specification....
</binding>

</definitions>


WSDL 예제

다음은 WSDL 문서의 단순화된 부분입니다.

<message name="getTermRequest">
  <part name="term" type="xs:string"/>
</message>

<message name="getTermResponse">
  <part name="value" type="xs:string"/>
</message>

<portType name="glossaryTerms">
  <operation name="getTerm">
    <input message="getTermRequest"/>
    <output message="getTermResponse"/>
  </operation>
</portType>

이 예에서 <portType> 요소는 "glossaryTerms"를 포트 이름으로 정의 하고 "getTerm"을 작업 이름으로 정의합니다 .

"getTerm " 작업에는 "getTermRequest"라는 입력 메시지 와 "getTermResponse"라는 출력 메시지 가 있습니다.

< message> 요소는 각 메시지의 부분 과 관련 데이터 유형을 정의합니다.


<portType> 요소

<portType> 요소는 웹 서비스 , 수행 할 수 있는 작업 및 관련된 메시지 를 정의합니다.

요청-응답 유형이 가장 일반적인 작업 유형이지만 WSDL은 네 가지 유형을 정의합니다.

Type Definition
One-way The operation can receive a message but will not return a response
Request-response The operation can receive a request and will return a response
Solicit-response The operation can send a request and will wait for a response
Notification The operation can send a message but will not wait for a response

WSDL 단방향 작업

단방향 작업 예:

<message name="newTermValues">
  <part name="term" type="xs:string"/>
  <part name="value" type="xs:string"/>
</message>

<portType name="glossaryTerms">
  <operation name="setTerm">
    <input name="newTerm" message="newTermValues"/>
  </operation>
</portType >

위의 예에서 portType "glossaryTerms"는 "setTerm"이라는 단방향 작업을 정의합니다.

"setTerm" 작업은 "term" 및 "value" 입력 매개변수가 있는 "newTermValues" 메시지를 사용하여 새로운 용어집 메시지를 입력할 수 있도록 합니다. 그러나 작업에 대해 정의된 출력이 없습니다.


WSDL 요청-응답 작업

요청-응답 작업 예:

<message name="getTermRequest">
  <part name="term" type="xs:string"/>
</message>

<message name="getTermResponse">
  <part name="value" type="xs:string"/>
</message>

<portType name="glossaryTerms">
  <operation name="getTerm">
    <input message="getTermRequest"/>
    <output message="getTermResponse"/>
  </operation>
</portType>

위의 예에서 portType "glossaryTerms"는 "getTerm"이라는 요청-응답 작업을 정의합니다.

"getTerm" 작업에는 "term"이라는 매개변수가 있는 "getTermRequest"라는 입력 메시지가 필요하며 "value"라는 매개변수가 있는 "getTermResponse"라는 출력 메시지를 반환합니다.


SOAP에 대한 WSDL 바인딩

WSDL 바인딩은 웹 서비스에 대한 메시지 형식 및 프로토콜 세부 정보를 정의합니다.

요청-응답 작업 예:

<message name="getTermRequest">
  <part name="term" type="xs:string"/>
</message>

<message name="getTermResponse">
  <part name="value" type="xs:string"/>
</message>

<portType name="glossaryTerms">
  <operation name="getTerm">
    <input message="getTermRequest"/>
    <output message="getTermResponse"/>
  </operation>
</portType>

<binding type="glossaryTerms" name="b1">
   <soap:binding style="document"
   transport="http://schemas.xmlsoap.org/soap/http" />
   <operation>
     <soap:operation soapAction="http://example.com/getTerm"/>
     <input><soap:body use="literal"/></input>
     <output><soap:body use="literal"/></output>
  </operation>
</binding>

바인딩 요소에는 이름과 유형 의 두 가지 속성이 있습니다.

name 속성(원하는 이름을 사용할 수 있음)은 바인딩의 이름을 정의하고 type 속성은 바인딩의 포트(이 경우 "glossaryTerms" 포트)를 가리킵니다.

soap:binding 요소에는 스타일과 전송이라는 두 가지 속성이 있습니다 .

스타일 속성은 "rpc" 또는 "document"일 수 있습니다. 이 경우 문서를 사용합니다. Transport 속성은 사용할 SOAP 프로토콜을 정의합니다. 이 경우 HTTP를 사용합니다.

작업 요소는 portType이 노출하는 각 작업을 정의합니다 .

각 작업에 대해 해당 SOAP 작업을 정의해야 합니다. 또한 입력 및 출력이 인코딩되는 방식을 지정해야 합니다. 이 경우 "리터럴"을 사용합니다.