We will now write and deploy a new service that exposes all the WS-ResourceProperty portTypes through compositional inheritance. What is compositional inheritance? Basically copying & pasting operations from the WSRP portTypes to the MathPortType. Our client application will, in turn, make a call to some of these portTypes.
In this chapter we must use a new WSDL file because we want to extend from new portTypes, which necessarily changes our service's interface. In this WSDL the "getValueRP" operation has been removed. The GetResourceProperty, SetResourceProperty, GetMultipleResourceProperties, and QueryResourceProperties operations were copied from their respective WSRP portTypes into the MathPortType. In theMathBinding we also need to define each new operation.
<?xml version="1.0" encoding="UTF-8"?> <definitions name="MathServiceRP" targetNamespace="http://www.globus.org/namespaces/examples/core/MathService_instance_rp"xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.globus.org/namespaces/examples/core/MathService_instance_rp" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd" xmlns:wsrpw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <wsdl:import
namespace= "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl" location="wsrf/properties/WS-ResourceProperties.wsdl" /> <!--============================================================ T Y P E S ============================================================--> <types> <xsd:schema targetNamespace="http://www.globus.org/namespaces/examples/core/MathService_instance_rp" xmlns:tns="http://www.globus.org/namespaces/examples/core/MathService_instance_rp" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <!-- IMPORT WS-ADDRESSING --> <xsd:import namespace="http://schemas.xmlsoap.org/ws/2004/03/addressing" schemaLocation="http://schemas.xmlsoap.org/ws/2004/03/addressing"/> <!-- REQUESTS AND RESPONSES --> <xsd:element name="add" type="xsd:int"/> <xsd:element name="addResponse"> <xsd:complexType/> </xsd:element> <xsd:element name="subtract" type="xsd:int"/> <xsd:element name="subtractResponse"> <xsd:complexType/> </xsd:element> <xsd:element name="create"> <xsd:complexType/> </xsd:element> <xsd:element name="createResponse"> <xsd:complexType> <xsd:sequence> <xsd:element ref="wsa:EndpointReference"/> </xsd:sequence> </xsd:complexType> </xsd:element> <!-- MathService Resource Properties --> <xsd:element name="Value" type="xsd:int"/> <xsd:element name="LastOp" type="xsd:string"/> <xsd:element name="MathResourceProperties"> <xsd:complexType> <xsd:sequence> <xsd:element ref="tns:Value"/> <xsd:element ref="tns:LastOp"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </types> <!--============================================================ M E S S A G E S ============================================================--> <message name="AddInputMessage"> <part name="parameters" element="tns:add"/> </message> <message name="AddOutputMessage"> <part name="parameters" element="tns:addResponse"/> </message> <message name="SubtractInputMessage"> <part name="parameters" element="tns:subtract"/> </message> <message name="SubtractOutputMessage"> <part name="parameters" element="tns:subtractResponse"/> </message> <message name="CreateInputMessage"> <part name="parameters" element="tns:create"/> </message> <message name="CreateOutputMessage"> <part name="parameters" element="tns:createResponse"/> </message> <!--============================================================ P O R T T Y P E ============================================================--> <portType name="MathPortType" wsrp:ResourceProperties="tns:MathResourceProperties"> <operation name="add">
<input message="tns:AddInputMessage"/> <output message="tns:AddOutputMessage"/> </operation> <operation name="subtract"> <input message="tns:SubtractInputMessage"/> <output message="tns:SubtractOutputMessage"/> </operation> <operation name="createResource"> <input message="tns:CreateInputMessage"/> <output message="tns:CreateOutputMessage"/> </operation> <operation name="GetResourceProperty">
<input name="GetResourcePropertyRequest" message="wsrpw:GetResourcePropertyRequest" wsa:Action="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties/GetResourceProperty"/> <output name="GetResourcePropertyResponse" message="wsrpw:GetResourcePropertyResponse" wsa:Action="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties/GetResourcePropertyResponse"/> <fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/> <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/> </operation> <operation name="GetMultipleResourceProperties">
<input name="GetMultipleResourcePropertiesRequest" message="wsrpw:GetMultipleResourcePropertiesRequest" wsa:Action="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties/GetMultipleResourceProperties"/> <output name="GetMultipleResourcePropertiesResponse" message="wsrpw:GetMultipleResourcePropertiesResponse" wsa:Action="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties/GetMultipleResourcePropertiesResponse"/> <fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/> <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/> </operation> <operation name="SetResourceProperties">
<input name="SetResourcePropertiesRequest" message="wsrpw:SetResourcePropertiesRequest" wsa:Action="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties/SetResourceProperties"/> <output name="SetResourcePropertiesResponse" message="wsrpw:SetResourcePropertiesResponse" wsa:Action="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties/SetResourcePropertiesResponse"/> <fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/> <fault name="UnableToModifyResourcePropertyFault" message="wsrpw:UnableToModifyResourcePropertyFault"/> <fault name="SetResourcePropertyRequestFailedFault" message="wsrpw:SetResourcePropertyRequestFailedFault"/> <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/> <fault name="InvalidSetResourcePropertiesRequestContentFault" message="wsrpw:InvalidSetResourcePropertiesRequestContentFault"/> </operation> <operation name="QueryResourceProperties">
<input name="QueryResourcePropertiesRequest" message="wsrpw:QueryResourcePropertiesRequest" wsa:Action="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties/QueryResourceProperties"/> <output name="QueryResourcePropertiesResponse" message="wsrpw:QueryResourcePropertiesResponse" wsa:Action="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties/QueryResourcePropertiesResponse"/> <fault name="UnknownQueryExpressionDialectFault" message="wsrpw:UnknownQueryExpressionDialectFault"/> <fault name="InvalidResourcePropertyQNameFault" message="wsrpw:InvalidResourcePropertyQNameFault"/> <fault name="QueryEvaluationErrorFault" message="wsrpw:QueryEvaluationErrorFault"/> <fault name="InvalidQueryExpressionFault" message="wsrpw:InvalidQueryExpressionFault"/> <fault name="ResourceUnknownFault" message="wsrpw:ResourceUnknownFault"/> </operation> </portType> <!--============================================================ B I N D I N G ============================================================--> <binding name="MathBinding" type="MathPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="add"> <soap:operation soapAction=""/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="subtract"> <soap:operation soapAction=""/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="createResource"> <soap:operation soapAction=""/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="GetResourceProperty"> <soap:operation soapAction=""/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="GetMultipleResourceProperties"> <soap:operation soapAction=""/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="SetResourceProperties"> <soap:operation soapAction=""/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="QueryResourceProperties"> <soap:operation soapAction=""/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </binding> <!--============================================================ S E R V I C E ============================================================--> <service name="MathService"> <port name="MathPort" binding="MathBinding"> <soap:address location="http://localhost:8080/wsrf/services/"/> </port> </service> </definitions>
![]() | Copy & Paste WSDL definition to "/tmp/MathRPService.wsdl". |