350 likes | 581 Views
Understanding the WSDL. Overview. When you complete this lesson you should be able to:. View a WSDL document from a Web browser Generate the 4GL WSDL documentation from a WSDL document Describe how to use the 4GL WSDL documentation Describe the sections of a WSDL document.
E N D
Overview When you complete this lesson you should be able to: • View a WSDL document from a Web browser • Generate the 4GL WSDL documentation from a WSDL document • Describe how to use the 4GL WSDL documentation • Describe the sections of a WSDL document
Sections of the WSDL document <wsdl:definitions> <wsdl:documentation> <wsdl:types> <wsdl:message> <wsdl:message> . . . <wsdl:portType> <wsdl:portType> . . . <wsdl:binding> <wsdl:binding> . . . <wsdl:service> <wsdl:service> . . . </wsdl:definitions>
Index for navigating the WSDL documentation Start here
portType documentation PortType (persistent procedure) <portType name> Summary Connection information Operations (internal procedures) Connection details CONNECT method parameters Example Operation (internal procedure) detail Operation A Operation B Operation C
binding name = Bind-A type = PT1 … RPC/Encoded portType name = PT1 operation aa operation bb binding name = Bind-B type = PT1 … Document/Literal portType name = PT2 operation aa operation cc binding name = Bind-C type = PT2 … Document/Literal message message message Sections of the WSDL document service name = Service1 port name = SPort1-1 binding = Bind-A port name = SPort1-2 binding = Bind-B service name = Service2 port name = SPort2-1 binding = Bind-C types . . .
WSDL at http://localhost:8080/wsa/wsa1/wsdl? <wsdl:definitions name="NewCoService" targetNamespace="urn:OpenEdgeServices:NewCoService" xmlns:tns="urn:OpenEdgeServices:NewCoService" xmlns:S2="urn:OpenEdgeServices:NewCoService:NewCoService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:S1="http://localhost:8080/wsa/wsa1" xmlns="http://schemas.xmlsoap.org/wsdl/"> . . . <wsdl:service name="NewCoServiceService"> <wsdl:port name="NewCoServiceJapan" binding="tns:NewCoServiceObjSOAPBinding"> <documentation>This service provides its users with the capability of placing Orders with NewCo and receiving Invoices.</documentation> <soap:address location="http://www.newco.com/Japan/wsa/wsa1"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
If WSDL and Web Service locations differ WSDL: port address location = B 1c www.newco.com/WS Web server A providing WSDL 2 • Web service consumer steps: • Connect to Web service • Get operation information • Prepare to invoke operation • cMyOrder = . . . • Invoke operation • Process result of operation • iNum = iInvoiceNum. • Disconnect from Web service • SERVER-DISCONNECT(). SERVER-CONNECT(-WSDL A) 1a NewCoService.wsdl 1b Web server B providing services RUN SendOrders(cMyOrder) 4a iInvoiceNum 4b www.newco.com/Japan 4GL client (consumer)
portType information in WSDL <wsdl:definitions name="NewCoService“ targetNamespace="urn:OpenEdgeServices:NewCoService" xmlns:tns="urn:OpenEdgeServices:NewCoService" . . . <wsdl:portType name="NewCoServiceObj“> < wsdl: operation name=“SendMultiOrders” . . . < wsdl: operation name=“GetInvoice” . . . . . . </wsd:portType>
Operation definitions in WSDL <wsdl:definitions name="NewCoService" . . . <wsdl:portType name="NewCoServiceObj"> <wsdl:operation name="SendMultiOrders" parameterOrder=“cDocument cID iNumDocs iInvoiceNum"> <wsdl:input message="tns:NewCoService_SendMultiOrders"/> <wsdl:output message="tns:NewCoService_SendMultiOrdersResponse"/> <wsdl:fault name="NewCoServiceFault" message="tns:FaultDetailMessage"/> </wsdl:operation> </wsdl:portType> </wsdl:definitions>
Message definitions in WSDL <wsdl:definitions name="NewCoService" . . . <wsdl:message name="NewCoService_SendMultiOrders"> <wsdl:part name=“cDocument" type="xsd:string"/> <wsdl:part name="cID" type="xsd:string"/> <wsdl:part name="iNumDocs" type="xsd:int"/> </wsdl:message> <wsdl:message name="NewCoService_SendMultiOrdersResponse"> <wsdl:part name="iInvoiceNum" type="xsd:int"/> </wsdl:message> <wsdl:message name="FaultDetailMessage"> <wsdl:part name="FaultDetail" type="S1:FaultDetail"/> </wsdl:message> . . . </wsdl:definitions>
SOAP messaging protocol Transport Protocol SOAP format Message style Encoding style RPC or Document? SOAP or WSDL defined? HTTP
SOAP messaging definitions in WSDL <wsdl:definitions name="NewCoService" <wsdl:binding name="NewCoServiceObj" type="tns:NewCoServiceObj"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="CancelOrders"> <soap:operation soapAction="urn:OpenEdgeServices:NewCoService" style="rpc"/> <wsdl:input> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:OpenEdgeServices:NewCoService:NewCoService"/> </wsdl:input> <wsdl:output> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:OpenEdgeServices:NewCoService:NewCoService"/> </wsdl:output> <wsdl:fault name="NewCoServiceFault"> <soap:fault name="NewCoServiceFault" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/wsa/wsa1"/> </wsdl:fault> </wsdl:operation> </wsdl:binding> </wsdl:definitions>
binding name = Bind-A type = PT1 … RPC/Encoded portType name = PT1 operation aa operation bb binding name = Bind-B type = PT1 … Document/Literal portType name = PT2 operation aa operation cc binding name = Bind-C type = PT2 … Document/Literal message message message References in the WSDL document service name = Service1 port name = SPort1-1 binding = Bind-A port name = SPort1-2 binding = Bind-B service name = Service2 port name = SPort2-1 binding = Bind-C types . . .
Summary You should now be able to: • View a WSDL document from a Web browser • Generate the 4GL WSDL documentation from a WSDL document • Describe how to use the 4GL WSDL documentation • Describe the sections of a WSDL document