W3C logo
slanted W3C logo

Cover page images (keys)

Webサービスについて

佐々木 フェリクス, <fsasaki@w3.org>

スライド

http://www.w3.org/2007/Talks/0628-sfc-lecture-ws/

注意!HTTPの詳細のところは省きます

本講義の「Web Architecture」の資料を読んでください

概要

文書のWeb

サービスのWeb

適用分野は

Webサービスのアプローチ

注意!

Webサービスのメリット

サービスの一例

概要

SOAPのWebサービスが利用する技術

SOAPの基本

<soap:Envelope
 xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
 soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header> ... </soap:Header>
<soap:Body> ...
 <soap:Fault> ... </soap:Fault>
</soap:Body>
</soap:Envelope>

部品のサービスの request(document style)

<soap:Envelope
 xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
<soap:Header> ... </soap:Header>
<soap:Body>
 <getPartInfo xmlns="some-ns.example.com">00345</getPartInfo>
</soap:Body>
</soap:Envelope>

部品のサービスの request(rpc style)

<soap:Envelope
 xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
 soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header> ... </soap:Header>
<soap:Body>
 <getPartInfo xmlns="some-ns.example.com>
  <partID>00345</partID>
 </getPartInfo>
</soap:Body>
</soap:Envelope>

responseの一例

<soap:Body>
 <p:Part xmlns:p="http://www.parts-depot.com"   
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <Part-ID>00345</Part-ID>
  <Name>Widget-A</Name>
  <Description>...</Description>
  <Specification xlink:href="http://www.parts-depot.com/parts/00345/specification"/>
  <UnitCost currency="USD">0.10</UnitCost>
  <Quantity>10</Quantity>
 </p:Part>
</soap:Body>

WSDL

<definitions>
 <types> ... </types>
 <message> ... </message>
 <portType> ... </portType>
 <binding> ... </binding>
</definitions>

WSDLの一例

<definitions>
 <types> 
  <xs:element name="getPartInfo"> ... </types>
 <message name="GetPartInfoSoap">
  <part name="parameters" element="tns:getPartInfo"/> ... </message>
 <portType name="GetPartInfoSoap> 
 <operation name="GetPartInfo">
  <input message="tns:GetPartInfoSoap"> ... </operation> ... </portType>
 <binding> ... </binding>
</definitions>

WS-*

WS-Addressingの「endpoint reference(EPR)」

<wsa:EndpointReference xmlns:wsa="..." xmlns:example="...">
   <wsa:Address>http://www.parts-depot.com/parts/</wsa:Address>
   <wsa:ReferenceProperties>
       <example:ServiceLevel>Basic</example:ServiceLevel>
   </wsa:ReferenceProperties>
</wsa:EndpointReference>

SOAPのWebサービス

概要

RESTの趣旨

RESTの基本的な概念

RESTの一例、問い合わせ

部品のリストの問い合わせ

http://www.parts-depot.com/parts

部品の詳細の情報を問う

http://www.parts-depot.com/parts/00345

問い合わせの出力

 <p:Part xmlns:p="http://www.parts-depot.com"   
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <Part-ID>00345</Part-ID>
  <Name>Widget-A</Name>
  <Description>...</Description>
  <Specification xlink:href="http://www.parts-depot.com/parts/00345/specification"/>
  <UnitCost currency="USD">0.10</UnitCost>
  <Quantity>10</Quantity>
 </p:Part>

RESTのURIの種類

http://www.parts-depot.com/parts/00345
http://www.parts-depot.com/parts?action=getParts&partID=00345

RESTの特徴(まとめ)

RESTの短所

概要

SOAPとRESTの共同作業が可能

WSDLにおける「WS Policy」のメタデータ

<binding name="SecureBinding" ...>
  <PolicyReference URI="#secure" />...</wsdl:binding>
<Policy wsu:Id=”secure”>
  <All>
    <ExactlyOne>
     <sp:TransportBinding>...</sp:TransportBinding>
     <sp:AsymmetricBinding>...</sp:AsymmetricBinding >
    </ExactlyOne>
  </All>
</Policy>

概要

注意!

これから紹介する技術は

Webサービスの国際化の目的

SOAPのWebサービスの国際化

SOAPのheaderに国際化の情報を追加

<i18n:international>
 <tz>GMT-0300</tz>
 <i18n:locale>en-US</i18n:locale>
 <i18n:preferences>
  <ldml:measurementSystem type="metric" />
 </i18n:preferences>
</i18n:international>

ロケールの「WS Policy expression」をWSDLに追加

RESTのサービスの国際化

概要

参考文献