高度なカスタマイズ > Info*Engine ユーザーガイド > Web サービスフレームワーク > Info*Engine ベースの Web サービスの作成 > Web サービス用の Info*Engine タスクの作成
  
Web サービス用の Info*Engine タスクの作成
この手順では、4 つの簡単なタスク (Add.xmlDivide.xmlMultiply.xmlSubtract.xml) が、以下のソースが指定されているロケーションに作成されます。これらのタスクは非常に単純であり、主にドキュメンテーションを含んでいることに注意してください。
Add.xml
ソース: <Windchill>/prog_examples/jws/MyProject/src/tasks/org/myorg/MathService/Add.xml
<%@page language="java"%>
<%@ taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>
<%@taglib uri="/com/infoengine/tlds/iejstl.tld" prefix="c"%>
<!--com.infoengine.soap.rpc.def
Generates the sum of two integers.
<p>Supply two integers, a and b. You can subtract
integers using the {@link Subtract} method.
@param int a The first integer.
@param int b The second integer.
@return int ${output[0]result[0]} The sum of a and b.
@see Multiply
@see Divide
@see Subtract
-->
<ie:webject name="Create-Group" type="GRP">
<ie:param name="GROUP_OUT" data="output"/>
</ie:webject>
<!-- just so non-web service clients could call this task
coerce a to an int, in case it isn’t already -->
<c:set var="A" value="${0+@FORM[0]a[0]}" />
<c:set var="${output[0]result}" value="${A+@FORM[0]b[0]}" />
Divide.xml
ソース: <Windchill>/prog_examples/jws/MyProject/src/tasks/org/myorg/MathService/Divide.xml
<%@page language="java"%>
<%@ taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>
<%@taglib uri="/com/infoengine/tlds/iejstl.tld" prefix="c"%>
<!--com.infoengine.soap.rpc.def
Generates the result of dividing two integers.
<p>Supply two integers, a and b. You can multiply
integers using the {@link Multiply} method.
@param int a The first integer.
@param int b The second integer.
@return float ${output[0]result[0]} The sum of a and b.
@see Multiply
@see Divide
@see Subtract
-->
<ie:webject name="Create-Group" type="GRP">
<ie:param name="GROUP_OUT" data="output"/>
</ie:webject>
<!-- just so non-web service clients could call this task
coerce a to an float, in case it isn’t already -->
<c:set var="A" value="${0.0+@FORM[0]a[0]}" />
<c:set var="${output[0]result}" value="${A/@FORM[0]b[0]}" />
Multiply.xml
ソース: <Windchill>/prog_examples/jws/MyProject/src/tasks/org/myorg/MathService/Multiply.xml
<%@page language="java"%>
<%@ taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>
<%@taglib uri="/com/infoengine/tlds/iejstl.tld" prefix="c"%>
<!--com.infoengine.soap.rpc.def
Generates the product of two integers.
<p>Supply two integers, a and b. You can divide
integers using the {@link Divide} method.
@param int a The first integer.
@param int b The second integer.
@return int ${output[0]result[0]} The sum of a and b.
@see Multiply
@see Divide
@see Subtract
-->
<ie:webject name="Create-Group" type="GRP">
<ie:param name="GROUP_OUT" data="output"/>
</ie:webject>
<!-- just so non-web service clients could call this task
coerce a to an int, in case it isn't already -->
<c:set var="A" value="${0+@FORM[0]a[0]}" />
<c:set var="${output[0]result}" value="${A*@FORM[0]b[0]}" />
Subtract.xml
ソース: <Windchill>/prog_examples/jws/MyProject/src/tasks/org/myorg/MathService/Subtract.xml
<%@page language="java"%>
<%@ taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>
<%@taglib uri="/com/infoengine/tlds/iejstl.tld" prefix="c"%>
<!--com.infoengine.soap.rpc.def
Generates the difference of two integers.
<p>Supply two integers, a and b. You can add
integers using the {@link Add} method.
@param int a The first integer.
@param int b The second integer.
@return int ${output[0]result[0]} The sum of a and b.
@see Multiply
@see Divide
@see Subtract
-->
<ie:webject name="Create-Group" type="GRP">
<ie:param name="GROUP_OUT" data="outputd"/>
</ie:webject>
<!-- just so non-web service clients could call this task
coerce a to an int, in case it isn't already -->
<c:set var="A" value="${0+@FORM[0]a[0]}" />
<c:set var="${output[0]result}" value="${A-@FORM[0]b[0]}" />