Context
You can create service consumers locally in the back-end system using the ABAP internal modeling functions. These modeling functions are similar to those of the Enterprise Services Repository. For more information, see the documentation on modeling services in Enterprise Services Repository in the function-oriented view of the application help for SAP NetWeaver on the SAP Help Portal at http://help.sap.com
.
Procedure
- Ensure that your namespace is assigned to the back-end.
In transaction SPXNGENAPPL, you can check if your namespace has been assigned to the back-end repository. If not, add it to this list and assign it to the generation source Backend Metadata Repository.
- In Object Navigator (transaction code SE80), right-click a package and choose Create and then Enterprise Service.
An Enterprise Services Wizard is started that guides you through the creation of the object.
Alternatively, you can start this wizard from the Proxy Editor (transaction code SPROXY). Right-click on Enterprise Services or any node underneath this and choose Create. Note that the wizard is context-sensitive and will offer you the appropriate options to choose from. For example, if you open it from the Enterprise Services node, you can create any proxy object. If you open it from a subnode, only the proxy objects of this subnode are offered in the wizard. If you start the wizard from here, you have to choose Backend as the generation source.
- Select Service Consumer.
- Select ABAP back-end as the generation source for the service consumer.
For Objects which could be generated from different generation sources (back-end, Enterprise Services Repository, or external WSDL), the wizard provides a selection screen where the generation source has to be specified.
- Specify a name and a namespace.
The external name that you define in this step is the one that is exposed to non-ABAP applications that consume or provide the Web service. If your namespace has not been assigned to the back-end repository yet, you get an error message. Assign the namespace as described in step 1 above.
- Specify an ABAP package, a transport request, and (optionally) a prefix.
Either choose a transportable package or select Local Object to assign this object to your $TMP package. If you enter a package, select a request from your transport system. Prefixes can be used to distinguish proxy objects from others.
- Finish the wizard.
The proxy object is created and opened in the proxy editor. On the Properties tab, an empty class is displayed that you can implement as soon as the consumer is activated.
- On the internal or external view tab, add operations to your service consumer by right-clicking the service consumer node.
- On the internal or external view tab, right-click an operation to add message types.
You can either add an existing message type or create a new type from here. Choose the appropriate action from the context menu of the operation. If you create a new type, the Enterprise Services Wizard is started and guides you through the creation process. You can also drag and drop message types the Enterprise Service Browser tree (transaction code SPROXY).
- On the internal or external view tab, add datatypes to the message types by right-clicking a message type.
You can either add existing datatypes or create a new type from here. Choose the appropriate action from the context menu. If you create a new one, the enterprise services wizard is started and guides you through the creation process. You can also drag and drop datatypes from the Enterprise Service Browser tree (transaction code SPROXY).
- Save the service consumer and activate it.
Results
The service consumer has been created. You can now implement the new class.