execメソッドの入力パラメタに指定するXML文書は、以下のようなXMLスキーマに沿っている必要があります。また復帰値も同様に、以下のXMLスキーマの形式で設定されます。
<?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:xmlns-fujitsu-com:ihas2008-06" xmlns:tns=" urn:xmlns-fujitsu-com:ihas2008-06" elementFormDefault="qualified"> <element name="parameters"> <complexType > <sequence> <element name="code" type="int" /> <!-- リターンコード 0=正常 0> 異常 --> <element name="exception" type="string" /> <!-- 例外情報 --> <element name="key" type="string" /> <!-- 例外が発生したパラメタのキー --> <element name="param" minOccurs="0" maxOccurs="unbounded" type="tns:paramDef" /> </sequence> </complexType> </element> <complexType name="paramDef"> <complexContent> <extension base="tns:paramType"> <attribute name="valueType" type="tns:valueAttrTypes" use="required"></attribute> </extension> </complexContent> </complexType> <complexType name="paramType"> <sequence> <element name="key" type="string"></element> <element name="value" type="tns:valueDef"></element> </sequence> </complexType> <complexType name="stringList"> <sequence> <element name="col" minOccurs="1" maxOccurs="unbounded" type="string" /> </sequence> </complexType> <complexType name="stringTable"> <sequence minOccurs="1" maxOccurs="unbounded"> <element name="row" type="tns:stringList" minOccurs="1" maxOccurs="unbounded"></element> </sequence> </complexType> <complexType name="valueDef"> <choice> <element name="string" type="string"></element> <element name="stringList" type="tns:stringList"></element> <element name="stringTable" type="tns:stringTable"></element> </choice> </complexType> <simpleType name="valueAttrTypes"> <restriction base="token"> <enumeration value="string"/> <enumeration value="stringList"/> <enumeration value="stringTable"/> </restriction> </simpleType> </schema>
参考
本XMLスキーマは標準のXMLスキーマに準拠していますので、JAXBを使用することにより、簡単に入力値のXMLの構築、および復帰値のXMLの解析を行うことができます。
XMLスキーマファイルは以下に格納されています。
[インストールフォルダ]¥schema¥ihasws.xsd
例
入力値の例
keyに「key1」、値にString形式の値「value1」を指定する場合の入力値
<?xml version="1.0" encoding="UTF-8"?> <parameters xmlns="urn:xmlns-fujitsu-com:ihas2008-06"> <code>0</code> <exception/> <key/> <param valueType="string"> <key>key1</key> <value> <string>value1</string> </value> </param> </parameters>
注意
入力値のXMLにもcode/exception/keyを設定する必要があります。
入力値のcode/exception/keyは以下の値を指定します。
code | 0 |
exception | <空文字列> |
key | <空文字列> |
parametersタグのネームスペース属性には以下を指定する必要があります。
urn:xmlns-fujitsu-com:ihas2008-06
例
復帰値の例
以下のような3つの値で正常復帰した場合の復帰値
key | 値 |
---|---|
key1 | 以下のString型の値 value1 |
key2 | 以下の2つのString型のList value1 value2 |
key3 | 以下の2×2のString型のTable value11 value12 value21 value22 |
<?xml version="1.0" encoding="UTF-8"?> <parameters xmlns="urn:xmlns-fujitsu-com:ihas2008-06"> <code>0</code> <exception/> <key/> <param valueType="string"> <key>key1</key> <value> <string>value1</string> </value> </param> <param valueType="stringList"> <key>key2</key> <value> <stringList> <col>value1</col> <col>value2</col> </stringList> </value> </param> <param valueType="stringTable"> <key>key3</key> <value> <stringTable> <row> <col>value11</col> <col>value12</col> </row> <row> <col>value21</col> <col>value22</col> </row> </stringTable> </value> </param> </parameters>