• 検索結果がありません。

WS-I の最新動向

N/A
N/A
Protected

Academic year: 2021

シェア "WS-I の最新動向"

Copied!
25
0
0

読み込み中.... (全文を見る)

全文

(1)

WS-I Testing Tools

技術解説

ビーコン

IT

岩本幸男

(2)

Testing Toolの構成(1)

Port番号

で切替

(3)

Testing Toolの構成(2)

Testing Tools V1.0 User Guide より抜粋

(4)

Demo:Java環境でのTesting Tools

サーバ

クライアント

log.

xml

report.

xml

Analyzer

Sample

SampleWSI

ab+‘日本語’+cd

Monitor

SOAPメッセージ

‘日本語’

‘ab日本語cd’

(5)

How to use Testing Tools (1)

„

以下のサイトから使用する

Testing Toolsのセットをダウ

ンロードする

WS-I Testing Tools - Final

(6)

How to use Testing Tools (2)

(7)

設定に際して必要な事項の確認(1)

„

Monitorがlistenするポート番号

→ クライアントがアクセスする際のアドレス:ポート

ex) http://localhost:

9090

/HelloWorld.jws

„

テスト対象の

Webサービスのエンドポイント

ex)

http://localhost:8080

/HelloWorld.jws

„

テスト対象の

WebサービスのWSDL文書のURL

ex)

http://localhost:8080/HelloWorld.jws?wsdl

(8)

設定に際して必要な事項の確認(2)

„

ツール実行時のカレントディレクトリ

ex) c:¥wsi-test-tools¥java¥bin

„

トレースログファイルの出力先

ex) c:¥wsi-test-tools¥java¥samples

„

コンフォーマンスレポートの出力先

ex) C:¥wsi-test-tools¥java¥sample

„

日本語

Basic Profileの参照先

ex)

http://www.ws-i.org/Profiles/Basic/2003-08/BasicProfile-1.0a-ja.html

(9)

Monitor Toolの設定(1)

„

Monitorの基本設定

<wsi-monConfig:configuration

xmlns:wsi-monConfig="http://www.ws-i.org/testing/2003/03/monitorConfig/">

<wsi-monConfig:comment>

This configuration file is used to test the WS-I sample applications running on a single system.

</wsi-monConfig:comment>

<wsi-monConfig:logFile replace="true" location=“

../samples/log.xml

">

<wsi-monConfig:addStyleSheet href=“

../../common/xsl/log.xsl

" type="text/xsl"/>

</wsi-monConfig:logFile>

<wsi-monConfig:logDuration>600</wsi-monConfig:logDuration>

<wsi-monConfig:cleanupTimeoutSeconds>3</wsi-monConfig:cleanupTimeoutSeconds>

</wsi-monConfig:configuration>

(10)

Monitor Toolの設定(2)

„

Monitorのリクエスト転送設定

<wsi-monConfig:manInTheMiddle>

<wsi-monConfig:redirect>

<wsi-monConfig:comment>

This is a redirect example for local Retailer Sample App on port

8080.

</wsi-monConfig:comment>

<wsi-monConfig:listenPort>

9090

</wsi-monConfig:listenPort>

<wsi-monConfig:schemeAndHostPort>

http://localhost:8080

</wsi-monConfig:schemeAndHostPort>

<wsi-monConfig:maxConnections>

1000

</wsi-monConfig:maxConnections>

<wsi-monConfig:readTimeoutSeconds>

15

</wsi-monConfig:readTimeoutSeconds>

</wsi-monConfig:redirect>

(11)

Analyzer Toolの設定(1)

„

WSDLを確認

<wsdl:binding name="

HelloWorldSoapBinding

" type="impl:HelloWorld">

<wsdlsoap:binding style="rpc"

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

<wsdl:operation name="hello">

<wsdlsoap:operation soapAction=""/>

<wsdl:input name="helloRequest">

<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

namespace="http://DefaultNamespace" use="encoded"/>

</wsdl:input>

<wsdl:output name="helloResponse">

<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

namespace="http://localhost:8080/axis/HelloWorld.jws" use="encoded"/>

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

(12)

Analyzer Toolの設定(2)

„

Analyzerの基本設定

<wsi-analyzerConfig:verbose>false</wsi-analyzerConfig:verbose>

<wsi-analyzerConfig:assertionResults type="all" messageEntry="true" failureMessage="true"/>

<wsi-analyzerConfig:reportFile replace="true" location="

../samples/report.xml

">

<wsi-analyzerConfig:addStyleSheet href="

../../common/xsl/report.xsl

" type="text/xsl"/>

</wsi-analyzerConfig:reportFile>

<wsi-analyzerConfig:testAssertionsFile>

../../common/profiles/BasicProfileTestAssertions.xml

</wsi-analyzerConfig:testAssertionsFile>

<wsi-analyzerConfig:logFile correlationType="endpoint">

../samples/log.xml

(13)

Analyzer Toolの設定(3)

„

AnalyzerのWebサービス参照設定

<wsi-analyzerConfig:wsdlReference>

<wsi-analyzerConfig:wsdlElement type="

binding

"

namespace="

http://localhost:8080/axis/HelloWorld.jws

">

HelloWorldSoapBinding

</wsi-analyzerConfig:wsdlElement>

<wsi-analyzerConfig:wsdlURI>

http://localhost:8080/axis/HelloWorld.jws?wsdl

</wsi-analyzerConfig:wsdlURI>

<wsi-analyzerConfig:serviceLocation>

http://localhost:8080/axis/HelloWorld.jws

</wsi-analyzerConfig:serviceLocation>

(14)

日本語版

Basic Profileの参照設定

„

Test Assertion Documentを編集

„

参照箇所をローカルファイルとすることも可能

ex)

c:¥wsi-test-tools¥common¥docs¥BasicProfile-1.0a-ja.html

„

最新版の参照設定(英語版)

<profileList>

<profile id="BP1" name="Basic Profile" version="1.0" revision="Final"

location="

http://www.ws-i.org/Profiles/Basic/2003-08/BasicProfile-1.0a-ja.html

"/>

</profileList>

(15)

ツールの実行手順

„

実行時カレントディレクトリを

c:¥wsi-test-tools¥java¥bin

とする

„

WSI_HOME環境変数を設定

ex) set WSI_HOME=c:¥wsi-test-tools

„

Monitorツールの実行

monitor – config ../samples/monitorConfig.xml

„

Webサービスのリクエストを行う

Motniorツールでログの収集が完了

„

Analyzerツールの実行

analyzer – config ../samples/analyzerConfig.xml

„

Comformance Reportの確認

(16)

MonitorConfigについて

<wsi-monConfig:manInTheMiddle>

<wsi-monConfig:redirect>

<wsi-monConfig:comment>Sample App on port 8080.</wsi-monConfig:comment>

<wsi-monConfig:listenPort>

4040

</wsi-monConfig:listenPort>

<wsi-monConfig:schemeAndHostPort>

http://localhost:8080

</wsi-monConfig:schemeAndHostPort>

<wsi-monConfig:maxConnections>1000</wsi-monConfig:maxConnections>

<wsi-monConfig:readTimeoutSeconds>15</wsi-monConfig:readTimeoutSeconds>

</wsi-monConfig:redirect>

</wsi-monConfig:manInTheMiddle>

①Monitorのポート

localhost:4040

②Serverのポート

localhost:8080

①Monitorのポート

localhost:4040

②Serverのポート

localhost:8080

Monitorを停止するには

(17)

AnalyzerConfigについて

<wsi-analyzerConfig:testAssertionsFile>

../common/profiles/BasicProfileTestAssertions.xml

</wsi-analyzerConfig:testAssertionsFile>

<wsi-analyzerConfig:logFile correlationType="endpoint">

log.xml

</wsi-analyzerConfig:logFile>

<wsi-analyzerConfig:wsdlReference>

<wsi-analyzerConfig:wsdlElement type="port"

parentElementName="SampleServiceService"

namespace="http://localhost:8080/wsi/services/Sample">

Sample

</wsi-analyzerConfig:wsdlElement>

<wsi-analyzerConfig:wsdlURI>

http://localhost:8080/wsi/services/Sample?wsdl

</wsi-analyzerConfig:wsdlURI>

</wsi-analyzerConfig:wsdlReference>

Analyzerは処理終了後自動的に終了する。

①Monitorの出力Logファイル名称

②WSDLのport句“Sample”を検査の対象とする

①Monitorの出力Logファイル名称

②WSDLのport句“Sample”を検査の対象とする

(18)
(19)

AXISによるデフォルトコール時のLog抜粋

Request

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Body>

<ns1:getMessage soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://services.wsi_demo.beacon_it.co.jp">

<userName xsi:type="xsd:string">ゲストユーザ</userName> </ns1:getMessage> </soapenv:Body></soapenv:Envelope> soap:encodingStyle 属性を含んではなら ない (MUST NOT) Response <?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <ns1:getMessageResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://services.wsi_demo.beacon_it.co.jp"> <ns1:getMessageReturn xsi:type="xsd:string">[2004-32-20 16:04:02]: こんにちは、ゲストユーザさん。 こちらはjp.co.beacon_it.wsi_demo.services.SampleServiceです。</ns1:getMessageReturn> </ns1:getMessageResponse> ns1のNameSpaceが WSDLの内容と異な る。

(20)

AnalyzerによるBP適合性分析(1)

passedColor:

green

failedColor:

red

warningColor:

orange

notApplicableColor: blue

missingInputColor:

brown

Report中の色の意味

スタイルシートの指定

(AnalyzerConfig)

(21)

Report

TestAssertions

BasicProfile

(22)

WS-I BPに準拠させたコール時のLog抜粋

Request

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <getMessage xmlns="http://www.beacon-it.co.jp/schema/wsi/demo/"> <userName xmlns="">ゲストユーザ</userName> </getMessage> </soapenv:Body></soapenv:Envelope> Response <?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Body>

<getMessageResponse xmlns="http://www.beacon-it.co.jp/schema/wsi/demo/">

<getMessageReturn xmlns="">[2004-34-20 16:04:49]: こんにちは、ゲストユーザさん。

(23)

Testにpassした場合のAnalyzerReport

Resultに「passed」

と表示される

(24)

Deployment Descriptorの比較

Sample

<service name="Sample" provider="java:RPC" >

<parameter name="className" value="jp.co.beacon_it.wsi_demo.services.SampleService"/> <parameter name="allowedMethods" value="getMessage"/>

</service>

SampleWSI

<service name="SampleWSI" provider="java:RPC" style="rpc" use="literal">

<parameter name="wsdlTargetNamespace" value="http://www.beacon-it.co.jp/schema/wsi/demo/"/> <parameter name="className" value="jp.co.beacon_it.wsi_demo.services.SampleService"/>

<parameter name="allowedMethods" value="getMessage"/>

<operation name="getMessage" qname="getMessage"

returnQName="getMessageReturn" returnType="xsd:string"

xmlns:xsd="http://www.w3.org/2001/XMLSchema" > <parameter name="userName" type="xsd:string"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>

Operationに対し

てNameSpaceを

(25)

WSDLの比較

Sample - <wsdl:operation name="getMessage"> <wsdlsoap:operation soapAction="" /> - <wsdl:input name="getMessageRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://services.wsi_demo.beacon_it.co.jp" use="encoded" /> </wsdl:input> - <wsdl:output name="getMessageResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://127.0.0.1:8080/wsi/services/Sample" use="encoded" /> </wsdl:output> </wsdl:operation>

soap:encodingStyl

e 属性を含んでは

ならない

SampleWSI - <wsdl:operation name="getMessage"> <wsdlsoap:operation soapAction="" /> - <wsdl:input name="getMessageRequest">

<wsdlsoap:body namespace="http://www.beacon-it.co.jp/schema/wsi/demo/" use="literal" /> </wsdl:input>

- <wsdl:output name="getMessageResponse">

<wsdlsoap:body namespace="http://www.beacon-it.co.jp/schema/wsi/demo/" use="literal" /> </wsdl:output>

Basic Profile では

literal 方式だけを

参照

関連したドキュメント

Views of Kazunogawa Hydroelectric Power Station Dams &lt;Upper dam (Kamihikawa dam)&gt;. &lt;Lower dam

“Intraday Trading in the Overnight Federal Funds Market” FRBNY Current Issues in Economics and Finance 11 no.11 (November). Bartolini L., Gudell S.,

[r]

When value of &lt;StThr[3:0]&gt; is different from 0 and measured back emf signal is lower than &lt;StThr[3:0]&gt; threshold for 2 succeeding coil current zero−crossings (including