Web Service Provider Example
The Web service provider example in this section uses the Erewhon Investments sample system, in which you created the ErewhonInvestmentsService subclass of the
The following methods are defined in the ErewhonInvestmentsService class.
getAllClients(): CustomerByNameDict; getClient(clientName: String): Client; getAllClientNames(): StringArray; updateClient(client: Client);
Based on this class, the methods defined in the class, and the property selections made in the Web Service Exposure Wizard dialog (documented under "Generating Web Services Description Language (WSDL)", earlier in this chapter), JADE generates the following WSDL.
<?xml version="1.0" encoding="utf-8" ?> <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:JadeWebServices/WebShop/22/07/03/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:JadeWebServices/WebShop/22/07/03/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types> <xsd:schema elementFormDefault="qualified" targetNamespace="urn:JadeWebServices/WebShop/22/07/03/"> <xsd:element name="getClient"> <xsd:complexType> <xsd:sequence> <xsd:element name="clientName" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="getClientResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="getClientResult" type="tns:Client" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="getClientNames"> <xsd:complexType> <xsd:sequence> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="getClientNamesResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="getClientNamesResult" type="tns:ArrayOfString" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="getClients"> <xsd:complexType> <xsd:sequence> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="getClientsResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="getClientsResult" type="tns:ArrayOfClient"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="updateClient"> <xsd:complexType> <xsd:sequence> <xsd:element name="client" type="tns:Client" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="updateClientResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="updateClientResult" type="tns:Client" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:complexType name="Client"> <xsd:complexContent mixed="true"> <xsd:extension base="tns:AddressableEntity"> <xsd:sequence> <xsd:element name="allRetailSales" type="tns:ArrayOfRetailSale"/> <xsd:element name="myCompany" type="tns:Company"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="ArrayOfRetailSale"> <xsd:sequence> <xsd:element minOccurs="0" maxOccurs="unbounded" name="RetailSale" type="tns:RetailSale" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="RetailSale"> <xsd:complexContent mixed="true"> <xsd:extension base="tns:Sale"> <xsd:sequence> <xsd:element name="price" type="xsd:decimal"/> <xsd:element name="timeStamp" type="xsd:dateTime"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="Sale"> <xsd:complexContent mixed="true"> <xsd:extension base="tns:ModelEntity"> <xsd:sequence> <xsd:element name="mySaleItem" type="tns:SaleItem"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="SaleItem"> <xsd:complexContent mixed="true"> <xsd:extension base="tns:ModelEntity"> <xsd:sequence> <xsd:element name="fullDescription" type="xsd:string"/> <xsd:element name="photo" type="xsd:base64Binary"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="ModelEntity"> <xsd:sequence> </xsd:sequence> </xsd:complexType> <xsd:complexType name="RetailSaleItem"> <xsd:complexContent mixed="true"> <xsd:extension base="tns:SaleItem"> <xsd:sequence> <xsd:element name="price" type="xsd:decimal"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="TenderSaleItem"> <xsd:complexContent mixed="true"> <xsd:extension base="tns:SaleItem"> <xsd:sequence> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="Company"> <xsd:complexContent mixed="true"> <xsd:extension base="tns:AddressableEntity"> <xsd:sequence> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="AddressableEntity"> <xsd:complexContent mixed="true"> <xsd:extension base="tns:ModelEntity"> <xsd:sequence> <xsd:element name="address1" type="xsd:string"/> <xsd:element name="address2" type="xsd:string"/> <xsd:element name="address3" type="xsd:string"/> <xsd:element name="email" type="xsd:string"/> <xsd:element name="fax" type="xsd:string"/> <xsd:element name="name" type="xsd:string"/> <xsd:element name="phone" type="xsd:string"/> <xsd:element name="webSite" type="xsd:string"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="ArrayOfString"> <xsd:sequence> <xsd:element minOccurs="0" maxOccurs="unbounded" name="String" type="xsd:string" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ArrayOfClient"> <xsd:sequence> <xsd:element minOccurs="0" maxOccurs="unbounded" name="Client" type="tns:Client" /> </xsd:sequence> </xsd:complexType> <xsd:element name="JadeSessionHeader" type="tns:JadeSessionHeader"/> <xsd:complexType name="JadeSessionHeader"> <xsd:sequence> <xsd:element name="sessionId" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:schema> </types> <message name="getClientSoapIn"> <part name="inputParameters" element="tns:getClient"/> </message> <message name="getClientSoapOut"> <part name="return" element="tns:getClientResponse"/> </message> <message name="getClientJadeSessionHeader"> <part name="sessionId" element="tns:JadeSessionHeader"/> </message> <message name="getClientNamesSoapIn"> <part name="inputParameters" element="tns:getClientNames"/> </message> <message name="getClientNamesSoapOut"> <part name="return" element="tns:getClientNamesResponse"/> </message> <message name="getClientNamesJadeSessionHeader"> <part name="sessionId" element="tns:JadeSessionHeader"/> </message> <message name="getClientsSoapIn"> <part name="inputParameters" element="tns:getClients"/> </message> <message name="getClientsSoapOut"> <part name="return" element="tns:getClientsResponse"/> </message> <message name="getClientsJadeSessionHeader"> <part name="sessionId" element="tns:JadeSessionHeader"/> </message> <message name="updateClientSoapIn"> <part name="inputParameters" element="tns:updateClient"/> </message> <message name="updateClientSoapOut"> <part name="return" element="tns:updateClientResponse"/> </message> <message name="updateClientJadeSessionHeader"> <part name="sessionId" element="tns:JadeSessionHeader"/> </message> <portType name="ErewhonInvestmentsServiceSoap"> <operation name="getClient"> <input message="tns:getClientSoapIn" /> <output message="tns:getClientSoapOut" /> </operation> <operation name="getClientNames"> <input message="tns:getClientNamesSoapIn" /> <output message="tns:getClientNamesSoapOut" /> </operation> <operation name="getClients"> <input message="tns:getClientsSoapIn" /> <output message="tns:getClientsSoapOut" /> </operation> <operation name="updateClient"> <input message="tns:updateClientSoapIn" /> <output message="tns:updateClientSoapOut" /> </operation> </portType> <binding name="ErewhonInvestmentsServiceSoap" type="tns:ErewhonInvestmentsServiceSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <operation name="getClient"> <soap:operation soapAction="urn:JadeWebServices/WebShop/22/07/03/getClient" style="document"/> <input> <soap:body use="literal" /> <soap:header use="literal" message="tns:getClientJadeSessionHeader" part="sessionId"/> </input> <output> <soap:body use="literal" /> <soap:header use="literal" message="tns:getClientJadeSessionHeader" part="sessionId"/> </output> </operation> <operation name="getClientNames"> <soap:operation soapAction="urn:JadeWebServices/WebShop/22/07/03/getClientNames" style="document"/> <input> <soap:body use="literal" /> <soap:header use="literal" message="tns:getClientNamesJadeSessionHeader" part="sessionId"/> </input> <output> <soap:body use="literal" /> <soap:header use="literal" message="tns:getClientNamesJadeSessionHeader" part="sessionId"/> </output> </operation> <operation name="getClients"> <soap:operation soapAction="urn:JadeWebServices/WebShop/22/07/03/getClients" style="document"/> <input> <soap:body use="literal" /> <soap:header use="literal" message="tns:getClientsJadeSessionHeader" part="sessionId"/> </input> <output> <soap:body use="literal" /> <soap:header use="literal" message="tns:getClientsJadeSessionHeader" part="sessionId"/> </output> </operation> <operation name="updateClient"> <soap:operation soapAction="urn:JadeWebServices/WebShop/22/07/03/updateClient" style="document"/> <input> <soap:body use="literal" /> <soap:header use="literal" message="tns:updateClientJadeSessionHeader" part="sessionId"/> </input> <output> <soap:body use="literal" /> <soap:header use="literal" message="tns:updateClientJadeSessionHeader" part="sessionId"/> </output> </operation> </binding> <service name="ErewhonInvestmentsService"> <port name="ErewhonInvestmentsServiceSoap" binding="tns:ErewhonInvestmentsServiceSoap"> <soap:address location="http://cnwcrs1a/jade/jadehttp.dll?WebShop &serviceName=ErewhonInvestmentsService" /> </port> </service> </definitions>