Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 TIBCO ActiveMatrix BusinessWorks BPEL Extension Tutorial : WSDL Files in the Tutorial

WSDL Files in the Tutorial
The tutorial involves a broker service and three potential third-party services. Each service requires a WSDL file that contains the interface and schemas of the service.
Mortgage Broker WSDL
The BrokerWSDL file of the mortgage broker service is stored in the tutorial/MortgageBroker folder of the project. The following is the WSDL code for this service:
 
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://xmlns.example.com/BrokerWSDL" xmlns:ns="http://www.tibco.com/schemas/Untitled/MortgageBroker/Schema.xsd" targetNamespace="http://xmlns.example.com/BrokerWSDL">
   <import namespace=
      "http://www.tibco.com/schemas/Untitled/MortgageBroker/
       Schema.xsd" location="../Metadata/LoanSchema.xsd"/>
   <message name="MessageIn">
      <part name="loanRequest" element="ns:LoanRequest"/>
   </message>
   <message name="MessageOut">
      <part name="loanReply" element="ns:LoanReply"/>
   </message>
   <message name="MessageFault">
      <part name="fault" element="ns:Error"/>
   </message>
   <portType name="BrokerPT">
      <operation name="requestLoanOperation">
         <input message="tns:MessageIn"/>
         <output message="tns:MessageOut"/>
         <fault name="fault1" message="tns:MessageFault"/>
      </operation>
   </portType>
</definitions>
The mortgage broker WSDL contains one port type, BrokerPT. The BrokerPT port type contains one operation, requestLoanOperation. This operation has an input, output, and fault message.
Partner WSDLs
The mortgage broker service will call one of three partner third-party services from Bank_A, Bank_B, or Bank_C. Each of these third-party services implements the same abstract interface. Because the third-party services have agreed to implement the same interface, the mortgage broker service can switch between the third-party services without changing the implementation of the mortgage broker service.
The abstract interface used by the third-party services is contained in the tutorial/Metadata folder of the project. The Metadata folder contains the BankWSDLAbstract WSDL file and the LoanSchema XSD referenced by the WSDL. The following is the BankWSDLAbstract WSDL file:
 
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns="http://www.tibco.com/schemas/Untitled/MortgageBroker/Schema.xsd" xmlns:tns="http://xmlns.example.com/BankWSDL" targetNamespace="http://xmlns.example.com/BankWSDL">
   <documentation>Common service interface to request for a
      loan from a bank</documentation>
   <import namespace=
      "http://www.tibco.com/schemas/Untitled/MortgageBroker/
      Schema.xsd" location="LoanSchema.xsd"/>
   <message name="MessageIn">
      <part name="loanRequest" element="ns:BrokerLoanRequest"/>
   </message>
   <message name="MessageOut">
      <part name="loanReply" element="ns:LoanReply"/>
   </message>
   <message name="MessageFault">
      <part name="fault" element="ns:Error"/>
   </message>
   <portType name="BankPT">
      <operation name="loanApprovalOperation">
         <input message="tns:MessageIn"/>
         <output message="tns:MessageOut"/>
         <fault name="fault1" message="tns:MessageFault"/>
      </operation>
   </portType>
</definitions>
The BankWSDLAbstract contains one port type, BankPT. The BankPT port type contains one operation, loanApprovalOperation. This operation has an input, output, and fault message. See the LoanSchema.xsd file in the Metadata folder of the project for a description of the structure of the BrokerLoanRequest, LoanReply, and Error messages.
Each third-party service publishes a concrete WSDL file with the bindings to the endpoint where the service can be invoked. Each concrete WSDL file references the BankWSDLAbstract WSDL. The mortgage broker service stores the third-party partner service concrete WSDL files in the tutorial/MortgageBroker/PartnerWSDLs folder of the project. For example, the following is the concrete WSDL for the Bank_A service:
 
<?xml version = "1.0" encoding = "UTF-8"?>
 
<!--Created by TIBCO WSDL-->
<wsdl:definitions targetNamespace = "http://xmlns.example.com/Bank_A" xmlns:ns0 = "http://xmlns.example.com/BankWSDL" xmlns:soap = "http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns = "http://xmlns.example.com/Bank_A" xmlns:wsdl = "http://schemas.xmlsoap.org/wsdl/">
   <wsdl:import location = "../../Metadata/BankWSDLAbstract.wsdl" namespace = "http://xmlns.example.com/BankWSDL"/>
   <wsdl:types/>
   <wsdl:service name = "Bank_A_Service">
      <wsdl:port binding = "tns:BankPTEndpoint2Binding" name = "BankPTEndpoint2">
         <soap:address location = "http://localhost:9091/ExternalServices/Bank_A/Bank_A_Service.serviceagent/BankPTEndpoint2"/>
      </wsdl:port>
   </wsdl:service>
   <wsdl:binding name = "BankPTEndpoint2Binding" type = "ns0:BankPT">
      <soap:binding style = "document" transport = "http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name = "loanApprovalOperation">
         <soap:operation soapAction = "/ExternalServices/Bank_A/Bank_A_Service.serviceagent/BankPTEndpoint2/loanApprovalOperation" style = "document"/>
         <wsdl:input>
            <soap:body parts = "loanRequest" use = "literal"/>
         </wsdl:input>
         <wsdl:output>
            <soap:body parts = "loanReply" use = "literal"/>
         </wsdl:output>
         <wsdl:fault name = "fault1">
            <soap:fault name = "fault1" use = "literal"/>
         </wsdl:fault>
      </wsdl:operation>
   </wsdl:binding>
</wsdl:definitions>
 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved