Listing 1: A serviceLink Relation

<slnk:serviceLinkType name="WidgetBuyerSellerLinkType"
xmlns:slnk="http://schemas.xmlsoap.org/ws/2002/07/service-link/">
<slnk:role name="WidgetSeller">
<slnk:portType name="WidgetSellerPortType"/>
</slnk:role>
<slnk:role name="WidgetBuyer">
<slnk:portType name="WidgetBuyerPortType"/>
</slnk:role>
</slnk:serviceLinkType>
<slnk:serviceLinkType name="WidgetEnquiryLinkType"
xmlns:slnk="http://schemas.xmlsoap.org/ws/2002/07/service-link/">
<slnk:role name="WidgetAuthority">
<slnk:portType name="WidgetEnquirerPortType"/>
</slnk:role>
</slnk:serviceLinkType>

Listing 2: Partner Declarations

<bpws:partners
xmlns:sl="http://widgets.example.org/serviceLinkTypes">
<bpws:partner name="customer"
serviceLinkType="sl:WidgetBuyerSellerLinkType"
myRole="WidgetSeller"
partnerRole="WidgetBuyer"/>
<bpws:partner name="enquirer"
serviceLinkType="sl:WidgetEnquiryLinkType"
myRole="WidgetAuthority" />
</bpws:partners>

Listing 3: Minimal ServiceReference declaration

<sref:serviceReference
xmlns:sref="http://schemas.xmlsoap.org/ws/2002/07/service-reference/"
xmlns:ws="http://widgets.example.org/ ">
<sref:service name="ws:WidgetService"/>
</sref:serviceReference>

Listing 4: Identifying Process/Object instances with ServiceReference

<sref:serviceReference
xmlns:sref="http://schemas.xmlsoap.org/ws/2002/07/service-reference/"
xmlns:ws="http://widgets.example.org/ ">
<sref:service name="ws:WidgetService"/>
<sref:referenceProperties>
<sref:property name="ws:existingCustomer">
Johnny.Widget@widget-u-like.com
</sref:property>
</sref:referenceProperties>
</sref:serviceReference>

Listing 5: Message property examples

<bpws:property name="invoice-number"
type="ins:InvoiceNumberType"/>
<bpws:property name="phone" type="xs:postiveInteger"/>
<bpws:property name="website" type="xs:anyURI"/>
<bpws:property name="email" type="ens:EmailAddressType"/>

Listing 6: Defining a propertyAlias

<bpws:propertyAlias propertyName="tns:InvoiceNumber" 
messageType="tns:PurchaseOrderMessage" part="invoice"
query="/invoice-number"/>

Listing 7: Declaring a container to hold channel addition messages

<bpws:containers>
<bpws:container name="AddChannelRequests"
messageType="co:AddChannelMessage"/>
<!-- Other containers ommitted for brevity -->
</bpws:containers>

Listing 8: Using containers to hold temporary variables

<bpws:container name="UpdateCounter">
<wsdl:message name="CounterMessage">
<wsdl:part name="counter" type="xs:int"/>
</wsdl:message>
</bpws:container>

Listing 9: An Asynchronous invoke activity

<bpws:invoke partner="CableOperator"
portType="co:ChannelManagementPortType"
operation="addChannel"
inputContainer="RequestedChannels"/>

Listing 10: A receive activity

<bpws:containers>
<bpws:container name="addChannelOrders"
messageType="co:AddChannelMessage"/>
</bpws:containers>
<bpws:receive partner="customer"
portType="co:ChannelManagementPortType"
operation="addChannel"
container="addChannelRequest">
<!-- Add a channel -->
</bpws:receive>

Listing 11: A reply activity

<bpws:reply partner="customer"
portType="co:ChannelManagementPortType"
operation="getSubscriptionStatus"
container="CustomerSubscriptionDetails"/>

Listing 12: A sequence activity

<bpws:sequence>
<!-- Book hotel -->
<bpws:invoke partner="Hotelier" ? />
<!-- Hire care -->
<bpws:invoke partner="CarRentalAgency" ? />
<!-- Book flight -->
<bpws:invoke partner="AirlineReservationDesk" ? />
</bpws:sequence>

Listing 13: The Canonical Form of flow Activities

<bpws:flow>
<!-- Book hotel -->
<bpws:invoke partner="Hotelier" ? />
<!-- Hire care -->
<bpws:invoke partner="CarRentalAgency" ? />
<!-- Book flight -->
<bpws:invoke partner="AirlineReservationDesk" ? />
</bpws:flow>

Listing 14: A scope activity

<bpws:scope containerAccessSerializable="no">
<bpws:faultHandlers>
<bpws:catch faultName="FlightFullFault" ? />
<bpws:catch faultName="UnknownFlightFault" ? />
<bpws:catch faultName="UnauthorizedPaymentFault" ? />
<bpws:catchAll>
<bpws:compensate/>
</bpws:catchAll>
</bpws:faultHandlers>
<!-- Booking activity -->
</bpws:scope>

Listing 15: A compensationHandler

<bpws:process>
<!-- Process definition omitted for brevity -->
<bpws:compensationHandler>
<!-- Application specific compensation -->
</bpws:compensationHandler>
</bpws:process>