Web Service Example - Defining the Web Service Profile
Use the following instructions to create a WS profile:
Click the
button in the upper left part of the Desktop window, and then select from the menu.The WS profile configuration dialog opens.
In the Configuration tab, click on the button, and select the WSDL file you want to import.
You can now see the file contents on the View WSDL Contents tab.
At the bottom of the Configuration tab, select the in the Service Port Definition drop-down list.
In the WS profile, click on the menu and select the option.
In the Save as dialog box select a folder and type Example in the Name text box.
Click
.
Check the WS directory in the APL Code Editor and see the data structure that your WS profile just generated. The APL Code Editor is opened by clicking on the button in Desktop, and then selecting from the menu.
Right-click on the text pad and select the
option.The UDR Internal Format Browser opens.
Scroll down to the WS directory and expand it to see where data is stored once you save your WS profile.
The WSDL File
<?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://example.com/webservice/charger" xmlns:x1="http://example.com/webservice/charger/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Charger" targetNamespace="http://example.com/webservice/charger"> <wsdl:types> <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://example.com/webservice/charger/types" elementFormDefault="qualified" targetNamespace="http://example.com/webservice/charger/types"> <complexType name="ChargingEvent"> <sequence> <element name="id" type="string"/> <element name="amount" type="float"/> </sequence> </complexType> <element name="Charge"> <complexType> <sequence> <element name="serviceType" type="string"/> <element name="chargingEvent" type="tns:ChargingEvent"/> </sequence> </complexType> </element> <element name="ChargeResult"> <complexType> <sequence> <element name="success" type="boolean"/> <element name="message" type="string"/> </sequence> </complexType> </element> <element name="FaultDetail"> <complexType> <sequence> <element name="reason" type="int"/> <element name="message" type="string"/> </sequence> </complexType> </element> </schema> </wsdl:types> <wsdl:message name="ChargingRequest"> <wsdl:part name="in" element="x1:Charge" /> </wsdl:message> <wsdl:message name="ChargingRespone"> <wsdl:part name="in" element="x1:ChargeResult" /> </wsdl:message> <wsdl:message name="chargeFault"> <wsdl:part name="faultDetail" element="x1:FaultDetail"/> </wsdl:message> <wsdl:portType name="Charger"> <wsdl:operation name="charge"> <wsdl:input name="chargingRequest" message="tns:ChargingRequest"/> <wsdl:output name="chargingResponse" message="tns:ChargingRespone"/> <wsdl:fault name="chargingFault" message="tns:chargeFault"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="Charger_SOAPBinding" type="tns:Charger"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="charge"> <soap:operation soapAction="" style="document"/> <wsdl:input name="chargingRequest"> <soap:body use="literal"/> </wsdl:input> <wsdl:output name="chargingResponse"> <soap:body use="literal"/> </wsdl:output> <wsdl:fault name="chargingFault"> <soap:fault name="chargingFault" use="literal"/> </wsdl:fault> </wsdl:operation> </wsdl:binding> <wsdl:service name="Charger_Service"> <wsdl:port binding="tns:Charger_SOAPBinding" name="Charger"> <soap:address location="http://localhost:8080/charge"/> </wsdl:port> </wsdl:service> </wsdl:definitions>