public class SOAPConnect extends URLConnect
URLConnectを参照して下さい。
SOAP対応の追加機能としては、以下の2点があります。
①ヘッダー情報の変更
SOAP接続では、通常のURLConnectに加えて、以下のヘッダー情報を付加しています。
1.Content = text/xml;charset=UTF-8"
2.Accept = text/xml, multipart/related, text/html, image/gif, image/jpeg,
3.Soapaction = "[NameSpace][SOAPMethodName]"
②SOAPメッセージの生成機能
SOAPメッセージは、以下のようなXML構造で定義されます。
| コンストラクタと説明 |
|---|
SOAPConnect(String url,
String pass,
String ns,
String method,
String xmlData)
コンストラクター
ここでは、送信するXMLデータを直接指定するためのコンストラクターを定義しています。
|
SOAPConnect(String url,
String pass,
String ns,
String method,
String[] ks,
String[] vs)
コンストラクター
ここでは、送信するXMLデータをキー及び値の一覧から生成するためのコンストラクターを定義しています。
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
protected URLConnection |
getConnection()
URL と ユーザー:パスワードを与えて、URLConnectionを返します。
|
static void |
main(String[] args)
サンプル実行用のメインメソッド
java org.opengion.fukurou.util.SOAPConnect [<-info/-data>]
|
code2Message, connect, disconnect, getCharset, getCode, getDate, getInputStream, getLength, getMessage, getMethod, getModified, getReader, getType, getUrl, readData, setCharset, setPostData, setProxypublic SOAPConnect(String url, String pass, String ns, String method, String[] ks, String[] vs)
url - 接続するアドレスを指定します。(http://server:port/dir/file.html)pass - ユーザー:パスワード(認証接続が必要な場合)ns - 名前空間を指定します。method - メソッド名を指定します。ks - 送信するメソッドパラメーターのキー一覧を指定します。vs - 送信するパラメーターの値一覧を指定します。public SOAPConnect(String url, String pass, String ns, String method, String xmlData)
url - 接続するアドレスを指定します。(http://server:port/dir/file.html)pass - ユーザー:パスワード(認証接続が必要な場合)ns - 名前空間を指定します。method - メソッド名を指定します。xmlData - パラメーターのXMLデータprotected URLConnection getConnection() throws IOException
getConnection クラス内 URLConnectIOExceptionURLConnect.getConnection()public static void main(String[] args) throws IOException
args - コマンド引数配列IOExceptionWebアプリケーションフレームワーク openGionCopyright (c) 2009 The openGion Project.