25
Web Services Conversation Language (WSCL) Joy Lin November 18 2003

Web Services Conversation Language (WSCL) Joy Lin November 18 2003

  • View
    219

  • Download
    2

Embed Size (px)

Citation preview

Web Services Conversation Language(WSCL)

Joy Lin

November 18 2003

Contents

• Introduction

• Elements of a WSCL specification - Document types - Interactions - Transitions - Conversations

• Example

What is WSCL?

• Web Services Conversation Language.

• WSCL conversation definitions are themselves XML documents.

• Specifies the XML documents being exchanged, and the allowed sequencing of these document exchanges.

• WSCL and WSDL are highly complimentary – WSDL specifies how to send messages to a service and WSCL specifies the order in which such message can be sent.

Elements of a WSCL Specification

There are four main elements of a WSCL specification

• Document type descriptions

• Interactions

• Transitions

• Conversations

Document type descriptions

• Specify the types (schemas) of XML documents the service can accept and transmit in the course of a conversation.

• The document schemas are separate XML documents referenced by their URL in the XMLDocumemtType elements of the conversation specification

• InboundXMLDocument

• OutboundXMLDocument

Example

• hrefSchema - refers to the schema to which the documents corresponds.

• id - can be used within the rest of the conversation definition.

• Example : An input document that conforms to a purchase order schema defined in PurchasedOrderRQ.xsd.

<InboundXMLDocument hrefSchema=“http://foo.org/PurchasePrderRQ.xsd” id=“PurchaseOrderRQ”</InboundXMLDocument>

Interactions• An interaction is an exchange of documents between a service

and its client.

• WSCL only models business level interactions. It only specifies which business level documents are exchanged and does not model how this exchange is carried out by lower-level messaging protocols.

One-Way Interactions• Send – the service sends out an outbound document.

• Receive – the service receives an inbound document.

Interactions

Two-Way Interactions• SendReceive – the service sends out an outbound documen

t and then expects to receive an inbound document in reply.

• ReceiveSend – the service receives an inbound document and then sends out an outbound document.

• Empty – does not contain any documents exchanged, but is used only for modeling the start and end of a conversation.

Example: One-Way Interactions

• One-Way interactions represent a single one-way message being sent or received by a participant.

• This example represents a Receive interaction that receives a login document.

<Interaction interactionType="Receive" id="LoginRegInput"> <InboundXMLDocument id="LoginRequestData" hrefSchema=http://foo.org/LoginRequestData.xsd> </InboundXMLDocument> </Interaction>

Example: Two-Way Interactions

• A SendReceive example: Each SendReceive interaction is the logical unit of sending a request and then receiving a response. The interaction is not complete until the response has been exchanged.

<Interaction interactionType="SendReceive" id="Payment"> <OutboundXMLDocument id="Invoice" hrefSchema="http://foo.org/InvoiceRS.xsd"> </OutboundXMLDocument> <InboundXMLDocument id="Payment“ hrefSchema="http://foo.org/Payment.xsd"> </InboundXMLDocument> </Interaction>

Example: Two-Way Interactions• This example shows a Purchase interaction that specifies two

additional outbound document types for the case of invalid payment and out of stock.

<Interaction interactionType="ReceiveSend" id="Purchase" > <InboundXMLDocument id="PurchaseOrderRQ" hrefSchema="http://conv123.org/PurchaseOrderRQ.xsd " > </InboundXMLDocument> <OutboundXMLDocument id="PurchaseOrderAcceptedRS" hrefSchema="http://conv123.org/PurchaseOrderAcceptedRS.xsd" > </OutboundXMLDocument> <OutboundXMLDocument id="InvalidPaymentRS" hrefSchema="http://conv123.org/InvalidPaymentRS.xsd" > </OutboundXMLDocument> <OutboundXMLDocument id="OutOfStockRS" hrefSchema="http://conv123.org/OutOfStockRS.xsd" > </OutboundXMLDocument> </Interaction>

Transitions

• Transitions specify the ordering relationships between interactions.

• SourceInteracion – precede the DestinationInteraction when the conversation is executed.

• DestinationInteraction – follow the SourceInteraction when the conversation is executed.

• SourceInteractionCondition – an additional condition for the transition. (Optionally)

Example

<Transition> <SourceInteraction href="Login"/> <DestinationInteraction href="Login"/> <SourceInteractionCondition href="InvalidLoginRS"/> </Transition>

<Transition> <SourceInteraction href="Login"/> <DestinationInteraction href="Purchase"/> <SourceInteractionCondition href="ValidLoginRS"/> </Transition>

Initial and Final Interactions• Part of defining the possible ordering of interactions is the

specification of the first and last interactions of a conversation.

• initialInteraction references the ID of the first interaction to be executed in the conversation.

• finalInteraction references the ID of the last interaction to be executed in the conversation.

Example<Conversation name=“ExampleConversation” initialInteraction = “Login” finalInteraction = “Purchase”>

Initial and Final Interactions

• There might be more than one interaction with which the conversation can start or end.

• To specify several possible start and end interactions, interactions of type Empty is used.

• An interaction type Empty is an interaction in which no documents are exchanged. Currently, the only situation in which Empty interactions can be used in a conversation definition is when several possible final or initial interactions need to be modeled.

Conversation

• Conversations list all the interactions and transitions that make up the conversation.

• A conversation contains additional information about the conversation, including the conversation’s name and the interaction the conversation can start with and end with.

The Conversation element contains the following two sub elements• ConversationInteractions list all Interaction elements.

• ConversationTransitions lists all Transition elements.

Conversation

The Conversation element contains the following attributes:• initialInteraction and finalInteraction

• name – the name of the conversation

• version(optional) – the version of the conversation.

• targetNamespace(optional) – the namespace of this conversation as it should be used when elements of this conversation are referenced in other XML documents.

• hrefSchema(optional) – the URL of the file containing this conversation definition.

• description(optional)

Example<?xml version="1.0" encoding="UTF-8"?><Conversation name=“simpleConversation" version="1.01“ xmlns="http://www.w3.org/2002/02/wscl10" initialInteraction="Start" finalInteraction="End“ description="Conversation for a Store Front Service"

<ConversationInteractions> list of all the interactions </ConversationInteractions>

<ConversationTransitions> list of all the transitions </ConversationTransitions>

</Conversation>

Example – purchase conversation definition

loginReceiveSend

PurchaseReceiveSend

shippingSend

ValidLoginRS

PurchaseAcceptRS

InvalidLoginRS

OutOfStockRS

InvalidPaymentRS

Example – purchase conversation definition

<Conversation name=“purchaseConversation"

xmlns="http://www.w3.org/2002/02/wscl10"

initialInteraction="Start"

finalInteraction="End" >

<ConversationInteractions>

<Interaction interactionType="ReceiveSend" id="Login">

<InboundXMLDocument hrefSchema="http://conv123.org/LoginRQ.xsd"

id="LoginRQ"/>

<OutboundXMLDocument hrefSchema="http://conv123.org/ValidLoginRS.xsd“

id="ValidLoginRS"/>

<OutboundXMLDocument hrefSchema="http://conv123.org/InvalidLoginRS.xsd"

id="InvalidLoginRS" />

</Interaction>

Example – purchase conversation definition

<Interaction interactionType="ReceiveSend" id="Purchase" > <InboundXMLDocument hrefSchema="http://conv123.org/PurchaseOrderRQ.xsd" id="PurchaseOrderRQ" /> <OutboundXMLDocument id="PurchaseOrderAcceptedRS" hrefSchema="http://conv123.org/PurchaseOrderAcceptedRS.xsd" /> <OutboundXMLDocument id="InvalidPaymentRS“ hrefSchema="http://conv123.org/InvalidPaymentRS.xsd" /> <OutboundXMLDocument id="OutOfStockRS" hrefSchema="http://conv123.org/OutOfStockRS.xsd" /></Interaction> <Interaction interactionType="Send" id="Shipping" > <OutboundXMLDocument id="ShippingInformation" hrefSchema="http://conv123.org/ShippingInformation.xsd" /> </Interaction> <Interaction interactionType="Empty" id="Start" /> <Interaction interactionType="Empty" id="End" /> </ConversationInteractions>

Example – purchase conversation definition

<ConversationTransitions> <Transition> <SourceInteraction href="Start"/> <DestinationInteraction href="Login"/> </Transition> <Transition> <SourceInteraction href="Login"/> <DestinationInteraction href="Purchase"/> <SourceInteractionCondition href="ValidLoginRS"/> </Transition> <Transition> <SourceInteraction href="Login"/> <DestinationInteraction href="Login"/> <SourceInteractionCondition href="InvalidLoginRS"/> </Transition>

Example – purchase conversation definition

<Transition> <SourceInteraction href="Purchase"/> <DestinationInteraction href="Shipping"/> <SourceInteractionCondition href="PurchaseAcceptedRS"/></Transition><Transition> <SourceInteraction href="Shipping"/> <DestinationInteraction href="End"/> </Transition> <Transition> <SourceInteraction href="Purchase"/> <DestinationInteraction href="End"/> <SourceInteractionCondition href="InvalidPaymentRS"/> </Transition>

Example – purchase conversation definition

<Transition>

<SourceInteraction href="Purchase"/>

<DestinationInteraction href="End"/>

<SourceInteractionCondition href="OutOfStockRS"/>

</Transition>

</ConversationTransitions>

</Conversation>