Header Ads

Generating a Consumer Proxy


Generating a Consumer Proxy Locate this document in the navigation structure


ABAP consumer proxies are used in an application to call (consume) a Web service.
A consumer proxy comprises an ABAP object class, and is based on an outbound service interface.
Consumer proxies need only to be generated and used by an application — whereas provider proxies need to be generated and implemented in the ABAP back-end system, in which the service will be provided.

Prerequisites

ABAP consumer proxies can be generated for objects modeled in the Enterprise Services Repository (ES Repository) or for external services.
ABAP consumer proxies can be generated in any ABAP system, as only the WSDL description is needed. The objects do not first need to be modeled in theEnterprise Services Repository (ES Repository). If the objects for a consumer proxy are modeled in the ES Repository, the corresponding ES Repository object is an outbound service interface.
A consumer proxy can be generated if any of the following prerequisites are met:
  • The corresponding outbound service interface is available in the ES Repository.
  • A WSDL document for a previously generated ABAP provider proxy exists.
  • A WSDL document from an external service provider is available and its URL is known or is available as a file.

Procedure

How you generate a consumer proxy depends on whether the consumer is in the Enterprise Services Repository, or whether a WSDL document is available — either an external WSDL or a WSDL for a previously generated ABAP provider proxy.
Generating a Consumer Proxy — If the Model is in the ES Repository
  1. Start the Enterprise Services Repository Browser (transaction code SPROXY).
  2. Locate the software component version and namespace.
  3. Expand the Service Interfaces node.
  4. Select the outbound service interface.
  5. Open the context menu and choose Create.
    The system prompts you to specify a prefix and a transport request.
  6. Confirm.
    The consumer proxy is generated. During generation, all the related data types and message types in the same namespace are also generated.
    The Configuration tab displays the default properties, which are extracted from the WSDL document. These properties determine the settings of a runtime configuration, which will be generated when the proxy is used.
  7. Save.
  8. Activate.
    When the consumer proxy is activated, the proxy class and the related structures and methods are automatically created and activated.
Generating a Consumer Proxy — If the Model is Described by an External WSDL Document
  1. Start the Repository Browser (transaction code SE80).
  2. Open the package for which you want to generate the consumer proxy.
  3. From the context menu for the package, choose   Create   Enterprise Service  .
  4. When you are prompted, select Service Consumer.
  5. Continue.
  6. Select the source of the WSDL document.
    This can be a URL or a local file.
  7. Continue.
  8. Specify a URL or a file name.
  9. Specify a package, a prefix, and a transport request.
  10. Continue.
    The consumer proxy is generated. During generation, proxies for all the related data types and message types are generated.
    The Configuration tab displays the default properties, which are extracted from the WSDL document. These properties determine the settings of a runtime configuration, which will be generated when the proxy is used.
  11. Save.
  12. Activate.
    When the consumer proxy is activated, the proxy class and the related structures and methods are automatically created and activated.
Powered by Blogger.