It is sometimes necessary for the application to know the sequence ID before calling a proxy method, for example when assigning the sequence ID in another module or LUW. In this case, no proxy object must be instantiated. A persistent sequence is created. It returns a sequence ID that can be used later on.
data:
l_seq_manager type ref to if_seq_manager_ext_consumer,
l_seq_id type srt_seq_id.
l_seq_manager =
cl_soap_sequence_factory=>create_seq_mng_ext_consumer( ).
l_seq_id = l_seq_manager->create_persistent_sequence( ).
* persist the sequence ID or pass it to other modules
...
Use the REUSE_PERSISTENT_SEQUENCE method to use the sequence ID of the persistent sequence.
data:
l_sequ_prot type ref to if_wsprotocol_sequence,
l_sequence type ref to if_ws_persistent_sequence,
l_proxy type ref to co_my_proxy,
l_seq_id type srt_seq_id.
create object l_proxy.
l_sequ_prot ?= l_proxy->get_protocol( if_wsprotocol=>sequence ).
...
l_sequence = l_sequ_prot->reuse_persistent_sequence( l_seq_id ).
l_sequence->begin( ).
l_sequ_prot->set_client_sequence( l_sequence ).
l_proxy->m1( ).
l_proxy->m2( ).
l_sequence->end( ).
<<commit>>