我们可以用文本编辑器更改 CityName.wsdl 的内容,也可以用 Toolkit 带的 Property Broker 的可视化编辑器进行编辑修改。修改后的内容如下:
<?xml version="1.0" encoding="UTF-8"?> <definitions name="OrderDetail_Service" targetNamespace="http://www.ibm.com/wps/c2a" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:portlet="http://www.ibm.com/wps/c2a" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.ibm.com/wps/c2a" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <types> <xsd:schema targetNamespace="http://www.ibm.com/wps/c2a"> <xsd:simpleType name="ResultType"> <xsd:restriction base="xsd:string"> </xsd:restriction> </xsd:simpleType> </xsd:schema> </types> <message name="CityName"> <part name="resultFromCitySelection" type="tns:ResultType"/> </message> <portType name="CityName_Service"> <operation name="CityName_Operation"> <output message="tns:CityName"/> </operation> </portType> <binding name="CityNameBinding" type="tns:CityName_Service"> <portlet:binding/> <operation name="CityName_Operation"> <portlet:action name="CityNameAction" type="standard" caption="CityName.GetCityName" description="Get city name" actionNameParameter="ACTION_NAME"/> <output> <portlet:param name="CityName_Text" partname="resultFromCitySelection" boundTo="request-attribute" caption="City Name"/> </output> </operation> </binding> </definitions>
在这个组件 com.ibm.rcp.samples.cityselection
中, 其输出参数只有一个: CityName_Text
。我们可以用同样的方法,定义组件 com.ibm.rcp.samples.citytime
中的输入输出参数及动作,wsdl 文件的内容如下:
<?xml version="1.0" encoding="UTF-8"?> <definitions name="OrderDetail_Service" targetNamespace="http://www.ibm.com/wps/c2a" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:portlet="http://www.ibm.com/wps/c2a" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.ibm.com/wps/c2a" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <types> <xsd:schema targetNamespace="http://www.ibm.com/wps/c2a"> <xsd:simpleType name="ResultType"> <xsd:restriction base="xsd:string"> </xsd:restriction> </xsd:simpleType> </xsd:schema> </types> <message name="CityName"> <part name="resultFromCitySelection" type="tns:ResultType"/> </message> <portType name="CityName_Service"> <operation name="setCityName"> <input message="tns:CityName"/> </operation> </portType> <binding name="CityNameBinding" type="tns:CityName_Service"> <portlet:binding/> <operation name="setCityName"> <portlet:action name="setCityName" type="standard" caption="CityName.GetCityName" description="Get city name" actionNameParameter="ACTION_NAME" activeOnStartup="true"/> <input> <portlet:param name="setCityName" partname="resultFromCitySelection" caption="CityTime"/> </input> </operation> </binding> </definitions>
在组件 com.ibm.rcp.samples.citytime
中,定义了一个动作 setCityName
以及这个动作的输入参数 CityName
。