14.2 Implementation Approaches
There are two main approaches to follow when dealing with proxies: outside-in and inside-out. These approaches will be explored in the next sections.
14.2.1 Outside-In Approach
In this approach, you want SAP PO to act as a service provider to provide a functionality or service that doesn’t yet exist. You start by creating the necessary structure of the service interface in the ES Repository of SAP PO. Typically, this will include artifacts such as data types, message types, and service interfaces.
You can then generate a Java proxy based on the WSDL of a service interface. Note that the service interface to be used will need to be of the inbound type. The proxy generated with this method is also generally referred to as a server proxy because the proxy acts as a server—by providing a service. Other names popularly used for it include inbound proxy and receiver proxy.
You might be wondering why such an approach is needed, given that a service can be provided in SAP PO using the normal ICO or iFlow approach. The difference is that ICOs or iFlows generally act as mediators or bridges to call services exposed by other provider systems (such as SAP ERP, SAP Customer Relationship Management [SAP CRM], legacy, etc.), whereas the server proxies make SAP PO act as the provider system (see Figure 14.1).
14.2.2 Inside-Out Approach
As depicted in Figure 14.2, the inside-out approach is used to consume a web service that already exists in another application. The WSDLs and XML Schema Definitions (XSDs) of the service to be called will need to be available in the ES Repository of SAP PO.
The outbound service interface available in the ES Repository can then be used to generate a client Java proxy to consume the external service. The generated proxy is often referred to as the client proxy, with the word “client” referring to the fact that the proxy consumes a service and therefore acts as a client. It’s also referred to as a consumer proxy, outbound proxy, or sender proxy.
It’s important to distinguish between a deployable proxy and a standalone proxy. A deployable proxy is a client proxy that can be deployed in SAP NetWeaver AS Java. It can therefore be consumed by an EJB and a servlet that run on the same Java application server. A standalone proxy, on the other hand, runs on the application side, away from the server. It’s mostly used for test purposes in SAP NetWeaver Developer Studio. In this chapter, we’ll only address the deployable proxy.