Start of Content Area

Background documentation Exactly-Once-in-Order in an LUW  Locate the document in its SAP Library structure

If all methods that are to be performed 'exactly once in order' belong to a Web service, the sequence object can be created using the proxy object. The sequence object controls the correct order for processing proxy object instance methods. Reliable transmission of messages is connected to the performance of an LUW (refer also to the section: SAP LUW).

  data:

    l_sequ_prot type ref to if_wsprotocol_sequence,
    l_sequence  type ref to if_ws_client_sequence,
    l_proxy     type ref to co_my_proxy.

    create object l_proxy.
    l_sequ_prot ?= l_proxy->get_protocol( if_wsprotocol=>sequence ).
    l_sequence = l_sequ_prot->create_transient_sequence( ).
    l_sequence->begin( ).
      l_sequ_prot->set_client_sequence( l_sequence ).
      l_proxy->m1( ).
      l_proxy->m2( ).
    l_sequence->end( ).

  <<commit>>

EO and EOIO methods are called using a proxy object:

data: l_proxy type ref to co_my_proxy.

create object l_proxy.

l_proxy->m1( ).

<<commit>>

Note

In the following sections, <<commit>> stands for every type of call that triggers a COMMIT WORK. At the time of COMMIT WORK, all (EO and EOIO) methods that were called in an LUW are kept persistent and can be sent.

To implement Reliable Messaging, you must create a sequence on the client side. A sequence protocol that is called at the proxy object is required for this:

 

   m_seq_prot ?= proxy_object->get_protocol( if_wsprotocol=>sequence ).

 

To create the sequence, you have to call a method at the created protocol. Depending on whether the sequence is to be transient (usable once) or persistent (usable again), a different method is used. Transient sequences are completed at the end of an LUW.

 

   m_seq = m_seq_prot->create_transient_sequence( ).

   m_seq = m_seq_prot->create_persistent_sequence( ).

 

After successful generation of the sequence, the beginning of the sequence must be made known. This is done by calling the method begin( ).

    m_seq->begin( ).

 

Afterwards, the currently used sequence is made known to the sequence protocol through the method set_client_sequence( ) since only one sequence can be used at any one time.

 

    m_seq_prot->set_client_sequence( m_seq ).

 

All Web service calls that are in this sequence are processed at the provider in the correct sequence. The order of sequence between sequences is not taken into consideration.

As soon as all calls have been sent, the sequence is closed again.

 

    m_seq->end( ).

 

 

 

 

 

End of Content Area