このレッスンでは、前のレッスンで作成したラッパープロシージャーを呼び出します。このプロシージャーは、レッスン 1 で作成した Web サーバーに要求を送信します。このレッスンで説明している、要求を送信する Web クライアントの設定の詳細については、レッスン 2:RAW 要求を送信し RAW 応答を受信する Web クライアントの設定を参照してください。
このレッスンには、localhost への複数の参照が含まれています。Web クライアントを Web サーバーと同じコンピューターで実行していない場合は、localhost の代わりにレッスン 1 の Web サーバーの IP アドレスを使用します。
レッスン 2 の接続が開かれていない場合は、Interactive SQL でクライアントデータベースに接続します。
dbisql -c "UID=DBA;PWD=sql;SERVER=echo_client" |
ラッパープロシージャーを呼び出して、要求を送信し、応答を取得します。
Interactive SQL で次の SQL 文を実行します。
CALL setMIME('<hello>this is xml</hello>', 'text/xml', 'http://localhost:8082/EchoService' ); |
http://localhost:8082/EchoService 変数は、localhost で実行されポート 8082 で受信するデータベースサーバーを示します。対象となる SOAP Web サービスの名前は EchoService です。
Interactive SQL に、次の結果セットが表示されます。
Attribute | Value |
---|---|
Status | HTTP/1.1 200 OK |
Body | <hello>this is xml</hello> |
Date | Thu, 04 Feb 2010 13:37:23 GMT |
Connection | close |
Expires | Thu, 04 Feb 2010 13:37:23 GMT |
Content-Type | text/plain; charset=windows-1252 |
Server | SQLAnywhere/12.0.1.1234 |
次に、Web サーバーに送信される HTTP パケットの例を示します。
POST /EchoService HTTP/1.0 Date: Thu, 04 Feb 2010 13:37:23 GMT Host: localhost Accept-Charset: windows-1252, UTF-8, * User-Agent: SQLAnywhere/12.0.1.1234 Content-Type: text/xml; charset=windows-1252 Content-Length: 49 ASA-Id: 1055532613:echo_client:echo:968000 Connection: close valueAsXML=<hello>this is xml</hello> |
Web サーバーからの応答は次のようになります。
HTTP/1.1 200 OK Server: SQLAnywhere/12.0.1.1234 Date: Thu, 04 Feb 2010 13:37:23 GMT Expires: Thu, 04 Feb 2010 13:37:23 GMT Content-Type: text/plain; charset=windows-1252 Connection: close <hello>this is xml</hello> |
![]() |
DocCommentXchange で意見交換できます
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |