1. Trang chủ
  2. » Công Nghệ Thông Tin

Web Services Tutorial phần 2 potx

11 280 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 11
Dung lượng 807,4 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

WSDL Schemaservice binding SOAP/HTTP/MIME portType port operation message types schema Service location and binding Package details based on specific protocol Operation input and output

Trang 1

SOAP Fault Message

HTTP/1.1 500 Internal Server Error

Content-Type: text/xml; charset="utf-8"

Content-Length: nnnn

<SOAP-ENV:Envelope >

<SOAP-ENV:Body>

<SOAP-ENV: Fault>

<faultcode>SOAP-ENV:Server</faultcode>

<faultstring>Server Error</faultstring>

<detail>

<e:myfaultdetails xmlns:e="Some-URI">

<message>My application didn't work</message>

<errorcode>1001</errorcode>

</e:myfaultdetails>

</detail>

</SOAP-ENV:Fault>

</SOAP-ENV:Body>

Trang 2

WSDL Schema

service

binding

SOAP/HTTP/MIME

portType

port

operation

message

types

schema

Service location and binding

Package details based on specific protocol

Operation input and output

parameters

Operation parameter types

Data types

part

Trang 3

Describing a service in WSDL

WSLDSrvcSearch

searchByExactTitle: aString includeAffiliatedLibraries: aBoolean

| coll |

coll := self

searchServices: ( self searchServicesInclusive: aBoolean )

onAspect: #searchTitles

withMatchString: aString

^coll isEmpty

ifTrue: [LDExcHoldingNotFound]

ifFalse:

[“Collection of LDHoldingBooks”

coll ]

Service provider

Exception Return type

Operation

Input Parameter

names Input Parameters

types

Trang 4

Describing parameter types

WSLDSrvcSearch

searchByExactTitle: aString

includingAffiliatedLibraries: aBoolean

RPC style:

<message name="SearchByExactTitleSoapIn">

<part name=" SearchByExactTitle " type=“xsd:string"/>

<part name="IncludeAffiliatedLibraries" type=“xsd:boolean"/>

</message>

<message name="SearchByExactTitleSoapOut">

<part name="return" type="ns:CollectionOfLDHoldingBook”/>

</message>

Document style:

<message name="SearchByExactTitleIncludeAffiliatedLibrariesSoapIn">

<part name=“parameter" element="ns:SearchByExactTitleIncludeAffiliatedLibraries"/>

</message>

<message name="SearchByExactTitleIncludeAffiliatedLibrariesSoapOut">

<part name="return" element="ns:SearchByExactTitleIncludeAffiliatedLibrariesResponse"/>

</message>

Trang 5

WSDL RPC and Document styles

• Document/literal

– Message has one or zero parts

– Part is resolved using an element

– The element is complex type in most cases

– Data is serialized according to a schema

• RPC/encoded

– The Soap body contains an element with the name of a remove procedure

– Message can have zero or more parts

– Each part corresponds a remote procedure parameter

– Each part is resolved using type

– Data is serialized according to SOAP 1.1

Trang 6

Describing types

<wsdl:types>

<wsdl:schema targetNamespace =“urn:someURL”>

<complexType name="LDHoldingBook">

<sequence>

<element name="dueDate" type="xsd:date"/>

<element name="language" type="xsd:string"/>

….

</sequence>

</complexType>

….

</wsdl:schema>

</wsd:types>

<element name=" SearchByExactTitleIncludeAffiliatedLibraries ">

<complexType>

<sequence>

<element name="searchByExactTitle" type=“xsd:string"/>

<element name="includeAffiliatedLibraries"

type="xsd:boolean"/>

</sequence>

</complexType>

</element>

Document style describing parameter types

Trang 7

Describing interfaces

WSLDSrvcSearch

searchByExactTitle : aString

includingAffiliatedLibraries : aBoolean

<portType name="WSLDSrvcSearch">

<operation name="SearchByExactTitleIncludeAffiliatedLibraries">

<input message="ns:SearchByExactTitleSoapIn"/>

<output message="ns:SearchByExactTitleSoapOut"/>

</operation>

<operation …>

</operation>

</portType>

Trang 8

Describing message transfer

<binding name="WSLDSrvcSearch"

type="ns:WSLDSrvcSearch">

<soap:binding style="document"

transport="http://schemas.xmlsoap.org/soap/http/"/>

<operation name="SearchByExactTitleIncludeAffiliatedLibraries"

selector="searchByExactTitle:includeAffiliatedLibraries:">

<soap:operation soapAction=""/>

<input>

<soap:body use="literal" namespace="urn:Library\doc"/>

</input>

<output>

<soap:body use="literal" namespace="urn:Library\doc"/>

</output>

<fault name=“LDExcHoldingNotFound“ />

</operation>

</binding>

Transport SOAP over HTTP

VW specific, not spec complaint

Not used by VW

Message input/output wire presentation

Exception description

Trang 9

Describing service location

<service name=“LibraryServices">

< port name=“LibrarySearch" binding="ns: WSLDSrvcSearch ">

<soap:address location=" http://localhost:3933/searchRpc "/>

</ port >

SOAP binding Can have one or more ports, each of which define a

connection method (for example, HTTP/SMTP, etc)

Trang 10

Web Services Support in VW

Trang 11

Web Services Frameworks

XML To Object Binding

WSDL SOAP UDDI

HTTP

Opentalk-XML

Opentalk-HTTP/CGI Opentalk-SOAP

Ngày đăng: 14/08/2014, 19:20

TỪ KHÓA LIÊN QUAN