Mapping PortTypes to tModels

One of the most interesting aspect in the BizTalk Server 2004 UDDI Publishing Wizard is the process of map a PortType to an UDDI equivalent,

The PortType element in a BizTalk Server 2004 orchestration is very similar to the PortType element in WSDL. Following the OASIS Standard when we provide discovery information to a Web Service using UDDI the PortType element in WSDL is mapped to a PortType tModel and the OverviewDoc of this tModel reference to a WSDL address.

In BizTalk Server 2004 a PortType is an abstraction that has the common qualities of a set of Ports.  A PortType have a communication pattern that indicates if a PortType is follow the One-Way or Request-Response approach.  A PortType also have a set of operations which has messages operations; in the case off One-Way PortType all operation has one message operations in the other case all operations have a Request and a Response message operations. A message operation works with a message that belongs to a MessageType. In the same way of PortTypes MesssageTypes abstract the common aspects to a set of messages.  A PortType can be associated with a set of roles. Roles are collections of port types, and each role either uses a service (as a consumer) or implements a service (as a provider). A role link can include either a uses or implements role, or one of each. A uses role consumes the services provided by an implements role. When you define a role link with one or both of these roles, it is assumed that the complementary role is being fulfilled by the partner with whom you are linking. If a role uses a service, it sends a message to a party that implements a service; conversely, if a role implements a service, it receives a message.

Well until here we have seen some relevant aspects of PortTypes. Now let’s check how to map a BizTalk Server 2004 PortType to an UDDI tModel.

The process of representing discovery information of a PortType in UDDI may be the following:

  • For each relevant PortType a PortType tModel must be created (a relevant PortType is simply a PortType of the Ports of a BusinessService).
  • The name of the tModel is the name of the PortType which is unique per MessageBox DB.
  • The tModel have a reference to a categorization tModel indicating that the tModel is a BizTalk PortType.
  • The tModel have a reference to a categorization tModel indicating if the PortType follows the One-Way or Request-Response communication pattern.
  • The tModel have a reference to a categorization tModel referencing USED roles associated with the PortType.
  • The tModel have a reference to a categorization tModel referencing the IMPLEMENTED roles associated with the PortType.
  • For each PortType a WSDL file will be generated that contains the type, message and PortType sections.  That is, a WSDL without the binding and the service sections since the BusinessService are not necessarily tied to SOAP protocol. Using this WSDL file the application that consumes the BusinessService can explore all the relevant information to the Operations and MessageTypes. The generated WSDL file is very similar to the WSDL file that we obtain when export n orchestration to Web Service. 

 

BizTalk

UDDI

PortType

PortType tModel

PortType name

TModel name

Operations and MessageTypes

OverviewDoc: Location of a WSDL document

IMPLEMENTED Roles

KeyedReference in CategoryBag.with the value of the roles

USED Roles

KeyedReference in CategoryBag with the value of the roles

Communication Pattern

KeyedReference in CategoryBag with the value of the communication pattern.

Type

KeyedReference in CategoryBag indicating that this tModel represents a PortType.

Using this information the client applications can discover the communication pattern of a PortType, the roles that this PortType uses and implements and obtain a reference to a WSDL file that provides all the information to the PortType operations and the XML schema of the message that interact with the Port that belongs to the PortType.

Well in the orchestration used as example we have a PortType with the following structure.

 

<om:Element Type="PortType" OID="e1231583-469c-4d3b-ae4d-34a3193753aa" ParentLink="Module_PortType" LowerBound="12.1" HigherBound="19.1">
  <om:Property Name="Synchronous" Value="False" />
  <om:Property Name="TypeModifier" Value="Public" />
  <om:Property Name="ReportToAnalyst" Value="True" />
  <om:Property Name="Name" Value="In_PortType" />
  <om:Property Name="Signal" Value="True" />
  <om:Element Type="OperationDeclaration" OID="20750b13-caed-4b45-ab11-7ad78eca49e0"      ParentLink="PortType_OperationDeclaration" LowerBound="14.1" HigherBound="18.1">
      <om:Property Name="OperationType" Value="OneWay" />
      <om:Property Name="ReportToAnalyst" Value="True" />
      <om:Property Name="Name" Value="MainOp" />
      <om:Property Name="Signal" Value="True" />
      <om:Element Type="MessageRef" OID="cae1d3cf-3524-47f2-957d-f7f656a63b87"   ParentLink="OperationDeclaration_RequestMessageRef" LowerBound="16.13" HigherBound="16.22">
           <om:Property Name="Ref" Value="Lab1_SimpleSample.InMsgType" />
           <om:Property Name="ReportToAnalyst" Value="True" />
           <om:Property Name="Name" Value="Request" />
           <om:Property Name="Signal" Value="True" />
       </om:Element>
  </om:Element>
</om:Element>

When we export the orchestration to UDDI (Sample 1) a tModel for the PortType will be created with the following structure.

<?xml version="1.0" encoding="utf-8"?>
<tModelDetail xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" operator="UDDIRep" generic="2.0" truncated="false" xmlns="urn:uddi-org:api_v2">
   <tModel tModelKey="uuid:c811daba-7046-40c4-8601-2e7c419b01b5" operator="UDDIRep"                     authorizedName="LAURA\Administrator">
       <name>Lab1_SimpleSample.In_PortType</name>
       <description xml:lang="en" />
       <overviewDoc>
           <overviewURL>http://localhost/wsdls/Lab1_SimpleSample.In_PortTypeDesc.wsdl</overviewURL>
       </overviewDoc>
       <categoryBag>
          <keyedReference tModelKey="uuid:a035a07c-f362-44dd-8f95-e2b134bf43b4" keyName="OneWay   communication pattern" keyValue="OneWay" />
          <keyedReference tModelKey="uuid:ad941f90-207a-4a8b-a298-fafdb21f4780" keyName="Biztalk Port Types" keyValue="PortTypes" />
          <keyedReference tModelKey="uuid:779f5b2f-4553-49c4-bce8-1a001bfac0e6" keyName="" keyValue="uuid:cbe5def4-e786-4c40-9404-632dd2b6562b" />
         </categoryBag>
  </tModel>
</tModelDetail>

The Lab1_SimpleSample.In_PortTypeDesc.wsdl is a WSDL partial file showed below.

 <definitions xmlns:s1="http://Lab1_SimpleSample.InSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
  <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org">
    <s:import namespace="http://Lab1_SimpleSample.InSchema" />
    <s:element name="MainOp" nillable="true" type="s0:MainOp" />
    <s:complexType name="MainOp">
      <s:sequence>
         <s:element minOccurs="0" maxOccurs="unbounded" ref="s1:Fields" />
      </s:sequence>
    </s:complexType>
  </s:schema>
  <s:schema elementFormDefault="qualified" targetNamespace="http://Lab1_SimpleSample.InSchema">
    <s:element name="Fields" type="s:string" />
  </s:schema>
</types>
<message name="MainOpIN">
  <part name="parameters" element="s0:MainOp" />
</message>
<portType name="Lab1_SimpleSample.In_PortType">
  <operation name="MainOp">
    <input message="s0:MainOpIN" />
  </operation>
</portType>
</definitions>

No Comments