BIT450 BIT450 SAP Exchange Infrastructure Development SAP NetWeaver
Date Training Center Instructors Education Website
Participant Handbook Course Version: 2005 Q3 Course Duration: 2 Day(s) Material Number: 50072895
An SAP course - use it to learn, reference it for work
Copyright Copyright © 2005 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. Additionally this publication and its contents are provided solely for your use, this publication and its contents may not be rented, transferred or sold without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
Trademarks •
Microsoft®, WINDOWS®, NT®, EXCEL®, Word®, PowerPoint® and SQL Server® are registered trademarks of Microsoft Corporation.
•
IBM®, DB2®, OS/2®, DB2/6000®, Parallel Sysplex®, MVS/ESA®, RS/6000®, AIX®, S/390®, AS/400®, OS/390®, and OS/400® are registered trademarks of IBM Corporation.
•
ORACLE® is a registered trademark of ORACLE Corporation.
•
INFORMIX®-OnLine for SAP and INFORMIX® Dynamic ServerTM are registered trademarks of Informix Software Incorporated.
•
UNIX®, X/Open®, OSF/1®, and Motif® are registered trademarks of the Open Group.
•
Citrix®, the Citrix logo, ICA®, Program Neighborhood®, MetaFrame®, WinFrame®, VideoFrame®, MultiWin® and other Citrix product names referenced herein are trademarks of Citrix Systems, Inc.
•
HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology.
•
JAVA® is a registered trademark of Sun Microsystems, Inc.
•
JAVASCRIPT® is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape.
•
SAP, SAP Logo, R/2, RIVA, R/3, SAP ArchiveLink, SAP Business Workflow, WebFlow, SAP EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP.com Logo and mySAP.com are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other products mentioned are trademarks or registered trademarks of their respective companies.
Disclaimer THESE MATERIALS ARE PROVIDED BY SAP ON AN "AS IS" BASIS, AND SAP EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR APPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THESE MATERIALS AND THE SERVICE, INFORMATION, TEXT, GRAPHICS, LINKS, OR ANY OTHER MATERIALS AND PRODUCTS CONTAINED HEREIN. IN NO EVENT SHALL SAP BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES OF ANY KIND WHATSOEVER, INCLUDING WITHOUT LIMITATION LOST REVENUES OR LOST PROFITS, WHICH MAY RESULT FROM THE USE OF THESE MATERIALS OR INCLUDED SOFTWARE COMPONENTS.
About This Handbook This handbook is intended to complement the instructor-led presentation of this course, and serve as a source of reference. It is not suitable for self-study.
Typographic Conventions American English is the standard used in this handbook. The following typographic conventions are also used. Type Style
Description
Example text
Words or characters that appear on the screen. These include field names, screen titles, pushbuttons as well as menu names, paths, and options. Also used for cross-references to other documentation both internal (in this documentation) and external (in other locations, such as SAPNet).
25-08-2005
Example text
Emphasized words or phrases in body text, titles of graphics, and tables
EXAMPLE TEXT
Names of elements in the system. These include report names, program names, transaction codes, table names, and individual key words of a programming language, when surrounded by body text, for example SELECT and INCLUDE.
Example text
Screen output. This includes file and directory names and their paths, messages, names of variables and parameters, and passages of the source text of a program.
Example text
Exact user entry. These are words and characters that you enter in the system exactly as they appear in the documentation.
Variable user entry. Pointed brackets indicate that you replace these words and characters with appropriate entries.
© 2005 SAP AG. All rights reserved.
iii
About This Handbook
BIT450
Icons in Body Text The following icons are used in this handbook. Icon
Meaning For more information, tips, or background Note or further explanation of previous point Exception or caution Procedures
Indicates that the item is displayed in the instructor’s presentation.
iv
© 2005 SAP AG. All rights reserved.
25-08-2005
Contents Course Overview ............................................................................. vii Course Goals.................................................................................vii Course Objectives .......................................................................... viii
Unit 1: Development Objects in SAP XI ...................................................1 XI Components and Connectivity........................................................... 3 Development in SAP XI .................................................................... 12 Introduction to Proxies ..................................................................... 29 Proxy Runtime Configuration.............................................................. 38 Integration Scenarios in the Integration Repository .................................... 47
Unit 2: Generating Proxy Objects ........................................................ 67 Introduction to the Proxy Program Model ............................................... 68 ABAP Proxy Generation ................................................................... 74 Java Proxy Generation..................................................................... 83 Enhancing Interfaces ...................................................................... 96
Unit 3: Using Generated Proxy Objects ................................................109 ABAP Server Proxy Implementation .................................................... 110 Using Java Client Proxies ................................................................ 124 Configuration in the Integration Directory .............................................. 141 Java Server Proxy Implementation...................................................... 151 Using ABAP Client Proxies ............................................................... 155 Server Proxies, Web Services, and WSDL............................................. 167
25-08-2005
© 2005 SAP AG. All rights reserved.
v
Contents
vi
BIT450
© 2005 SAP AG. All rights reserved.
25-08-2005
Course Overview This course provides an introduction to the program model for proxy objects. Together with SAP Exchange Infrastructure, this program model presents a new approach to implementing integration scenarios. In this approach, message formats are saved centrally in a repository. In this repository, the actual functions are then created in the back end by generating proxy objects. The course structure takes the participants through this procedure. Unit 1 introduces the concept and looks at the definition of message formats, unit 2 addresses the subsequent generation of proxy objects for ABAP and Java environments, and unit 3 explains how to use these objects to exchange messages using SAP Exchange Infrastructure.
Target Audience This course is intended for the following audiences: •
•
ABAP and Java developers who want to implement functions in SAP systems as server proxies as part of the implementation of an SAP Exchange Infrastructure scenario ABAP and Java developers who want to develop function calls in an SAP system by using client proxy objects as part of the implementation of an SAP Exchange Infrastructure scenario.
Course Prerequisites Required Knowledge • • •
BIT400 BC400 JA100
Recommended Knowledge • • •
25-08-2005
BC401 JA300 Basic knowledge of Web services and WSDL
© 2005 SAP AG. All rights reserved.
vii
Course Overview
BIT450
Course Goals This course will prepare you to: • • •
Understand how proxy objects are used in SAP Exchange Infrastructure (XI) Generate proxies for connecting SAP systems to XI Implement generated proxies and use them in your own programs
Course Objectives After completing this course, you will be able to: • • • •
Assess when to use proxy objects Execute the necessary proxy generation Use the generated client proxy objects Implement the generated server proxy objects
SAP Software Component Information The information in this course pertains to the following SAP Software Components and releases: •
viii
XI 3.0
© 2005 SAP AG. All rights reserved.
25-08-2005
Unit 1 Development Objects in SAP XI Unit Overview Introduction to the topic of “XI development” and revision of the basic principles of XI with reference to proxy technology.
Unit Objectives After completing this unit, you will be able to: • • • • • • • • • •
Understand the components of SAP Exchange Infrastructure List the options available for connecting application systems to SAP Exchange Infrastructure Understand the concepts of products, software components, and namespaces Create your own namespaces in the Integration Repository Describe the procedures for using proxies Understand the scenario used in the course Configure an SAP system based on the SAP WebAS ABAP for proxy communication, or check the configuration Configure an SAP system based on the SAP WebAS Java for proxy communication, or check the configuration Create integration scenarios in the Integration Repository Create objects for message interfaces in the Integration Repository
Unit Contents Lesson: XI Components and Connectivity.......................................... 3 Exercise 1: Checking the Entries in the System Landscape Directory ..... 9 Lesson: Development in SAP XI................................................... 12 Exercise 2: Checking Namespaces ........................................... 23 Exercise 3: Creating and Using Software Components .................... 25 Lesson: Introduction to Proxies .................................................... 29 Exercise 4: Checking Existing Interface Objects ............................ 35
25-08-2005
© 2005 SAP AG. All rights reserved.
1
Unit 1: Development Objects in SAP XI
BIT450
Lesson: Proxy Runtime Configuration ............................................ 38 Exercise 5: Checking the Local Integration Engine of a Business System ............................................................................ 43 Lesson: Integration Scenarios in the Integration Repository................... 47 Exercise 6: Creating an Integration Scenario and Repository Objects in the Integration Repository ...................................................... 53
2
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: XI Components and Connectivity
Lesson: XI Components and Connectivity Lesson Overview This lesson provides a recap of the architecture of the SAP Exchange Infrastructure.
Lesson Objectives After completing this lesson, you will be able to: • •
Understand the components of SAP Exchange Infrastructure List the options available for connecting application systems to SAP Exchange Infrastructure
Business Example You are responsible for development in SAP Exchange Infrastructure and need an overview of the architecture and components of SAP Exchange Infrastructure.
Components of SAP Exchange Infrastructure The aim of SAP Exchange Infrastructure is to provide a platform that allows different interfaces to connect using a uniform technology. This improves the overview and also reduces maintenance costs.
Figure 1: System Landscape with SAP Exchange Infrastructure
Components of SAP Exchange Infrastructure SAP Exchange Infrastructure comprises various components:
25-08-2005
© 2005 SAP AG. All rights reserved.
3
Unit 1: Development Objects in SAP XI
BIT450
Figure 2: Architecture of SAP Exchange Infrastructure
• • • • • •
• •
You can enter your system landscape in the System Landscape Directory (SLD). You enter all the necessary interfaces of the various software components, as well as mapping programs, in the Integration Repository. You configure the scenarios in the Integration Directory. The Integration Builder is the user interface (GUI) for working with the Integration Repository and Integration Directory. The Business Process Engine controls the correlation of messages and the processing of messages within Business Process Management (BPM). The Integration Engine of the Integration Server ensures that messages are processed according to the configuration in the Integration Directory. This involves determining who the receiver is and mapping the inbound message to the receiver interface structure. The Adapter Engine forms the basis of many adapters for connecting systems to the Integration Server. The Runtime Workbench is the main tool for central monitoring of components and messages.
Connecting the Application Systems to XI A local Integration Engine can be used on any application system that runs on SAP Web AS release 6.20 or higher. This means you can implement application scenarios from XI. You define the interface structure in the Integration Repository. You can then
4
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: XI Components and Connectivity
generate and call an outbound proxy in the application system; this proxy creates a message in XI format from the interface parameters and sends it to the Integration Server. You can generate an inbound proxy in the target system; this proxy receives a message in XI format from the Integration Server and processes the data. ABAP and Java proxy generation is supported.
Figure 3: Runtime Procedure: Conversion to XI Message Format
At present, all other application systems are connected to XI using adapters. The sender system provides data in a document format and sends it to the adapter by using a particular protocol. The adapter converts the document to XI format and sends it to the Integration Server in http(s) format. The adapter that is to receive the message is specified in the configuration. The Integration Server sends the message to the adapter. The adapter converts the message to the receiver protocol and sends it to the receiver.
Proxy Technology and SAP Adapters SAP adapters (RFC adapters, IDoc adapters) are designed for connecting SAP systems that run on a technical basis predating SAP Web AS 6.20 (for example, R/3 4.6), and which therefore do not directly support the XI protocol. Since SAP adapters (based on the RFC protocol) can also be used to connect SAP systems based on SAP Web AS >= 6.20, when you develop a new interface, you must decide which of the two options to use.
25-08-2005
© 2005 SAP AG. All rights reserved.
5
Unit 1: Development Objects in SAP XI
BIT450
Figure 4: Overview of Proxies and Adapters
This requires an understanding of the SAP Exchange Infrastructure concept, which is based on message formats (message interfaces). These message formats are saved centrally in the Integration Repository using Internet standards (WSDL, XML schema), independently of the programming languages actually used (ABAP, Java, .NET). However, if you use SAP adapters, the interfaces are developed locally in the business system and only imported to the Integration Repository later. This does not comply with the SAP Exchange Infrastructure concept of central interface development in the Integration Repository. This central interface development simplifies the realization of integration scenarios and supports the integration of external interfaces by importing the corresponding WSDL files. There is another significant difference of a more technical nature, namely the protocol used. It is not always possible to communicate with the back-end system using the RFC protocol. However, this is necessary when using an SAP adapter, because the Adapter Engine communicates with the SAP system using RFC. The HTTP protocol, which is used in proxy technology, is less problematic, particularly if firewalls are used between the Integration Server and the business system.
6
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: XI Components and Connectivity
Figure 5: Outbound vs. Inbound
It is important to understand the definition of outbound and inbound. In the application, an outbound message interface is used for a message sent from the application to the Integration Server. In the context of adapters, messages that are sent to the Integration Server require a sender adapter; this adapter sends messages from the sender to the Integration Server. In the case of proxies, client proxies correspond to an outbound interface and server proxies represent an inbound interface. Furthermore, when using adapters, the exchanged data format is adapter-specific and differs from the proxy XML data format.
25-08-2005
© 2005 SAP AG. All rights reserved.
7
Unit 1: Development Objects in SAP XI
8
© 2005 SAP AG. All rights reserved.
BIT450
25-08-2005
BIT450
Lesson: XI Components and Connectivity
Exercise 1: Checking the Entries in the System Landscape Directory Exercise Objectives After completing this exercise, you will be able to: • Check the settings for your business systems in the System Landscape Directory (SLD)
Business Example You want to implement business processes in an existing system landscape. SAP Exchange Infrastructure is installed and the existing system landscape is configured in the SLD. You want to check these settings to ensure that they are complete and to make alterations where applicable.
Task: SLD Configuration in the Integration Server Check the configuration in the System Landscape Directory (SLD).
25-08-2005
1.
Log on to the System Landscape Directory.
2.
Check whether the software component SC_BIT450_CIS is configured in the SLD.
3.
Check whether the business system Training is configured in the SLD.
4.
Which technical system is assigned to the business system Training in the SLD?
© 2005 SAP AG. All rights reserved.
9
Unit 1: Development Objects in SAP XI
BIT450
Solution 1: Checking the Entries in the System Landscape Directory Task: SLD Configuration in the Integration Server Check the configuration in the System Landscape Directory (SLD). 1.
Log on to the System Landscape Directory. a)
2.
Check whether the software component SC_BIT450_CIS is configured in the SLD. a)
3.
4.
Call transaction SXMB_IFR to display a menu for the SAP Exchange Infrastructure J2EE Engine in the Web browser. It is also possible to call the System Landscape Directory from this page. The user name and password are the same as those required to log on to the Integration Server.
To display the products and software components, choose Software→ Software Catalog from the SLD initial screen. In the Software Type field, select Software Components. To view only the relevant software components, enter the prefix SC_ in the Display Filter filter field and choose Enter (or select the filter icon).
Check whether the business system Training is configured in the SLD. a)
To navigate back to the initial screen of the SLD, choose Home. To display the business systems, choose Business Landscape on the SLD initial screen.
b)
The business system Training is maintained as an SAP system; it corresponds to client 821 of the Integration Server.
Which technical system is assigned to the business system Training in the SLD? Answer: This information is displayed in the overview or the detailed view of the business systems: The business system Training is assigned to client 821 of the XI system. A technical system is also assigned to the business system, which has the same system ID as the XI system.
10
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: XI Components and Connectivity
Lesson Summary You should now be able to: • Understand the components of SAP Exchange Infrastructure • List the options available for connecting application systems to SAP Exchange Infrastructure
25-08-2005
© 2005 SAP AG. All rights reserved.
11
Unit 1: Development Objects in SAP XI
BIT450
Lesson: Development in SAP XI Lesson Overview This lesson gives an overview of development objects and development environments.
Lesson Objectives After completing this lesson, you will be able to: • •
Understand the concepts of products, software components, and namespaces Create your own namespaces in the Integration Repository
Business Example You are a new member of an XI development team and need an overview of the components involved and the procedure in a development project.
Development Objects and Programming Languages Since SAP Exchange Infrastructure is based on the SAP Web Application Server, which as of release 6.20 enables ABAP development as well as Java development, it may seem a good idea to separate development according to the various programming languages, but this is not necessarily the case.
Figure 6: SAP Web AS and SAP XI
12
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Development in SAP XI
Although many SAP XI tools are based on Java, it actually makes more sense to organize development according to development objects. All development objects are located in the Integration Repository (the Integration Directory essentially contains scenario configurations). Development objects are created in the Integration Repository independently of the development environment used later. In addition, some development objects, in particular proxy objects, are located in the application system and are dependent on the respective development environment. These are the proxy objects generated for a message interface in the Integration Repository and the objects that are used by the generated proxy objects, for example programs.
Products, Software Components, and Namespaces In an SAP environment, a product corresponds to a technical SAP component. A product consists of one or more software components and customers can see it, install it, and renew it. A product is delivered by way of a product version, which in turn contains software component versions.
Figure 7: Product and Software Component Versions (SWCV) in the SLD
A software component is a reusable product module that can be individually upgraded or have patches installed. Software components are versioned to enable development to continue alongside the productive use of a software component. Development therefore always takes place in a software component version (SWCV). The development manager creates a separate namespace in the Integration Repository for objects that belong together semantically. This is similar to ABAP packages
25-08-2005
© 2005 SAP AG. All rights reserved.
13
Unit 1: Development Objects in SAP XI
BIT450
(previously called development classes) or Java packages. In this way, the objects are identified uniquely by their name and namespace. The objects of a namespace are always delivered together with the relevant SWCV. A namespace in XML is a user-defined constant that follows two conventions: the prefix http:// and the prefix urn:. The prefix http:// does not necessarily mean that the namespace is a website. It is more important that namespaces must be globally unique, not just within the SWCV. Therefore, the use of a company name in the namespace is a valid option. The namespaces in the Integration Repository also have implications for proxy objects that are generated later, since they determine the package names for the Java proxy objects. For further information on namespaces, see the documentation in the SAP Library: SAP Exchange Infrastructure → Design and Configuration Time → Software Logistics → Organization of Shipment Contents → Namespaces. Caution: When creating your own namespaces, the name components must never start with a number. If this is nevertheless the case, an underscore (_) is placed before the number when the Java proxy objects are generated. The decisive and visible factors for the developer responsible for editing the objects in the Integration Repository are the SWCV and the namespace (the products are only visible in the Integration Repository in the integration scenarios).
Figure 8: Importing an SWCV to the Integration Repository
14
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Development in SAP XI
In the same way that software components are versioned, there are also product versions. The relationship between a product version and a software component version is saved in the SLD as a software feature. The following preparations need to be made before development starts: • • • •
Create a product version in the SLD Create a software component version (SWCV) for the product version Import the SWCV to the Integration Repository Create namespaces for the SWCV in the Integration Repository
Before you start development, you need to create the product and software component versions in the SLD. If you are creating a new product and new software components, you must first create the product, then the software components, and finally the corresponding versions. If a product and software components already exist, you need to create a new version. Hint: There is also a based-on relationship for software components. If SAP component functions are used in a customer software component, it makes sense to save these in the SLD using the based-on relationship. This is saved as a software feature for the software component version as a component-component requisite association. For example, SAP ABA 6.20 is based on SAP Basis 6.20. The software component versions are then imported to the Integration Repository. You create namespaces for the individual developers in the Integration Repository in the SWCV. If the SWCV is a new version of an existing SWCV, you can copy the objects from the old SWCV to the new version by using a release transfer. For an SWCV you can also save logon data for an SAP back end, which enables you to import RFC signatures and IDoc types. You can flag SWCVs as original objects or as modifiable objects by using the relevant object attributes. You set both attributes in the system in which a SWCV is to be developed. User-specific change lists are used in the Integration Repository during development, which must be closed by activating the objects. Once development is finished, the SWCV is flagged as not modifiable and the objects are released. As of XI 2.0, this means that the objects are exported from the Integration Repository, for example, for import to a test system.
25-08-2005
© 2005 SAP AG. All rights reserved.
15
Unit 1: Development Objects in SAP XI
BIT450
If an SWCV is to be used in other systems (for example, imported to a test system), neither of the attributes Objects Are Original Objects or Objects Are Modifiable are set. This prevents changes being made. If an attempt is made to reset the attributes at a later date, warning messages will appear to prevent changes from being made unintentionally. Development Landscape As in R/3, a development landscape typically comprises a development system (DEV), a TEST system and a productive XI system (PROD). The System Landscape Directory (SLD) is typically used for all three XI systems. Hint: It is also technically possible to create a separate SLD for each XI system. In this case, data from the development SLD system can be exported to the subsequent SLD system. Similarly, the development objects of the Integration Repository are also transported to the subsequent systems by export/import (or using the CMS: Change Management Service, see below). It is possible to transport complete software component versions, individual namespaces of a software component version, or just single objects. For the Integration Directory configuration data, the receiver and interface determinations can also be transported by export or import (including mapping). However, you have to recreate the communication channels and logon data for each subsequent system, because each system has different technical systems and logon data. Once the data has been exported from the Integration Repository, you have to move the export file to the target system import directory, and do the same for the export from the Integration Directory. The corresponding directories are as follows: Integration Repository Export
/xi/repository_server/export
Import
/xi/repository_server/import Integration Directory
16
Export
/xi/directory_server/export
Import
/xi/directory_server/import
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Development in SAP XI
Figure 9: XI Development Landscape
Business System Groups: In the standard scenario, whereby one SLD is used for all XI systems in a development landscape, you can create business system groups in the SLD (each group is assigned to an Integration Server). For example, you can create group G1 as a group of business systems in a development landscape and group G2 as a group of business systems in a test landscape. The business systems are assigned to the groups automatically because each business system is already assigned to an Integration Server. Next, you maintain the transport targets, that is, assign a business system from group G1 to a business system from group G2. You do this directly in the business system settings. Since the business system is already assigned to a business system group, you just need to assign a business system from another group by choosing Transport Targets in the detail view of the business system.
25-08-2005
© 2005 SAP AG. All rights reserved.
17
Unit 1: Development Objects in SAP XI
BIT450
Figure 10: Business System Groups and Transport Targets in the SLD
Maintaining these transport targets means that when you import configuration data (for example, from the development system) to the Integration Directory of a subsequent system, the business system names are converted using the transport target information in the SLD. The business system names are converted in the receiver determinations, the interface determinations, and the routing conditions. The Change Management Service (CMS) is used for central administration of the Java development environment and the transports to the Web AS 6.40 across the whole software lifecycle. You can use it to configure development landscapes and transport software changes. The functions of the CMS are closely related to the System Landscape Directory (SLD). As an administrator tool, the CMS joins all involved components together into one unit, which can also be used to realize distributed development projects. Hint: For more information on how to use the CMS and its restrictions, see SAP Note 754143 CMS notes / restrictions, and related notes.
18
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Development in SAP XI
Figure 11: Change Management Server (CMS) for SAP XI
If the CMS is set up on the Java side of the XI Integration Server, on the homepage of the Exchange Infrastructure tools, you can use Administration to set for which objects the CMS should be used (menu path Repository / CMS Adjustment CMS transport settings). This is independent of the SWCV.
Authorizations A series of composite roles are supplied for the various development activities in XI, which contain the roles for the ABAP and J2EE parts. The following table shows the most important composite roles together with information on whether they have been assigned for the course for the users BIT450-## in one of the clients used (OK), whether they have only been assigned to one component (J for J2EE and A for ABAP), or whether they have not been assigned at all (-). Composite Roles in SAP XI and in the Course
25-08-2005
Composite Role
800
821
SAP_XI_DISPLAY_USER
OK
OK
SAP_XI_DEVELOPER
(J2EE)
OK
SAP_XI_CONFIGURATOR
OK
-
SAP_XI_MONITOR
-
-
SAP_XI_CONTENT_ORGANIZER
-
-
SAP_XI_ADMINISTRATOR
-
-
© 2005 SAP AG. All rights reserved.
19
Unit 1: Development Objects in SAP XI
BIT450
The users BIT450-## in client 821 have also been assigned authorization for the ABAP Workbench (SE80). The individual roles are described below, with an explanation of how to look them up in role maintenance (PFCG). SAP_XI_DISPLAY_USER A user with this role can view all content from the Integration Repository, the Integration Directory, the System Landscape Directory, the Integration Engine/Server, and so on, within SAP Exchange Infrastructure. SAP_XI_DEVELOPER The XI developer is responsible for all activities in SAP Exchange Infrastructure that involve the design and development of business processes. In particular, this includes the design of integration scenarios, interfaces, and mappings in the Integration Repository using the Integration Builder, as well as the import of existing interfaces from business systems. The XI developer is also responsible for generating proxies (ABAP and Java) and implementing them in business systems. SAP_XI_CONFIGURATOR The XI configurator is responsible for all activities in SAP Exchange Infrastructure that involve the configuration of business processes (integration content). In particular, this includes the logical routing settings, mapping, physical routing in the Integration Builder and maintenance of business systems and the System Landscape Directory. The XI configurator is also responsible for maintaining configuration data for the IDoc adapter (metadata). SAP_XI_MONITOR The XI monitor is responsible for all activities in SAP Exchange Infrastructure that involve monitoring. In particular, this includes monitoring XML message processing and message throughput, as well as error handling and status tracking. It also includes the monitoring of processed IDocs, RFCs, and other messages in adapters. The XI monitor can also check the contents of the runtime cache in the Integration Server and trigger cache updates, for example. SAP_XI_CONTENT_ORGANIZER The XI content organizer is responsible for activities in SAP Exchange Infrastructure that involve the organization and structuring of the contents of the Integration Repository, the Integration Directory, and the System Landscape Directory. These are more important tasks that are not typically performed by an XI developer or an XI configurator (for example, maintenance and import of software components in the System Landscape Directory). SAP_XI_ADMINISTRATOR The XI administrator is responsible for all activities in SAP Exchange Infrastructure that involve technical configuration and administration. In particular, this includes the settings for the Integration Engine, the Integration Server, the Integration Builder (the Integration Repository and Directory), the System Landscape Directory, the Runtime Workbench, and the IDoc adapter. The XI administrator is also responsible for maintaining the SAP Exchange Infrastructure profile data (Exchange Profile).
20
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Development in SAP XI
SAP Back-End System Development for SAP Adapters Development in SAP back-end systems, for example R/3 4.0, corresponds to the technologies and procedures from the areas of RFC programming and ALE. There are therefore no XI-specific development activities to be taken into account for connecting SAP back-end systems. For the SAP back-end system, there is no difference between the RFC or ALE connection to XI and the connection to another SAP back-end system. It is only necessary to configure the SAP adapters (RFC adapters and IDoc adapters), as described in the course BIT400.
25-08-2005
© 2005 SAP AG. All rights reserved.
21
Unit 1: Development Objects in SAP XI
BIT450
Figure 12: Development in the SAP Back End: Standard
•
Inbound RFC To receive inbound RFC calls, you have to create an RFC-enabled function module (RFM: remote-enabled function module) in the back-end system and import the RFC signature to the Integration Repository.
•
Inbound ALE An IDoc type must exist as the structure for the data record, and you have to make the standard ALE configurations. You have to import the IDoc type into the Integration Repository.
•
Outbound RFC You have to create an RFC destination for the RFC adapter that can be used in an application. The RFC signature for the called function module (RFM) must be imported in the Integration Repository.
•
Outbound ALE You have to create an RFC destination for the IDoc adapter that can be used in ALE customizing, and an IDoc type that must be imported into the Integration Repository.
As well as the standard procedures for RFC and ALE technology, you also have to configure the SAP adapters and make the XI configuration settings in the Integration Directory.
22
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Development in SAP XI
Exercise 2: Checking Namespaces Exercise Objectives After completing this exercise, you will be able to: • Check the namespaces for a software component version imported to the Integration Repository
Business Example As a member of a development project, you have to create your own objects in the Integration Repository and save them in a separate namespace.
Task: Check the software components SC_BIT450_SALES and SC_BIT450_CIS in the Integration Repository.
25-08-2005
1.
Log on to the Integration Server. From the menu, start the Integration Builder and log on to the Integration Repository.
2.
Check which namespaces the software component versions SC_BIT450_SALES and SC_BIT450_CIS contain.
© 2005 SAP AG. All rights reserved.
23
Unit 1: Development Objects in SAP XI
BIT450
Solution 2: Checking Namespaces Task: Check the software components SC_BIT450_SALES and SC_BIT450_CIS in the Integration Repository. 1.
2.
Log on to the Integration Server. From the menu, start the Integration Builder and log on to the Integration Repository. a)
Log on to client 800 in the training system.
b)
Choose Exchange Infrastructure: Integration Builder → Start Integration Builder or call transaction SXMB_IFR. Choose Repository (Design). The user name and password are the same as those required to log on to the Integration Server.
Check which namespaces the software component versions SC_BIT450_SALES and SC_BIT450_CIS contain. a)
24
To navigate to the individual namespaces, open the software components and the software component versions. To see where the namespaces are maintained, double click the software component version.
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Development in SAP XI
Exercise 3: Creating and Using Software Components Exercise Objectives After completing this exercise, you will be able to: • Create your own software components in the SLD • Import software components into the Integration Repository
Business Example To develop your own interfaces, you need your own software component.
Task 1: Create the software component SC_BIT450_MARKETING_## Version 1.0 in the System Landscape Directory for the product P_BIT450_MARKETING. 1.
Log on to the System Landscape Directory (SLD).
2.
In the SLD, navigate to the list of software components.
3.
Create a new software component SC_BIT450_MARKETING_## Version 1.0 for the vendor bit450.com.
Task 2: Import the software component SC_BIT450_MARKETING_## Version 1.0 from the SLD into the Integration Repository and create the namespace http://bit450.com/xi/marketing##.
25-08-2005
1.
Log on to the Integration Repository.
2.
Import your software component SC_BIT450_MARKETING_## Version 1.0.
3.
Open your software component version SC_BIT450_MARKETING_## Version 1.0 and enter the namespace http://bit450.com/xi/marketing##
© 2005 SAP AG. All rights reserved.
25
Unit 1: Development Objects in SAP XI
BIT450
Solution 3: Creating and Using Software Components Task 1: Create the software component SC_BIT450_MARKETING_## Version 1.0 in the System Landscape Directory for the product P_BIT450_MARKETING. 1.
2.
3.
Log on to the System Landscape Directory (SLD). a)
The homepage of the Integration Builder (transaction SXMB_IFR) provides a link for logging on to the System Landscape Directory.
b)
Log on with your user BIT450-## and your password from the Integration Server client 800.
In the SLD, navigate to the list of software components. a)
Choose Software Catalog.
b)
In the software catalog, choose the software type Software Components.
Create a new software component SC_BIT450_MARKETING_## Version 1.0 for the vendor bit450.com. a)
Choose New Component to start the wizard.
b)
Maintain the parameters of the software component as follows: Parameter
Value
Product
P_BIT450_MARKETING
Vendor
bit450.com
Name
SC_BIT450_MARKETING_##
Version
1.0
(The product can only be selected from the existing values.) c)
Choose Create to create the software component.
d)
Check whether a success message is displayed at the top of the browser window (Created SC_BIT450_MARKETING_##, 1.0 of bit450.com ).
Continued on next page
26
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Development in SAP XI
Task 2: Import the software component SC_BIT450_MARKETING_## Version 1.0 from the SLD into the Integration Repository and create the namespace http://bit450.com/xi/marketing##. 1.
2.
3.
25-08-2005
Log on to the Integration Repository. a)
The homepage of the Integration Builder (transaction SXMB_IFR) provides a link for logging on to the Integration Repository.
b)
Log on with your user BIT450-## and your password from the Integration Server client 800.
Import your software component SC_BIT450_MARKETING_## Version 1.0. a)
From the menu, choose Tools / Copy from System Landscape Directory / Import Software Component Versions.
b)
In the list of software component versions, select the line of your software component SC_BIT450_MARKETING_## Version 1.0 and choose Import.
c)
After the message to report successful import has been displayed in the import log, exit the list of software component versions by choosing Finish.
Open your software component version SC_BIT450_MARKETING_## Version 1.0 and enter the namespace http://bit450.com/xi/marketing## a)
On the Objects tab page, the software components are listed in alphabetical order. Navigate to your software component and open it so that the software component version SC_BIT450_MARKETING_## Version 1.0 is displayed. Double click to open the detail screen for the software component version.
b)
Switch to change mode and in the Namespaces area, enter the namespace http://bit450.com/xi/marketing##.
c)
Save your changes.
d)
Your namespace is displayed in the left area of the menu under the software component version SC_BIT450_MARKETING_## Version 1.0. You can open the namespace and display the subareas.
e)
Activate all your changes.
© 2005 SAP AG. All rights reserved.
27
Unit 1: Development Objects in SAP XI
BIT450
Lesson Summary You should now be able to: • Understand the concepts of products, software components, and namespaces • Create your own namespaces in the Integration Repository
28
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Introduction to Proxies
Lesson: Introduction to Proxies Lesson Overview This lesson provides an overview of proxy technology.
Lesson Objectives After completing this lesson, you will be able to: • •
Describe the procedures for using proxies Understand the scenario used in the course
Business Example Your company already uses SAP Exchange Infrastructure. The company is implementing a new integration scenario using SAP systems, and you need to plan the technical conversion and decide whether to use proxies.
Proxy Objects A proxy is a server function that enables two remote applications to communicate. Proxy objects act as agents and often perform tasks such as converting transferred data. Proxy objects therefore provide “server” services in programming, so that (server) application functions can be used from a (client) application. These functions use standard protocols and formats, for example http and XML, independently of the development language used to implement the server or the client. Each function has a description, which is used to generate the proxy objects in the appropriate development environment for the client. The use of proxy objects therefore enables you to use server application functions in the client application.
25-08-2005
© 2005 SAP AG. All rights reserved.
29
Unit 1: Development Objects in SAP XI
BIT450
Figure 13: Proxy Principle: Server Functions
The server functions are described in a representation independent of the development environments (and languages), typically in the form of special machine-readable XML files, so that proxy objects can be generated automatically. The format of the XML files is WSDL (Web Service Description Language. For further information, see http://www.w3.org/2002/ws). In XI, the functions are saved as message interfaces in the Integration Repository and these interfaces are used to generate the proxy objects for the respective development environment (currently ABAP or Java). Functions are called using HTTP protocol and special XML data formats.
Proxy Objects in XI Proxy objects are classes and methods in a programming language that generate or process messages for a message format defined in the Integration Repository (message interface). A distinction is made between client proxy for outbound interfaces and server proxy for inbound interfaces: Client Proxy Objects enable you to create messages (which correspond to an outbound message interface for which the proxy objects were generated) and send these messages to the Integration Server.
30
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Introduction to Proxies
Server Proxy Objects represent a back-end function that can be called using an XI message (that corresponds to an inbound message interface). Hint: In XI 2.0, client proxies were called “outbound proxies”, as they belong to an outbound message interface, and server proxies were referred to as “inbound proxies”. To use proxy objects, the following steps are necessary: 1. 2. 3.
Define the message interfaces in the Integration Repository. Generate the proxy objects. Use proxy runtime.
Define the message interfaces in the Integration Repository. The repository objects to be used for a scenario are saved in the Integration Repository at design time. This includes the message interface, message types, and data types. Flagging the message interface as inbound or outbound also determines whether server or client proxy objects will be generated for this message interface. Generate the proxy objects. The system can then generate the proxy objects for a development environment (ABAP or Java) from a defined message interface. These objects are classes, methods, and in some cases structure definitions, that are used in an inbound scenario to implement server functions, that is, to process an inbound message that corresponds to the message interface. In an outbound scenario, the client proxy objects can be used to create and send an outbound message corresponding to the message interface. Using the proxy runtime. To be able to use proxy objects, the business system in question must have a proxy runtime that enables messages to be sent and received independently of the scenario and the message format. Proxy runtime includes, among other things, a local Integration Engine. ABAP proxy runtime belongs to the ABAP part of the Web AS (in the XI Add-On) and Java proxy runtime is part of XI Connectivity, which can also be installed separately. The development process in this case is different from the programming of an RFC-enabled function module (RFM: Remote-enabled Function Module). RFM functions are developed (as an inbound interface) in the target system together with the signature (import and export parameters). The functions can then be called. When
25-08-2005
© 2005 SAP AG. All rights reserved.
31
Unit 1: Development Objects in SAP XI
BIT450
using proxy objects, the interface definition is separated from the implementation of the actual functions. First, the message format for the inbound message is saved in the Integration Repository in the form of an inbound message interface. This definition is used to create a shell (a method) representing the corresponding interface, into which the functions must be incorporated (for inbound messages). This is similar to the creation of a function module source text with a set signature.
Figure 14: Proxy Generation and Use
At design time, you create the repository objects, which are then used for proxy generation to generate proxy objects for a programming language such as ABAP or Java. At runtime, a method can be accessed to send a message to SAP Exchange Infrastructure, for example. Proxy runtime is used to send a message from an SAP system.
Scenario for Exercises In the exercises, participants will connect a Java standalone application to a client of an SAP ABAP system in a synchronous scenario by using proxy technology. Customer information is saved in the target system (business system SAP_BACKEND). This customer information is required for sales orders in the business system WEB_AS_JAVA. Design Time: First, create the message interfaces CustomerInformation_Request and CustomerInformation_Provide in the Integration Repository for the software components SC_BIT450_SALES and SC_BIT450_CIS.
32
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Introduction to Proxies
Figure 15: Design View: Creating Interfaces
The next step is to generate the proxy objects for both sides. You have to generate a CustomerInformation_Request in the caller system by using the generated proxy method; this request is sent to the central Integration Server. You also have to implement the generated proxy method in the target system, that is, you must develop the ABAP instructions for compiling the answer for the message format CustomerInformation_Provide.
Figure 16: Synchronous Scenario
25-08-2005
© 2005 SAP AG. All rights reserved.
33
Unit 1: Development Objects in SAP XI
34
© 2005 SAP AG. All rights reserved.
BIT450
25-08-2005
BIT450
Lesson: Introduction to Proxies
Exercise 4: Checking Existing Interface Objects Exercise Objectives After completing this exercise, you will be able to: • Find existing interface objects in the Integration Repository.
Business Example You want to gain an overview of the existing interface objects.
Task: Check which interface objects are available in the SWCV SC_BIT450_CIS in your namespace http://bit450.com/xi/abap##.
25-08-2005
1.
Log on to the Integration Repository.
2.
Naviagte to the SWCV SC_BIT450_CIS and the namespace http://bit450.com/xi/abap##, and search for existing message interfaces.
© 2005 SAP AG. All rights reserved.
35
Unit 1: Development Objects in SAP XI
BIT450
Solution 4: Checking Existing Interface Objects Task: Check which interface objects are available in the SWCV SC_BIT450_CIS in your namespace http://bit450.com/xi/abap##. 1.
2.
36
Log on to the Integration Repository. a)
Log on to client 800 in the training system.
b)
Choose Exchange Infrastructure: Integration Builder → Start Integration Builder or call transaction SXMB_IFR. Choose Integration Repository. The user name and password are the same as those required to log on to the Integration Server.
Naviagte to the SWCV SC_BIT450_CIS and the namespace http://bit450.com/xi/abap##, and search for existing message interfaces. a)
Open the SWCV SC_BIT450_CIS, then choose version 1.0 and the namespace http://bit450.com/xi/abap##.
b)
Open the Interface Objects / Message Interface node, and double click to open the existing message interface CustomerInformation_Provide.
c)
In the message interface CustomerInformation_Provide, the message types MtName and MtCustomerInfo, and the fault message type MissingInformation are referenced. You can double click on these names to navigate to the message type definitions. The data types referenced in the message types are also directly displayed here.
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Introduction to Proxies
Lesson Summary You should now be able to: • Describe the procedures for using proxies • Understand the scenario used in the course
25-08-2005
© 2005 SAP AG. All rights reserved.
37
Unit 1: Development Objects in SAP XI
BIT450
Lesson: Proxy Runtime Configuration Lesson Overview This lesson explains the required configuration for the ABAP and Java runtime environments.
Lesson Objectives After completing this lesson, you will be able to: • •
Configure an SAP system based on the SAP WebAS ABAP for proxy communication, or check the configuration Configure an SAP system based on the SAP WebAS Java for proxy communication, or check the configuration
Business Example In your company, interfaces of an SAP system are connected to SAP XI using proxy technology, and you are responsible for checking the configuration.
ABAP Proxy Runtime Configuration You have to configure the proxy runtime in the business system so that the local Integration Engine is not the Integration Server itself, but an application system. You also need to determine to which Integration Server the messages will be sent. In ABAP, you have to make client-specific configuration settings using transaction SXMB_ADM. You have to specify that each client is an application system, which means that proxy runtime belongs to a local Integration Engine. You also have to set the corresponding Integration Server. You can do this directly using a URL, or by using an existing SM59 destination.
38
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Proxy Runtime Configuration
Figure 17: ABAP Proxy Runtime Configuration
As with the application systems, you also have to configure the central Integration Server as the Integration Server. Of course, in this case you do not need to set further parameters for the corresponding Integration Server. For connecting an SAP ABAP back-end system, additional general configuration steps are required. These are listed briefly below: • • • • • • • •
RZ0: Register the technical system in the SLD Define the business system in the SLD and import into the directory Define a communication channel XI recipient for back end SXMB_ADM: Define the Integration Engine as decentral SXMB_ADM: Maintain the destination on the central Integration Engine Enable access to the SLD: SLDAPICUST + SM59 Create user XIAPPLUSER SXMB_ADM: Activate queues Hint: These points are covered in more detail in the basic course BIT400.
25-08-2005
© 2005 SAP AG. All rights reserved.
39
Unit 1: Development Objects in SAP XI
BIT450
Java Proxy Runtime Configuration The use of Java proxies requires a SAP J2EE Engine 6.40 SP5 or higher. Together with the Messaging System (MS), the Java proxy runtime (JPR) must be installed on the SAP J2EE Engine. Both the JPR and the MS are components of the XI 3.0 Adapter Framework (AF), which is available from the SAP Service Marketplace. Hint: To install the XI Adapter Framework, you need to install the following Software Delivery Archives (SDA) and Software Component Archives (SCA) using the Software Deployment Manager (SDM): Two SDAs that contain external libs (for license reasons, these cannot be supplied by SAP): • •
aii_af_ra_ms_sonic_client.sda aii_adapter_jms_provider_lib.sda
Two SCAs that contain the actual Adapter Framework: • •
SAPXIAFCnn_x.sca (contains AF core libraries and services) SAPXIAFnn_x.sca (contains AF applications)
(nn stands for the relevant number of the SP, and X is the patch level, for example SAPXIAF09_0.sca). Hint: Since the Adapter Framework makes intensive use of the other services of the SAP J2EE Engine, SAP recommends that you install the AF at the same SP level as the J2EE Engine (from SP9, the SP numbers of the components have been synchronized). In contrast to XI 2.0, the Java proxy runtime requires almost no manual configuration. It is more important that the SAP J2EE Engine is correctly integrated into the system landscape. The required and optional steps are described in more detail in the following. Connection to the SLD: for security reasons, in XI 3.0, the SLD access data is no longer maintained in the file dbconnect.properties. Instead, it is stored in the Secure Store of the J2EE Engine, which gets its date from the Exchange Profile of the Integration Servers. You can configure the corresponding connection to the Integration Server using the link: http://:/exchangeProfile/connection.jsp.
40
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Proxy Runtime Configuration
Figure 18: Configuration of the J2EE Proxy Runtime: Access to the exchangeProfile
To ensure that SLD access is activated, call the service CPACache in the Visual Administrator and check whether the parameter SLDAccess has the value true. The J2EE engine accesses the SLD itself using the configuration of the SLD Data Supplier service (with the help of the Visual Administrator). Business System In XI 2.0, the JPR uses the file technicalID.properties to determine the associated business system. In XI 3.0, the business system is identified by the SAP J2EE Server, which automatically logs on to the SLD when the Adapter Framework is installed. The business system referenced by the technical system acts as a sender service for outgoing messages. Logging and Tracing: To change the standard logging and tracing settings, use the Visual Administrator and call the service Log Configuration. Switch to "Advanced Mode" and select the "Runtime" tab, followed by "Destinations". Here, choose the entries library_com.sap.aii.proxy.xiruntime_JPRTrace application_sap.com/com.sap.xi.proxyserver_ProxyServerTrace Here you can change the relevant log and trace settings at runtime. However, these settings only take effect if the following settings are made in the LogManager (in the kernel tree of the server node):
25-08-2005
© 2005 SAP AG. All rights reserved.
41
Unit 1: Development Objects in SAP XI
BIT450
either ForceSingleTraceFile is set to NO or com.sap.aii.proxy has been added to SingleTraceFile_UnrestrictedLocations.
42
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Proxy Runtime Configuration
Exercise 5: Checking the Local Integration Engine of a Business System Exercise Objectives After completing this exercise, you will be able to: • Check which Integration Server your business system SAP_BACKEND is assigned to.
Business Example The client of an SAP system is a business system which exchanges messages by using SAP Exchange Infrastructure. Therefore, an Integration Server must be assigned to the client in the SAP system.
Task 1: Check the SLD for the systems SAP_BACKEND and WEBAS_JAVA. 1.
Log on to the SLD and check the list of business systems.
Task 2: In the Integration Directory, check whether the systems SAP_BACKEND and WEBAS_JAVA have been imported, and which communication channels are available. 1.
Navigate to the business systems.
Task 3: Check which Integration Server the business system SAP_BACKEND is assigned to. 1.
25-08-2005
Log on to the business system SAP_BACKEND and call the transaction for configuring the Integration Engine.
© 2005 SAP AG. All rights reserved.
43
Unit 1: Development Objects in SAP XI
BIT450
Solution 5: Checking the Local Integration Engine of a Business System Task 1: Check the SLD for the systems SAP_BACKEND and WEBAS_JAVA. 1.
Log on to the SLD and check the list of business systems. a)
A list of business systems is displayed under System Landscape / Business Landscape.
b)
The systems SAP_BACKEND and WEBAS_JAVA are included in this list.
c)
Select the name of the system to view the detailed information.
Task 2: In the Integration Directory, check whether the systems SAP_BACKEND and WEBAS_JAVA have been imported, and which communication channels are available. 1.
Navigate to the business systems. a)
Log on to the Integration Directory.
b)
Choose Objects → Service Without Partner → Business System → SAP_BACKEND → Communication Channel. You will see the communication channel that the instructor created (SAP_Proxy_In). This channel has the type XI recipient and references an SM59 destination.
c)
Choose Objects → Service Without Partner → Business System → WEBAS_JAVA → Communication Channel. You will see the communication channel that the instructor created (J2E_Proxy_In). This channel has the type XI recipient and references an SM59 destination.
d)
Optional: You can log on to the Integration Server (XI client 800) and use transaction SM59 to check the SM59 destinations referenced in the communication channels.
Continued on next page
44
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Proxy Runtime Configuration
Task 3: Check which Integration Server the business system SAP_BACKEND is assigned to. 1.
Log on to the business system SAP_BACKEND and call the transaction for configuring the Integration Engine. a)
Log on to SAP_BACKEND. Use the parameters provided by the instructor.
b)
Call transaction SXMB_ADM to configure the Integration Engine.
c)
Under the Configuration node, choose the second entry Configuration Data (Integration Engine).
d)
In the Global Configuration Data section, the Role of Business System parameter shows that the role LOC Application System is assigned to the current client. The assigned Integration Engine is configured using the Corresponding Integration Server parameter, which contains the URL of the Integration Engine. Hint: For an explanation of how to configure the URL for calling the Integration Server, use the F1 help for the Corresponding Integration Server field.
25-08-2005
© 2005 SAP AG. All rights reserved.
45
Unit 1: Development Objects in SAP XI
BIT450
Lesson Summary You should now be able to: • Configure an SAP system based on the SAP WebAS ABAP for proxy communication, or check the configuration • Configure an SAP system based on the SAP WebAS Java for proxy communication, or check the configuration
46
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Integration Scenarios in the Integration Repository
Lesson: Integration Scenarios in the Integration Repository Lesson Overview This lesson introduces the Integration Repository, including integration scenarios and interface objects.
Lesson Objectives After completing this lesson, you will be able to: • •
Create integration scenarios in the Integration Repository Create objects for message interfaces in the Integration Repository
Business Example You want to implement a new integration scenario using SAP Exchange Infrastructure. You are a member of a project team and are responsible for creating the necessary objects in the Integration Repository as well as an integration scenario, so that your colleagues can later retrace the objects you have created and used.
Introduction to Integration Scenarios Business scenarios in the Integration Repository are the graphical representation of an integration scenario and contain information about the systems involved, as well as the interfaces and mappings used. They are therefore a type of integration plan and can be saved, for example, as image files (jpg). The integration scenarios in the Integration Repository can be copied to the Integration Directory for generating configuration scenarios. It is not a prerequisite for production operation to save an integration scenario in the Integration Repository, but it is recommended for documentation and retraceability purposes. It also considerably simplifies the later creation of a configuration scenario in the Integration Repository. SAP also supplies integration scenarios for your components that use SAP Exchange Infrastructure.
25-08-2005
© 2005 SAP AG. All rights reserved.
47
Unit 1: Development Objects in SAP XI
BIT450
Elements of Integration Scenarios An integration scenario enables you to save the components involved in the form of vertical (colored) columns. These application columns are assigned a role in the scenario, which is a purely descriptive name. You do not enter any business systems in the integration scenarios. At design time, the integration scenario should represent the process independently of the business systems that will be used later. When you create the application component, you can assign a product from the SLD. If it is not yet clear which product will be used, or the product is not maintained in the SLD, you can use a product template instead. In the components of the integration scenario, you create actions, which represent the process steps in the scenario. An action sends or receives an (ext.) message. Message interfaces are saved for the actions, which describe the format of the message. A connection line between the actions is used to connect the process steps. It indicates where messages are exchanged between process steps. The message interfaces used are entered in the connection line. If different message interfaces are used, you have to create a relevant message mapping in the connection line. If the connected actions are on the same level, the process is synchronous. If the action on the right-hand side is below the action on the left-hand side, this represents an asynchronous scenario step. Hint: Although an integration scenario is a representation of an integration scenario that is typically distributed across two or more components, the integration scenario itself must be assigned as an object to a component and to a namespace in the Integration Repository. This also applies to mapping objects, which connect the message interfaces of two components. The component that an integration scenario is assigned to is not important at this stage. In the scenario used in the following exercises, the integration scenario and the mapping objects are assigned to the sender system.
The Integration Scenario for the Exercises In the exercises, an integration scenario containing the message interfaces to be used is created in the Integration Repository. Hint: The software components have already been created and imported to the Integration Repository. The namespaces for the objects to be created have also been saved in the software component versions.
48
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Integration Scenarios in the Integration Repository
Figure 19: The Synchronous Integration Scenario
The integration scenario contains two systems. The first system (role: Sales and Distribution) requires detailed customer information, which is saved in the second system (role: CustomerInfoCenter). This information is to be called synchronously. The sender system is represented by a Java application that works with a Java client proxy. The receiver system is the client of an SAP system that works with a server proxy.
Figure 20: Systems Involved in the Scenario
25-08-2005
© 2005 SAP AG. All rights reserved.
49
Unit 1: Development Objects in SAP XI
BIT450
In this synchronous scenario, a Java application is created that requests information on customers from a business system. A client of the R/3 back-end system is used. The objects required in the Integration Repository are shown below. The objects for the software component SC_BIT450_CIS have already been created in the Integration Repository.
Figure 21: Overview of Message Formats
The Java application sends a query containing a complex data type with two customer fields. However, the application function in the target system only expects a simple data type with the combined name of the customer. You therefore require a mapping for this part of the message on the Integration Server.
50
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Integration Scenarios in the Integration Repository
Figure 22: Mapping Types
You have to create a message mapping, which maps the outbound message type with two source fields to the inbound message type with one target field. An interface mapping is also necessary. This maps the two message interfaces to each other and contains the message mapping. Finally, you have to make the relevant configuration settings in the Integration Directory so that the message sent by the Java application is correctly forwarded to the target system.
25-08-2005
© 2005 SAP AG. All rights reserved.
51
Unit 1: Development Objects in SAP XI
BIT450
Figure 23: Configuration in the Integration Directory
52
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Integration Scenarios in the Integration Repository
Exercise 6: Creating an Integration Scenario and Repository Objects in the Integration Repository Exercise Objectives After completing this exercise, you will be able to: • Create integration scenarios in the Integration Repository
Business Example You are a member of a project team and want to implement an integration scenario. To ensure that the message formats you use and the systems involved can be traced even after your project has been completed, create a integration scenario containing the necessary information in the Integration Repository along with the actual message information (message interfaces).
Task 1: Create an integration scenario called BIT450_CustomerInfoScenario_## in the Integration Repository. 1.
Log on to the Integration Repository.
2.
Create a new integration scenario called BIT450_CustomerInfoScenario_## for your software component version SC_BIT450_SALES 1.0 in your namespace http://bit450.com/xi/java##.
3.
Insert the following two application components into your integration scenario: product version P_BIT450_SALES 1.0 with the role “Sales and Distribution” and product version P_BIT450_CIS 1.0 with the role “CustomerInfoCenter”.
4.
Insert the action RequestCustomerInformation for product version P_BIT450_SALES 1.0 with the outbound interface CustomerInformation_Request into your application component. Caution: Make sure that you enter the names correctly when creating the objects since these names are used in all the following exercises, especially proxy runtime. If you are unsure of the names, use the graphics from this lesson or ask your instructor.
Continued on next page
25-08-2005
© 2005 SAP AG. All rights reserved.
53
Unit 1: Development Objects in SAP XI
5.
BIT450
Insert the action you just created and the action ProvideCustomerInformation (from the software component SC_BIT450_CIS) into your integration scenario and insert a connection line between the actions.
Task 2: In the Integration Repository, create the necessary repository objects for the integration scenario you just created. Hint: There are two methods for creating the objects: top-down (by forwards navigation from the integration scenario to the message interface down to the data types) or bottom-up (from the data types to the message types up to the message interface). The top-down method is described below. 1.
Log on to the Integration Repository.
2.
Check whether the message interface CustomerInformation_Provide for the software component version (SWCV) SC_BIT450_CIS 1.0 in your namespace http://bit450.com/xi/abap## corresponds to the current scenario and that only objects from your namespace are referenced.
3.
Create the outbound message interface CustomerInformation_Request saved in the action RequestCustomerInformation in your namespace http://bit450.com/xi/java##. It should contain an output message type MtCustomerName, an input message type MtCustomerInfo, and a fault message type MissingInformation. The message type MtCustomerName should in turn use a complex data type PersonName comprising the elements Surname (XSD:string) and Name (XSD:string). The message type MtCustomerInfo should use the complex data type CustomerInfo comprising the integer element ID and the string elements NAME, CUSTTYPE, POSTCODE, and CITY.
4.
Create the message mapping CustomerNameMerge for the software component version SC_BIT450_SALES 1.0 in your namespace http://bit450.com/xi/java## to map the message types MtCustomerName and MtName to each other. In this message mapping, map both the Surname and Name fields from the source structure, separated by a blank, to MtName (located in the SWCV SC_BIT450_CIS 1.0 in the namespace http://bit450.com/xi/abap##). Continued on next page
54
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Integration Scenarios in the Integration Repository
The sequence should be first name, then surname. Test your message mapping. 5.
25-08-2005
Create the interface mapping CustomerInfoMap for the software component version SC_BIT450_SALES 1.0 in your namespace http://bit450.com/xi/java## to map the message interfaces CustomerInformation_Request and CustomerInformation_Provide to each other (using the message mapping CustomerNameMerge for the request).
© 2005 SAP AG. All rights reserved.
55
Unit 1: Development Objects in SAP XI
BIT450
Solution 6: Creating an Integration Scenario and Repository Objects in the Integration Repository Task 1: Create an integration scenario called BIT450_CustomerInfoScenario_## in the Integration Repository. 1.
2.
Log on to the Integration Repository. a)
Log on to client 800 in the training system.
b)
Choose Exchange Infrastructure: Integration Builder → Start Integration Builder or call transaction SXMB_IFR. Choose Repository (Design). The user name and password are the same as those required to log on to the Integration Server.
Create a new integration scenario called BIT450_CustomerInfoScenario_## for your software component version SC_BIT450_SALES 1.0 in your namespace http://bit450.com/xi/java##. a)
Navigate to your namespace http://bit450.com/xi/java## in the software component version SC_BIT450_SALES 1.0 and expand the Integration Scenarios & Processes node. Use the context menu for the Integration Scenarios node to create a new integration scenario BIT450_CustomerInfoScenario_##. Enter the name on the initial screen, use the predefined values for namespace and software component version, and choose Create. You can enter a description in the detail view. Save the integration scenario.
Continued on next page
56
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Integration Scenarios in the Integration Repository
3.
Insert the following two application components into your integration scenario: product version P_BIT450_SALES 1.0 with the role “Sales and Distribution” and product version P_BIT450_CIS 1.0 with the role “CustomerInfoCenter”. a)
Insert the application components by using the context menu. Create an application component in the first vertical column on the left-hand side. Leave Product (Defined in System Landscape Directory) selected and use the input help to search for the product version P_BIT450_SALES 1.0 of bit450.com. Hint: Since the software components assigned to this product are also saved for the product in the SLD, these are displayed here as information for the actions to be used. Under Role, save the role name Sales and Distribution and choose “Enter” to exit the detail view. Following the same procedure, create another application component as a product in the column to the right of the first application component. Enter the product version P_BIT450_CIS 1.0 of bit450.com and the role name CustomerInfoCenter.
4.
Insert the action RequestCustomerInformation for product version P_BIT450_SALES 1.0 with the outbound interface CustomerInformation_Request into your application component.
Continued on next page
25-08-2005
© 2005 SAP AG. All rights reserved.
57
Unit 1: Development Objects in SAP XI
BIT450
Caution: Make sure that you enter the names correctly when creating the objects since these names are used in all the following exercises, especially proxy runtime. If you are unsure of the names, use the graphics from this lesson or ask your instructor. a)
Using the context menu for Actions, create an action called RequestCustomerInformation for the software component version SC_BIT450_SALES 1.0 in your namespace http://bit450.com/xi/java##. Enter the name on the initial screen, use the predefined values for namespace and software component version, and choose Create. In the detail view under Use, leave Internal selected. Under Outbound Interfaces use the icon with the green cross to enter CustomerInformation_Request in the Name field and http://bit450.com/xi/java## in the Namespace field. Hint: Since the outbound interface is not created until later, you can use the F4 input help for the namespace, but not for the outbound interface. Save your entries.
Continued on next page
58
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Integration Scenarios in the Integration Repository
5.
Insert the action you just created and the action ProvideCustomerInformation (from the software component SC_BIT450_CIS) into your integration scenario and insert a connection line between the actions. a)
Navigate to your integration scenario (in software component SC_BIT450_SALES) and insert both actions by choosing Insert Action from the context menu for the respective component. Insert the action RequestCustomerInformation into the component with the role Sales and Distribution and insert the action ProvideCustomerInformation into CustomerInfoCenter. Hint: Since the actions are assigned to the corresponding software components (and, in this case, the software components are assigned to different products), make sure that you assign them to the correct application component.
b)
Select both actions (by holding down the Shift key and clicking the left mouse button). Then call the context menu and choose Create Connection Between Selected Actions to create a connection between the two actions.
c)
In the detail view for the connection, select the inbound interface CustomerInformation_Provide.
d)
In the detail view, choose the Mapping tab and maintain the following mapping under “Assigned Interface Mapping”: Name
CustomerInfoMap
Namespace
http://bit450.com/xi/java##
Software component version
SC_BIT450_SALES
Hint: Since the interface mapping is not created until later, you cannot use the input help. e)
Choose Enter to exit the detail view.
f)
You also have the option of defining the actions as start or end actions. To do so, in change mode, use the corresponding function in the context menu for the action in the integration scenario.
g)
Save and activate all objects.
Continued on next page
25-08-2005
© 2005 SAP AG. All rights reserved.
59
Unit 1: Development Objects in SAP XI
BIT450
Task 2: In the Integration Repository, create the necessary repository objects for the integration scenario you just created. Hint: There are two methods for creating the objects: top-down (by forwards navigation from the integration scenario to the message interface down to the data types) or bottom-up (from the data types to the message types up to the message interface). The top-down method is described below. 1.
2.
3.
Log on to the Integration Repository. a)
Log on to client 800 in the training system.
b)
Choose Exchange Infrastructure: Integration Builder → Start Integration Builder or call transaction SXMB_IFR. Choose Repository (Design). The user name and password are the same as those required to log on to the Integration Server.
Check whether the message interface CustomerInformation_Provide for the software component version (SWCV) SC_BIT450_CIS 1.0 in your namespace http://bit450.com/xi/abap## corresponds to the current scenario and that only objects from your namespace are referenced. a)
Open the SWCV and navigate to the interface objects in your namespace. Under Message Interfaces, open the message interface CustomerInformation_Provide that has already been created by double clicking it.
b)
Check that the correct message types are referenced by checking the namespaces and also by navigating to the referenced message types and then to the data types by double clicking.
c)
You can also start a check in the message interface by choosing Message Interface → Check (F7). If a message type has been entered that does not exist, an error message will appear.
Create the outbound message interface CustomerInformation_Request saved in the action RequestCustomerInformation in your namespace http://bit450.com/xi/java##. It should contain an output message type MtCustomerName, an input message type MtCustomerInfo, and a fault message type MissingInformation.
Continued on next page
60
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Integration Scenarios in the Integration Repository
The message type MtCustomerName should in turn use a complex data type PersonName comprising the elements Surname (XSD:string) and Name (XSD:string). The message type MtCustomerInfo should use the complex data type CustomerInfo comprising the integer element ID and the string elements NAME, CUSTTYPE, POSTCODE, and CITY. a)
In your integration scenario BIT450_CustomerInfoScenario_##, double click to open the action RequestCustomerInformation and switch to change mode. Call the context menu for the name of the outbound interface CustomerInformation_Request to create this (previously only named) object directly.
b)
In the attributes, define the message interface as synchronous and outbound and assign the following names, all in your namespace http://bit450.com/xi/java##: Output Message Type
MtCustomerName
Input Message Type
MtCustomerInfo
Fault Message Types
MissingInformation
Hint: If you place your cursor in the Namespace field, you can select your namespace from the input help that appears directly to the right of the field, instead of typing it in. Save the message interface. c)
Use forward navigation from the message interface (context menu: New or the name of the message type) to create the message types named above (incl. fault message type), and then use the output and input message types to create the data types. Create all objects in your namespace http://bit450.com/xi/java##. Message Type
MtCustomerName
->Data Type
PersonName
(complex)
-> Element
Surname
(XSD:string)
-> Element
Name
(XSD:string)
Continued on next page
25-08-2005
© 2005 SAP AG. All rights reserved.
61
Unit 1: Development Objects in SAP XI
BIT450
When creating the data type CustomerInfo, make sure that the five elements are assigned beneath the data element and that they are maintained as elements and not as attributes. Message Type
MtCustomerInfo
->Data Type
CustomerInfo
(complex)
-> Element
ID
(XSD:integer)
-> Element
NAME
(XSD:string)
-> Element
CUSTTYPE
(XSD:string)
-> Element
POSTCODE
(XSD:string)
-> Element
CITY
(XSD:string)
Hint: Of course, you can also copy the message type MtCustomerInfo from the ABAP component SC_BIT450_CIS, including all its dependent objects. You then only need to manually correct the XML namespace of the message type. Save and activate all objects. Hint: There is an icon under the Object menu option that enables you to save all objects at the same time. 4.
Create the message mapping CustomerNameMerge for the software component version SC_BIT450_SALES 1.0 in your namespace http://bit450.com/xi/java## to map the message types MtCustomerName and MtName to each other. In this message mapping, map both the Surname and Name fields from the source structure, separated by a blank, to MtName (located in the SWCV SC_BIT450_CIS 1.0 in the namespace http://bit450.com/xi/abap##). The sequence should be first name, then surname. Test your message mapping. a)
In the objects for your namespace http://bit450.com/xi/java##, navigate to the Message Mappings node by choosing Mapping Objects. To create a new message mapping, call the context menu. Enter the name CustomerNameMerge and choose Create. Enter a description. Continued on next page
62
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Integration Scenarios in the Integration Repository
b)
In the navigation tree for the software component SC_BIT450_SALES, search for the Message Types node and the message type MtCustomerName. Use Drag&Drop to drag this type to the hand icon in the source structure (to the field labeled Choose a Source Message). Search for your message type MtName in the software component SC_BIT450_SALES, in the Message Types node, and use “Drag&Drop” to drag the message type to the hand icon in the target structure (to the field labeled Choose a Target Message). Alternatively, you can use the input help next to the fields named above. Hint: Only the message type is listed in the graphical mapping editor display (for example, MtCustomerName), and not the referenced data type (for example, PersonName).
c)
Select the Text function and use Drag&Drop to drag the concat field to the data-flow editor. Double click on the source fields Surname and Name to make them appear in the mapping. Drag one connection line from the Name source field (on the right-hand side) to the concat inbound field on the upper left-hand side (since the first name should come first) and one from the Surname source field (on the right-hand side) to the concat inbound field on the lower left-hand side. Double click on MtName and this target field will also appear in the mapping. This field is automatically assigned the result of the concat step and all fields which are in the mapping will then turn green. Double click on the concat field and enter a blank as a delimiter to separate the Name and Surname fields by a blank. Choose Enter to leave the screen for maintaining the properties of the concat step. Save the message mapping.
d)
You can call the test interface from the Test tab page in the detail view of the message mapping. Here, you can enter your test values in the tabular tree view, fill an XML document in the source view mode, or use the Load XML Instance) button to open an XML instance from a file. Choose Execute Mapping to execute the mapping and display the result and any status messages. Continued on next page
25-08-2005
© 2005 SAP AG. All rights reserved.
63
Unit 1: Development Objects in SAP XI
5.
64
BIT450
Create the interface mapping CustomerInfoMap for the software component version SC_BIT450_SALES 1.0 in your namespace http://bit450.com/xi/java## to map the message interfaces CustomerInformation_Request and CustomerInformation_Provide to each other (using the message mapping CustomerNameMerge for the request). a)
In the objects for your namespace http://bit450.com/xi/java##, navigate to the Interface Mappings node by choosing Mapping Objects. Create a new interface mapping by calling the context menu. Enter the name CustomerInfoMap and choose Create. Enter a short text and save the interface mapping.
b)
Enter the outbound interface CustomerInformation_Request and the inbound interface CustomerInformation_Provide by using the input help. Alternatively, you can drag the interfaces to the hand icons by using Drag&Drop. Choose the Read Interfaces icon to display detailed information in the lower part of the screen. If you have already saved your message mapping CustomerNameMerge, you can use the input help for the Mapping Programs field for the request to select it.
c)
Save and close all objects. Check that all objects have been activated.
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Integration Scenarios in the Integration Repository
Lesson Summary You should now be able to: • Create integration scenarios in the Integration Repository • Create objects for message interfaces in the Integration Repository
25-08-2005
© 2005 SAP AG. All rights reserved.
65
Unit Summary
BIT450
Unit Summary You should now be able to: • Understand the components of SAP Exchange Infrastructure • List the options available for connecting application systems to SAP Exchange Infrastructure • Understand the concepts of products, software components, and namespaces • Create your own namespaces in the Integration Repository • Describe the procedures for using proxies • Understand the scenario used in the course • Configure an SAP system based on the SAP WebAS ABAP for proxy communication, or check the configuration • Configure an SAP system based on the SAP WebAS Java for proxy communication, or check the configuration • Create integration scenarios in the Integration Repository • Create objects for message interfaces in the Integration Repository
66
© 2005 SAP AG. All rights reserved.
25-08-2005
Unit 2 Generating Proxy Objects Unit Overview The topic has been introduced and you have created the objects in the Integration Repository. These objects will now be used to generate proxy objects, which will be used in the actual programming (unit 3).
Unit Objectives After completing this unit, you will be able to: • • • • • • • •
Explain the procedure for using proxy objects Describe the relationship between message types and proxy methods Create and generate the corresponding ABAP proxy objects for a message interface from the Integration Repository Understand the generated proxy objects Generate the corresponding Java proxy objects for a message interface from the Integration Repository Understand the functions of the generated proxy objects Enhance message interfaces using data type enhancements without modifications Modify message interfaces
Unit Contents Lesson: Introduction to the Proxy Program Model .............................. 68 Exercise 7: Generating a WSDL File in the Integration Repository....... 71 Lesson: ABAP Proxy Generation .................................................. 74 Exercise 8: Generating ABAP Proxy Objects................................ 79 Lesson: Java Proxy Generation ................................................... 83 Exercise 9: Generating Java Proxy Objects ................................. 89 Lesson: Enhancing Interfaces ..................................................... 96 Exercise 10: Checking Proxy Enhancements .............................. 101
25-08-2005
© 2005 SAP AG. All rights reserved.
67
Unit 2: Generating Proxy Objects
BIT450
Lesson: Introduction to the Proxy Program Model Lesson Overview Introduction to the concept of central interface maintenance.
Lesson Objectives After completing this lesson, you will be able to: • •
Explain the procedure for using proxy objects Describe the relationship between message types and proxy methods
Business Example You are responsible for introducing WSDL documents in an integration project and want to know how this standard is used in XI.
Proxy Model
Figure 24: Proxy Generation and Use
68
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Introduction to the Proxy Program Model
Once you have defined the message formats (message interfaces) in the Integration Repository, you can use them to generate the required proxy objects. To generate these objects, you have to access the Integration Repository: •
•
Java Proxy Generation: The Java proxy objects are generated directly in the Integration Repository. ABAP Proxy Generation: ABAP proxy generation in the business system uses http to read the information from the Integration Repository.
Message interface information is saved in the Integration Repository independently of the programming language in which it will be used. This information is saved as special XML files, called WSD documents.
Figure 25: Using WSDL to Define Message Interfaces
Web Service Description Language (WSDL) is the XML-format language developed by the World Wide Web Consortium (W3C, see http://www.w3.org) for defining services and their interfaces. You can also define structures by using XML Schema Definition (XSD). Proxy Runtime: Runtime requires proxy runtime as provided in the SAP Web AS 6.20 with the XI Add-On. It can also be used for Java by means of Java archives.
25-08-2005
© 2005 SAP AG. All rights reserved.
69
Unit 2: Generating Proxy Objects
BIT450
Figure 26: Proxy Runtime
On the outbound side, the exchange profile and therefore the System Landscape Directory are accessed to obtain information about the URL of the Integration Server to be used.
70
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Introduction to the Proxy Program Model
Exercise 7: Generating a WSDL File in the Integration Repository Exercise Objectives After completing this exercise, you will be able to: • Generate a WSDL file for a message interface you have already created
Business Example You have created a message interface and you want to find out how to describe the saved information by using the Web service standard WSDL.
Task: Generate a WSDL File for a Message Interface Generate a WSDL file for your message interface CustomerInformation_Provide in the Integration Repository.
25-08-2005
1.
Log on to the Integration Repository.
2.
In the Integration Repository, display the detail view of the inbound message interface CustomerInformation_Provide for software component version SC_BIT450_CIS 1.0 in your namespace http://bit450.com/xi/abap##.
3.
Export the WSDL file to the directory \\xitrans\group##\CustomerInformation_Provide.wsdl.
4.
Display the WSDL file that you have created.
© 2005 SAP AG. All rights reserved.
71
Unit 2: Generating Proxy Objects
BIT450
Solution 7: Generating a WSDL File in the Integration Repository Task: Generate a WSDL File for a Message Interface Generate a WSDL file for your message interface CustomerInformation_Provide in the Integration Repository. 1.
2.
3.
Log on to the Integration Repository. a)
Log on to client 800 in the training system.
b)
Choose Exchange Infrastructure: Integration Builder → Start Integration Builder or call transaction SXMB_IFR. Choose Repository (Design). The user name and password are the same as those required to log on to the Integration Server.
In the Integration Repository, display the detail view of the inbound message interface CustomerInformation_Provide for software component version SC_BIT450_CIS 1.0 in your namespace http://bit450.com/xi/abap##. a)
Open the software component version SC_BIT450_CIS 1.0, then your namespace http://bit450.com/xi/abap##. In the interface objects, navigate to the message interface CustomerInformation_Provide.
b)
Open the detail view of the message interface by double clicking the name.
Export the WSDL file to the directory \\xitrans\group##\CustomerInformation_Provide.wsdl. a)
4.
Display the WSDL file that you have created. a)
72
The detail view has its own menu on the right-hand side of the screen. Choose Tools→ Export WSDL from this menu and save the WSDL file on your PC as CustomerInformation_Provide.wsdl in the directory \\xitrans\group##\. To open the file, you can double click on it directly in the above directory or open it from within an application such as Notepad.
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Introduction to the Proxy Program Model
Lesson Summary You should now be able to: • Explain the procedure for using proxy objects • Describe the relationship between message types and proxy methods
25-08-2005
© 2005 SAP AG. All rights reserved.
73
Unit 2: Generating Proxy Objects
BIT450
Lesson: ABAP Proxy Generation Lesson Overview Introduction to ABAP proxy generation and proxy objects.
Lesson Objectives After completing this lesson, you will be able to: • •
Create and generate the corresponding ABAP proxy objects for a message interface from the Integration Repository Understand the generated proxy objects
Business Example You are an ABAP developer and are responsible for generating ABAP proxy objects. You want to know the necessary procedure.
Generating ABAP Proxy Objects The required objects, such as transaction SPROXY, are available in every SAP system based on SAP Web AS 6.40 or above. Hint: In the SAP Web Application Server 6.20, the objects are delivered with the APP-INT add-on. The transaction SPROXY reads the information stored in the Integration Repository as a WSDL file and saves it in the SAP system. The user interface of the transaction SPROXY displays the message interfaces saved in the Integration Repository under their corresponding software component version and namespace, grouped into inbound and outbound message interfaces. If no proxy objects have been generated for a message interface, only the message interface name is listed. If proxy objects have been generated, then you can navigate to them directly. Hint: For SAP components (vendor = ’sap.com’): only the software component versions that are installed in the same system are offered (see the table CVERS or view the system status and choose the details button for the software component version).
74
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: ABAP Proxy Generation
To create new proxy objects, select the name of the message interface and then choose Create Proxy from the context menu.
Figure 27: ABAP Proxy Generation: Steps
The next step is to specify a package and a prefix to avoid naming conflicts between the objects to be created and existing objects. Hint: If the package checks are activated in the SAP system, the properties of the package must be correctly maintained for the use of the generic proxy objects. (To deactivate the package checks, in the table “PAKPARAM”, set the key “GLOBAL_SWITCH” to “OFF”.) However, naming conflicts may still occur, or the object names in the Integration Repository may be longer than is permitted in ABAP. Any such conflicts will be displayed in a separate window. You can then view the objects that you want to generate and make any necessary changes to their names before generating them. The created interface defines the interface (inbound and outbound parameters) for the method execute_synchronous (or, in the asynchronous case, execute_asynchronous). The created class implements this interface, which means it contains a method that corresponds to the interface declaration and can be used at runtime.
25-08-2005
© 2005 SAP AG. All rights reserved.
75
Unit 2: Generating Proxy Objects
BIT450
Figure 28: Generated ABAP Objects Interface
The signature of the method execute_synchronous corresponds to the message interface. It contains the inbound message type as INPUT, the outbound message type as OUTPUT and the fault message type as the exception. The method signature and the data structures will be explained in more detail later.
ABAP Server Proxy Objects In the case of an inbound message interface, you create a method in the generated class. The method will be implemented later; at the moment it is still empty and serves to receive and process a message from the Integration Server. You also create all the necessary dictionary objects for the method interface.
76
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: ABAP Proxy Generation
Figure 29: Generated ABAP Server Proxy Objects
Hint: Even if the server proxy objects have been activated in the transaction SPROXY, you still have to activate the generated class separately. As this method still has to be implemented and activated, the class itself must also be activated, during this implementation at the latest.
ABAP Client Proxy Objects In the case of an outbound message interface, you create a method (for example, execute_synchronous) in the generated class. The method will be used later, for example, it may be called in a program to send a message to the Integration Server. You also create all the necessary dictionary objects for the method interface.
25-08-2005
© 2005 SAP AG. All rights reserved.
77
Unit 2: Generating Proxy Objects
BIT450
Figure 30: Generated ABAP Proxy Objects (Outbound)
Converting WSDL to the Target Language: For a short introduction to XSD with details about ABAP (and Java), listing the exact mapping of XSD data types to ABAP types, see the documentation in the SAP Library: SAP Exchange Infrastructure → Design and Configuration Time → Design → Proxy Generation → Converting WSDL to the Target Language.
78
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: ABAP Proxy Generation
Exercise 8: Generating ABAP Proxy Objects Exercise Objectives After completing this exercise, you will be able to: • Generate all the necessary proxy objects in an SAP client for an inbound message interface defined in the Integration Repository
Business Example As part of an XI project, you want to connect an SAP back-end system to the Integration Server using proxy technology. The message formats have already been created in the Integration Repository, and you are responsible for creating (and later implementing) the server proxy objects in the SAP back end.
Task: Generate all the necessary proxy objects for the inbound message interface CustomerInformation_Provide in the business system SAP_BACKEND.
25-08-2005
1.
Log on to the business system SAP_BACKEND and call the transaction for generating proxy objects.
2.
Generate all the necessary proxy objects for the inbound message interface CustomerInformation_Provide in the software component version SC_BIT450_CIS 1.0, in the namespace http://bit450.com/xi/abap##.
© 2005 SAP AG. All rights reserved.
79
Unit 2: Generating Proxy Objects
BIT450
Solution 8: Generating ABAP Proxy Objects Task: Generate all the necessary proxy objects for the inbound message interface CustomerInformation_Provide in the business system SAP_BACKEND. 1.
Log on to the business system SAP_BACKEND and call the transaction for generating proxy objects. a)
Log on to client 8xx of the SAP_BACKEND system.
b)
Call the transaction SPROXY for generating proxy objects.
Continued on next page
80
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: ABAP Proxy Generation
2.
Generate all the necessary proxy objects for the inbound message interface CustomerInformation_Provide in the software component version SC_BIT450_CIS 1.0, in the namespace http://bit450.com/xi/abap##. a)
Select the software component version SC_BIT450_CIS 1.0 in the namespace http://bit450.com/xi/abap##. Navigate to the Message Interface (inbound) node and then to the message interface CustomerInformation_Provide.
b)
Start the generation process by double clicking the message interface name CustomerInformation_Provide.
c)
A modal dialog box appears. Enter the package $TMP and the prefix Z##_ (including the underscore). Hint: The prefix helps to prevent naming conflicts with objects that already exist in the system and other exercise groups. Caution: To create proxy objects in an SAP customer system, you require an OSS key and development authorization.
d)
If there are naming conflicts or the object name exceeds the permitted length, a modal dialog box will alert you to this. In this case, the next screen has additional tab pages informing you of warnings and conflicts.
e)
To view the objects to be generated, use the Generation and Structure tab pages. You can change the interface name to Z##_II_CUSTOMER_INFO_PROVIDE or change the name of the implementing class to Z##_CL_CUSTOMER_INFO_PROVIDE, or both, as an example. In the following exercises, do not forget that you have changed these names.
25-08-2005
f)
To activate the proxy objects, choose Activate or, from the menu, Proxy → Activate.
g)
Navigate to the objects you have created by double clicking them. In particular, navigate to the proxy interface Z##_II_CUSTOMER_INFORMATION_PR, to the implementing class Z##_CL_CUSTOMER_INFORMATION_PR, and from there to the method Z##_CL_CUSTOMER_INFORMATION_PR~execute_synchronous. Note: The method is empty because you have not yet implemented the functions that will be executed by an inbound message.
© 2005 SAP AG. All rights reserved.
81
Unit 2: Generating Proxy Objects
BIT450
Lesson Summary You should now be able to: • Create and generate the corresponding ABAP proxy objects for a message interface from the Integration Repository • Understand the generated proxy objects
82
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Java Proxy Generation
Lesson: Java Proxy Generation Lesson Overview Generation of Java proxy objects in the Integration Repository
Lesson Objectives After completing this lesson, you will be able to: • •
Generate the corresponding Java proxy objects for a message interface from the Integration Repository Understand the functions of the generated proxy objects
Business Example You are a Java developer and are responsible for generating Java proxy objects. You want to know the necessary procedure.
Generating Java Proxy Objects Using the Java proxy generation function, you can generate Java classes or Java proxy objects from a message interface in the Integration Repository. Using these objects, you can then implement sender and receiver applications in Java; the proxy objects establish the connection to the Integration Server using the Java proxy runtime. You can generate Java proxies for J2EE applications on the SAP Web Application Server. Proxy generation generates J2EE beans and proxy classes for this purpose. The generated beans satisfy the EJB 2.0 standard. Java proxy generation is a part of the Integration Builder with the following functions: •
•
Generation of an archive (as Jar- or Zip file) starting from one or more message interfaces of the same software component version. The archive contains the bean and proxy classes. Opening of existing archives for subsequent generation of proxies. Proxy generation recognizes the original message interfaces for which proxy objects are contained in the archive.
In the Integration Repository, you can call Java proxy generation as follows: • •
25-08-2005
From the main menu, choose Tools →Java Proxy Generation From the context menu, choose Java Proxy Generation... for message interfaces in the navigation tree.
© 2005 SAP AG. All rights reserved.
83
Unit 2: Generating Proxy Objects
BIT450
In the first step of Java proxy generation, you have to specify an archive (in Jaror Zip format). You have two options: • •
You can Create a New Archive. With this option, if you select an existing archive, it is overwritten. You can Change an Existing Archive. Choose this option if you want to regenerate proxy objects. In this case, Java proxy generation recognizes the message interfaces for which proxies already exist in the archive, so that these can be regenerated at the same time. You can only regenerate proxy classes for the entire message interface. Hint: jar files are Java archives that can deliver multiple classes together as one package. You can open and unpack these archives in Windows by using WinZip, for example. You can also use the jar command - which is similar to tar under Linux: Hint: jar -xf : Extracts a jar file jar -tf : Displays content of jar file
Figure 31: Integration Builder: Generating Java Proxy Objects
84
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Java Proxy Generation
Make sure that you adhere to the file hierarchy when you unpack the archive. The namespace of the objects becomes the package name of the Java classes and is reflected in the file system and subfolders that are used by the Java runtime. A namespace http://bit450.com/xi/java## thus becomes com → bit450 → xi → java## in the file system. This folder contains the Java classes that belong to this package.
Figure 32: Namespaces, Packages and Folders
Converting the Message Interface to Java Compared to ABAP, Java has fewer restrictions regarding names for labels (for example, for classes or data types). The length of labels in Java is practically unlimited and they are case-sensitive. The technical names of the generated Java proxy classes are based on the JAX RPC specification: • • •
Namespaces are mapped to packages. Classes for interfaces have the suffix _PortType. Classes for data types have the suffix _Type
The suffixes correspond to the element names from the imported WSDL document and help to avoid naming collisions. For this reason, naming conflicts are very unlikely. If a naming conflict occurs, proxy generation terminates and triggers an error message.
25-08-2005
© 2005 SAP AG. All rights reserved.
85
Unit 2: Generating Proxy Objects
BIT450
Conversion of Data Types Predefined XSD data types are mapped to their Java equivalents. For example, values of the XSD type string are transformed to the Java classjava.lang.String. All non-fixed predefined data types are mapped as follows: Data Type Conversion Between XSD and Java XSD
Java
(local)
Attributes of a class (including access methods)
(global)
Class
(local)
Inner class
Attributes of an (inner) class (including access methods)
(local)
Attribute of an (inner) class (including access methods)
The XSL elements , and cannot be converted. The proxy runtime does not recognize the XSL language elements for restricting the value range (for example ) and for defining key relationships (for example, ) - these properties should be checked as a part of the schema validation. Hint: For more information on the XML schema language elements supported by Java proxy generation, see the SAP Service Marketplace (Internet address service.sap.com/xi →Media Library →Documentation: SAP XI 3.0 (SP1) – Supported XML Schema and WSDL (EN)).
Java Proxy Objects (Outbound) For an outbound message interface, a Java class with the ending _PortType (and additional EJB-relevant classes and interfaces) are created. This class contains a generated method according to the pattern MyInterfaceName (). To send a message using the Java proxy runtime, the method described above must be called on the remote interface of the proxy bean.
86
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Java Proxy Generation
Java Proxy Objects (Inbound) For an inbound message interface, you create a Java interface with the suffix _PortType (and Java beans, if necessary). This interface contains a method declaration according to the pattern MyInterfaceName (). To process the messages sent by the Integration Server, the interface _PortType must be implemented. public class MyInbound_PortTypeImpl extends AbstractProxy implements MyInbound_PortType {...}
25-08-2005
© 2005 SAP AG. All rights reserved.
87
Unit 2: Generating Proxy Objects
88
© 2005 SAP AG. All rights reserved.
BIT450
25-08-2005
BIT450
Lesson: Java Proxy Generation
Exercise 9: Generating Java Proxy Objects Exercise Objectives After completing this exercise, you will be able to: • Generate Java proxy objects for a message interface in the Integration Repository • Use the Java development environment Netweaver Developer Studio to integrate the created objects into a project
Business Example You want to use proxy runtime to enable communication between a J2EE and the Integration Server. To use the data types and transfer a message to the Integration Server by calling a method, you need the corresponding proxy objects.
Task: Generate the necessary proxy objects for the outbound message interface CustomerInformation_Request and integrate them into a project in the SAP Netweaver Developer Studio. 1.
Log on to the Integration Repository.
2.
Navigate to the message interface CustomerInformation_Request in the namespace http://bit450.com/xi/java## of the software component version SC_BIT450_SALES.
3.
Generate the Java proxy objects for the message interface CustomerInformation_Request in a Java archive with the name CustomerInfo.zip and save the archive under the path \temp\CustomerInfo.zip. Hint: is used here as a variable; your instructor will inform you which workspace to use, for example “N:\My Documents\BIT450\”.
4.
Unpack the objects from the archive CustomerInfo.zip to the directory \temp\CustomerInfo.
5.
Start the SAP NetWeaver Developer Studio and create an EJB module project called Exc_Sales_EJB.
6.
Import the unpacked proxy classes into the EJB module project. Continued on next page
25-08-2005
© 2005 SAP AG. All rights reserved.
89
Unit 2: Generating Proxy Objects
90
BIT450
7.
Use the variable SAP_USER_ADD_LIBS to add the libraries from the directory \libs\WebAS\ext to the project. To do this, point the variable to the path \libs\WebAS\ext.
8.
Choose the J2EE Explorer tab and view the newly imported classes and interfaces.
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Java Proxy Generation
Solution 9: Generating Java Proxy Objects Task: Generate the necessary proxy objects for the outbound message interface CustomerInformation_Request and integrate them into a project in the SAP Netweaver Developer Studio. 1.
2.
Log on to the Integration Repository. a)
Log on to client 800 in the training system.
b)
Choose Exchange Infrastructure: Integration Builder → Start Integration Builder or call transaction SXMB_IFR. Choose Repository (Design). The user name and password are the same as those required to log on to the Integration Server.
Navigate to the message interface CustomerInformation_Request in the namespace http://bit450.com/xi/java## of the software component version SC_BIT450_SALES. a)
Open the software component version SC_BIT450_SALES, then your namespace http://bit450.com/xi/java##. Navigate to Interface Objects → Message Interfaces and go to the message interface CustomerInformation_Request that you created.
Continued on next page
25-08-2005
© 2005 SAP AG. All rights reserved.
91
Unit 2: Generating Proxy Objects
3.
BIT450
Generate the Java proxy objects for the message interface CustomerInformation_Request in a Java archive with the name CustomerInfo.zip and save the archive under the path \temp\CustomerInfo.zip. Hint: is used here as a variable; your instructor will inform you which workspace to use, for example “N:\My Documents\BIT450\”. a)
To start Java proxy generation, call the context menu for the message interface name. A new window is opened. First use the Create icon to enter the name and the path of the Java archive: \temp\CustomerInfo.zip. Hint: For the Java archive, the name “CustomerInfo.jar” would be more suitable, but the “.zip” file ending enables you to later open the archive within the training environment.
4.
b)
Choose Continue. You can skip the next three steps, as these only list the message interface selected using the context menu.
c)
At the end, choose Finish to start the generation and then choose Close to exit the assistant.
Unpack the objects from the archive CustomerInfo.zip to the directory \temp\CustomerInfo. a)
Start WinZip by double clicking on the file CustomerInfo.zip in the directory \temp\.
b)
Use the option Use Folder Names to extract all files to the directory \temp\CustomerInfo.
c)
The Java files and several folders are created, which correspond to the namespace of the message interface in the Integration Repository.
Continued on next page
92
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Java Proxy Generation
5.
6.
Start the SAP NetWeaver Developer Studio and create an EJB module project called Exc_Sales_EJB. a)
Start the SAP Netweaver Developer Studio by choosing Start → Programs → BIT450 course → SAP NetWeaver Delelopment Studio (BIT450) from the menu. When this batch file is started, the workspace is set to the directory . This means that the configuration files are saved in this directory and any properties files that the Java application works with are expected in this directory.
b)
To create a new EJB module project, choose File → New → Project. In the next screen, choose the project type J2EE and on the right-hand side, choose EJB Module Project. Name the project Exc_Sales_EJB and leave the Project Contents option as “use default”. This specifies that the Java source files for the project are created in the directory /Exc_Sales_EJB.
Import the unpacked proxy classes into the EJB module project. a)
Choose the J2EE Explorer tab to switch to the J2EE view and under your project Exc_Sales_EJB, select the directory ejbModule.
b)
Import the unpacked proxy classes from step 4 using the menu File → Import... . Choose File System. Now navigate to the directory \temp\CustomerInfo, select the directory com (on the left) and the file genInfo.xml (right) and choose Finish. .
7.
25-08-2005
Use the variable SAP_USER_ADD_LIBS to add the libraries from the directory \libs\WebAS\ext to the project. To do this, point the variable to the path \libs\WebAS\ext. a)
From the menu, choose Project → Properties, Java Build Path and then choose the Libraries tab.
b)
Click on Add Variable, choose Edit, find the variable SAP_USER_ADD_LIBS, and choose “Edit” again. Assign the directory \libs\WebAS\ext to this variable, either directly by entering it in the field Path, or by using the Folder pushbutton. Close all windows apart from the last one with the title “Properties for Exc_Sales_EJB”.
c)
Choose Add Variable again, and select the variable SAP_USER_ADD_LIBS, which is now adjusted to your environment, directly from the list, and choose Extend.... Now select all Java archives contained under WebAS–>ext and click on OK (you can use the Ctrl key to select more than one entry at the same time). Close all windows. Continued on next page
© 2005 SAP AG. All rights reserved.
93
Unit 2: Generating Proxy Objects
8.
94
BIT450
Choose the J2EE Explorer tab and view the newly imported classes and interfaces. a)
Switch to the J2EE Explorer view of your project Exc_Sales_EJB and select the directory ejbModule.
b)
All classes imported in exercise step 6 are located in the relative directory com → bit450 → xi → java##, which corresponds to the file package com.bit450.xi.java##, which is predefined by the namespace http://bit450.com/xi/java## in the Integration Builder.
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Java Proxy Generation
Lesson Summary You should now be able to: • Generate the corresponding Java proxy objects for a message interface from the Integration Repository • Understand the functions of the generated proxy objects
25-08-2005
© 2005 SAP AG. All rights reserved.
95
Unit 2: Generating Proxy Objects
BIT450
Lesson: Enhancing Interfaces Lesson Overview This lesson provides an introduction to the concepts involved in enhancing message interfaces based on data type enhancements and modifications.
Lesson Objectives After completing this lesson, you will be able to: • •
Enhance message interfaces using data type enhancements without modifications Modify message interfaces
Business Example Your company uses proxies whose message interfaces also reuse SAP data types. You need to enhance these interfaces due to new requirements. You are a member of the development team for SAP Exchange Infrastructure, with responsibility for explaining the options for enhancing interfaces and implementing the enhancement.
Interfaces Based on Message Types Message interfaces can be defined on the basis of message types or external definitions. This lesson covers message interfaces that use message types. If new interfaces are created in the customer namespace in the Integration Builder, it is also possible to reuse SAP objects. This section deals with these interfaces.
Relationships Between Software Components The “based-on” relationships are a prerequisite for the use of objects from other software component versions. These are represented in the SLD using the dependencies of a software component version. If a “based-on” relationship is defined between a customer software component version and an SAP software component version in the SLD, in the Integration Repository, a subnode “Basis Objects” is displayed under the node of the customer software component version. This contains the objects of the SAP software component version, which can be used in the same way as objects of the customer’s own namespace.
96
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Enhancing Interfaces
Figure 33: “Based-on” Relationship
Data Type Enhancements for Enhancing Interfaces Message interfaces can be defined on the basis of message types or external definitions. If messages refer to message types, they can be enhanced without the need for modifications. A data type enhancement is then created for the data type that is referenced in the message type. A data type enhancement is a separate object, which references the data type that it enhances.
Figure 34: The Object Type Data Type Enhancement
25-08-2005
© 2005 SAP AG. All rights reserved.
97
Unit 2: Generating Proxy Objects
BIT450
This means that if a message type from a customer namespace uses an SAP data type, this SAP data type can then be enhanced by a data type enhancement in the customer namespace.
Figure 35: Data Type Enhancement in the Customer Namespace
If you want to use this method enhance a proxy that implements a message interface of this type, you only need to subsequently create and generate the data type enhancement. The data type enhancement is then created in the customer namespace as an append structure to the structure that it enhances. The new fields can therefore be used immediately. The actual structures that are enhanced by data type enhancements are not modified in this procedure.
Modification of SAP Interface Objects Another option for enhancing message interfaces defined on the basis of SAP message types is to modify the referenced data types. To make a modification, a "based-on" relationship should be defined between the customer software component and the SAP software component whose objects the customer is modifying. Before objects can be changed, including objects in the underlying software components, the property objects are changeable must be set in the relevant customer software component version. To modify an SAP object, you need to select the object in the navigation tree of the customer software component, in the “Basis Objects” subtree. If you now switch to change mode in the object editor, the following message is displayed: Object is defined in the underlying software component version. Do you want to copy the object to the software component and modify it?
98
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Enhancing Interfaces
Figure 36: Modifying an SAP Object
Confirm this message using the Modify button. You can then modify the SAP object within the customer software component. If you also use the same SAP object in other software components, the modification does not affect the other software components in the repository. The repository then contains different versions of the same SAP object. However, only one version can be active within an SAP application system.
Figure 37: Two Versions of an SAP Data Type in the Repository
Subsequent SAP deliveries do not overwrite the modified version of the object in the repository, instead you are informed that conflict resolution is required. With the support of a conflict editor, you can then reconcile the new SAP object with your modified version in an integration step.
25-08-2005
© 2005 SAP AG. All rights reserved.
99
Unit 2: Generating Proxy Objects
BIT450
In an SAP application system in which a proxy is implemented using an object modified in this way, this object then appears twice in the SPROXY: in the original SAP component and in the customer component.
Figure 38: One Version of an Object at Two Positions in the SPROXY Tree
To regenerate the proxy for the modified status, you need to regenerate the modified object in the customer component. This changes the SAP structure (a repair order is required!). There is only one version of the SAP structure. All software component versions that use this SAP data type now use the modified structure. A modification of this type in the ABAP system will be overwritten by subsequent SAP deliveries. In contrast to the Integration Repository, the modification is therefore lost, but can be easily restored by regenerating the modified data type.
100
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Enhancing Interfaces
Exercise 10: Checking Proxy Enhancements Exercise Objectives After completing this exercise, you will be able to: • Explain the difference between an enhancement without modifications, and the modification of a proxy whose message interface uses SAP data types.
Business Example A client proxy is used to query customer address data from a customer information system. Since the customer information system can provide more information than the message interface of the proxy is capable of receiving, the proxy has been enhanced by the addition of some address fields.
Task: In this exercise, you will reproduce the enhancements of an interface of a client proxy that uses SAP data types. Similar to the proxy used so far for querying customer information, the client proxy queries address information for customers. Information from the table SCUSTOM is expected in return. The data type Address from the namespace http://sap.com/xi/XI/TestCase of the software component version SAP BASIS 6.40 is reused.
25-08-2005
1.
Check the enhancement (without modifications) of the message interface CustomerAddress_Request using the data type enhancement Webuser2Address of the data type Address within the namespace http://bit450.com/xi/customer.com of the software component version SC_BIT450_CUSTOMER.
2.
Check the enhancement of the message interface CustomerAddress_Request using the modification of the data type Address within the SAP namespace http://sap.com/xi/XI/TestCase of the software component version SC_BIT450_CUSTOMER.
© 2005 SAP AG. All rights reserved.
101
Unit 2: Generating Proxy Objects
BIT450
Solution 10: Checking Proxy Enhancements Task: In this exercise, you will reproduce the enhancements of an interface of a client proxy that uses SAP data types. Similar to the proxy used so far for querying customer information, the client proxy queries address information for customers. Information from the table SCUSTOM is expected in return. The data type Address from the namespace http://sap.com/xi/XI/TestCase of the software component version SAP BASIS 6.40 is reused. 1.
Check the enhancement (without modifications) of the message interface CustomerAddress_Request using the data type enhancement Webuser2Address of the data type Address within the namespace http://bit450.com/xi/customer.com of the software component version SC_BIT450_CUSTOMER. a)
Log on to the Integration Repository: Choose Exchange Infrastructure: Integration Builder → Start Integration Builder or transaction SXMB_IFR. Choose the link Integration Builder: Design. The user name and password are the same as those required to log on to the Integration Server.
b)
In the object tree, navigate to the data type enhancement Webuser2Address by choosing SC_BIT450_CUSTOMER→ SC_BIT450_CUSTOMER, 1.0 of customer.com→ http://bit450.com/xi/customer.com → Interface Objects → Data Type Enhancements. Display the data type enhancement.
c)
In the object tree, navigate to the data type Address by choosing SC_BIT450_CUSTOMER → SC_BIT450_CUSTOMER, 1.0 of customer.com -> Basis Objects → http://sap.com/xi/XI/TestCase → Interface Objects → Data Types. Display the data type.
d)
Log on to client 821 in your SAP system.
e)
In the SPROXY tree, navigate to the data type Address by choosing SC_BIT450_CUSTOMER, 1.0 of customer.com → http://sap.com/xi/XI/TestCase → Data Type → Address. Display the data type. Navigate to the implementing structure SXIPERF_PRX_ADDRESS. The data type enhancement is added using the append structure Z00_WEBUSER2ADDRESS. Continued on next page
102
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Enhancing Interfaces
2.
Check the enhancement of the message interface CustomerAddress_Request using the modification of the data type Address within the SAP namespace http://sap.com/xi/XI/TestCase of the software component version SC_BIT450_CUSTOMER. a)
Log on to the Integration Repository: Choose Exchange Infrastructure: Integration Builder → Start Integration Builder, or transaction SXMB_IFR. Choose the link Integration Builder: Design. The user name and password are the same as those required to log on to the Integration Server.
b)
In the object tree, navigate to the modified data type Address by choosing SC_BIT450_CUSTOMER → SC_BIT450_CUSTOMER, 1.0 of customer.com → Basis Objects → http://sap.com/xi/XI/TestCase → Interface Objects → Data Types. Display the modified data type.
c)
In the object tree, navigate to the original data type Address by choosing SAP BASIS→ SAP BASIS 6.40 -> http://sap.com/xi/XI/TestCase → Interface Objects → Data Types. Display the original data type.
25-08-2005
d)
Log on to client 821 in your SAP system.
e)
In the SPROXY tree, navigate to the data type Address by choosing SC_BIT450_CUSTOMER, 1.0 of customer.com → http://sap.com/xi/XI/TestCase → Data Type → Address. Display the data type. Navigate to the implementing structure SXIPERF_PRX_ADDRESS. The data type modification is inserted as the field CUST_TYPE.
© 2005 SAP AG. All rights reserved.
103
Unit 2: Generating Proxy Objects
BIT450
Lesson Summary You should now be able to: • Enhance message interfaces using data type enhancements without modifications • Modify message interfaces
104
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Unit Summary
Unit Summary You should now be able to: • Explain the procedure for using proxy objects • Describe the relationship between message types and proxy methods • Create and generate the corresponding ABAP proxy objects for a message interface from the Integration Repository • Understand the generated proxy objects • Generate the corresponding Java proxy objects for a message interface from the Integration Repository • Understand the functions of the generated proxy objects • Enhance message interfaces using data type enhancements without modifications • Modify message interfaces
25-08-2005
© 2005 SAP AG. All rights reserved.
105
Unit Summary
106
BIT450
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Test Your Knowledge
Test Your Knowledge 1.
In what form are the message formats of the message interfaces called from the Integration Repository for the generation of proxy objects? Choose the correct answer(s).
□ □ □ □
25-08-2005
A B C D
As HTML files. As WSDL files. As flat files. They have to be copied manually.
2.
If the message interface information in the Integration Builder is changed, how does this information get to the system where the message interface was used to generate proxy objects?
3.
Which tool is used to generate the necessary Java proxy objects?
© 2005 SAP AG. All rights reserved.
107
Test Your Knowledge
BIT450
Answers 1.
In what form are the message formats of the message interfaces called from the Integration Repository for the generation of proxy objects? Answer: B Web Service Description Language (WSDL) is used as the Internet standard.
2.
If the message interface information in the Integration Builder is changed, how does this information get to the system where the message interface was used to generate proxy objects? Answer: You have to regenerate the proxy objects. In the inbound case, the source text of the implementing method is not overwritten, but you may have to adjust it.
3.
Which tool is used to generate the necessary Java proxy objects? Answer: In Java programming, the proxy objects are generated directly in the Integration Repository (where the message interfaces were created) and saved in the file system as a Java archive.
108
© 2005 SAP AG. All rights reserved.
25-08-2005
Unit 3 Using Generated Proxy Objects Unit Overview You have already generated the necessary proxy objects. In this unit these objects will be used to send messages to the Integration Server (outbound using a client proxy) and process messages from the Integration Server (inbound using a server proxy).
Unit Objectives After completing this unit, you will be able to: • • • • • • •
Implement a generated server proxy method in ABAP Use a generated client proxy method in Java to generate a message and send it to the Integration Server Configure the integration scenario in the Integration Directory implement and configure a previously generated Java server proxy for generating and sending a message to the Integration Server. Use a generated client proxy method in ABAP to send a message to XI Describe how to use server proxies as a Web service Describe any inbound interface as a Web service
Unit Contents Lesson: ABAP Server Proxy Implementation ................................... 110 Exercise 11: Implementing an ABAP Server Proxy Method .............. 119 Lesson: Using Java Client Proxies ............................................... 124 Exercise 12: Using Java Client Proxy Methods ............................ 131 Lesson: Configuration in the Integration Directory ............................. 141 Exercise 13: Configuration in the Integration Directory ................... 145 Lesson: Java Server Proxy Implementation..................................... 151 Lesson: Using ABAP Client Proxies.............................................. 155 Exercise 14: Generating ABAP Client Proxy Objects ..................... 163 Lesson: Server Proxies, Web Services, and WSDL ........................... 167 Exercise 15: Checking a Web Service for a Server Proxy ................ 175
25-08-2005
© 2005 SAP AG. All rights reserved.
109
Unit 3: Using Generated Proxy Objects
BIT450
Lesson: ABAP Server Proxy Implementation Lesson Overview Introduction to the technology and main steps involved in server proxy implementation.
Lesson Objectives After completing this lesson, you will be able to: •
Implement a generated server proxy method in ABAP
Business Example You are an ABAP developer and have generated ABAP proxy objects. You now want to implement the inbound method.
Signature of Method to Be Implemented Before discussing the implementation of the method execute_ synchronous, it is useful to take another look at the method signature. An ABAP object interface and method have been generated from the message interface in the Integration Repository (including its outbound, inbound, and fault message types). This method has a signature that corresponds to these message types. When the message type names are mapped to the ABAP data structures, the UpperCamelCase method is employed, which means that each upper case letter in the message type name is assigned an underscore in the ABAP structure name (for example, UpperCamelCase -> UPPER_CAMEL_CASE).
110
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: ABAP Server Proxy Implementation
Figure 39: Signature of Method to Be Implemented
The object called CONTROLLER, which is displayed in the previous graphic, is added to every structure in the method signature as a data structure. The CONTROLLER object is a control table of type PRXCTRLTAB, containing information on whether or how the initial fields will appear in the message. In the standard procedure for inbound interfaces, if any tags are missing or empty, the default value is set before the application is called.
Extended XML Handling In ABAP, if an interface parameter is initial, you do not know whether the parameter was not assigned a value at all, or an initial value was transferred. In addition, the XSD standard specifies the procedure for default values. For proxy generation, the following standard procedure exists for server proxies: If element tags are empty or attribute tags are missing, inbound processing on the server side of the ABAP proxy runtime sets the default value before the application is called. If elements have an attribute nil = "true" or the element tag is absent altogether, the corresponding parameter is left initial. Optional, initial, scalable elements without a default value are suppressed in the message to improve performance. You can override this standard procedure. Regardless of whether or not you set the parameter EXTENDED_XML_HANDLING for the sender, at the receiver, you can set the ABAP proxy runtime to complete the control tables for fields. To do this, call the method
25-08-2005
© 2005 SAP AG. All rights reserved.
111
Unit 3: Using Generated Proxy Objects
BIT450
SET_EXTENDED_XML_HANDLING of the payload protocol, and set the parameter EXTENDED_XML_HANDLING (to ’X’). When parsing messages to this proxy, the ABAP proxy runtime then determines whether the field was transferred in the message, whether the field contained an initial value, or whether it had no value at all. The proxy runtime correspondingly completes a control table that can be evaluated by the application. DATA: lo_context TYPE REF TO if_ws_server_context, lo_payload_protocol TYPE REF TO if_wsprotocol_payload. lo_context = cl_proxy_access=>get_server_context( ). lo_payload_protocol ?= lo_context->get_protocol( if_wsprotocol=>payload ). lo_payload_protocol->set_extended_xml_handling( ’X’ ).
Hint: You can use the method GET_EXTENDED_XML_HANDLING to check whether you have activated the extended XML handling. Possible values for the VALUE field of the CONTROLLER table Value
Meaning
sai_ctrl_initial
Initial value was sent for the field.
sai_ctrl_nil
The value xsi:nil was sent in the message for this field.
sai_ctrl_none
The field was not part of the message.
Implementation (Synchronous) Once the server proxy has been generated, you implement the application functions. To do so, you have to perform the following steps: • • • • •
112
Transfer the message information from the interface to local variables Check the authorization, if necessary (and create error message, if necessary) Check that the information is correct and complete Process the information (and create error message, if necessary) Provide the interface with the message response (in synchronous case)
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: ABAP Server Proxy Implementation
These steps are the same as those for the implementation of other functions, for example a function module. The only difference is that the function interface is saved centrally in the Integration Repository at design time and cannot be changed locally during implementation. If the interface must be changed, you have to change the message interface in the Integration Repository and regenerate the proxy objects.
Figure 40: Implementing the Synchronous Inbound Method
The parameters INPUT and OUTPUT are available for the first and last step. Hint: If you change the message interface in the Integration Repository after the proxy objects have been generated, you can regenerate the proxy objects without overwriting the coding of the implementing method. Usually, you then have to adjust the coding to the changed interface.
25-08-2005
© 2005 SAP AG. All rights reserved.
113
Unit 3: Using Generated Proxy Objects
BIT450
Figure 41: Structure of Error Messages
If an error occurs when the inbound message is being checked, you can generate an exception by using the error class. You enter detailed information by using the table faultDetail. Hint: The structure of the standard error message corresponds to the data type ExchangeFaultData, which is automatically created in each namespace and automatically referenced in each fault message type (under standard data). You can also use the same error class if an error occurs during information processing, for example, if no data is found for the inbound information. A better solution, however, is to save another fault message type for the message interface in the Integration Repository. Of course, application error messages are only sent back to the sender in the case of synchronous messages. In the case of asynchronous messages the error messages are persisted, that is, kept for later analysis.
Setting and Triggering Application Errors DATA: l_fault type
,
l_detail type . l_fault-fault_text = <...>.
114
l_fault-fault_url
= <...>.
l_detail-severity
= <...>.
l_detail-text
= <...>.
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: ABAP Server Proxy Implementation
l_detail-id
= <...>.
l_detail-url
= <...>.
append l_detail to l_fault-fault_detail. RAISE EXCEPTION TYPE EXPORTING FAULT_DATA = l_fault.
The triggered error is sent to the Integration Server and then to the sender by means of the proxy runtime.
Figure 42: Example of Error Message Using Proxy Runtime
Implementation (Asynchronous) In the asynchronous case, the data is not returned to the OUTPUT structure, since a business message is not sent back to the sender.
25-08-2005
© 2005 SAP AG. All rights reserved.
115
Unit 3: Using Generated Proxy Objects
BIT450
Error Analysis for Server Proxy By using the ICF Server Recorder in transaction SICF, it is possible to record the incoming request and the corresponding response for access to HTTP services, including for the service /sap/xi/engine, which represents the inbox of the XI pipeline. The menu option Edit → Recorder in transaction SICF enables you to access the ICF Server Recorder. Three selection options are available: • • •
Activate recording Deactivate recording Display recording
Activate recording: First select the service that you want to record. Choose /sap/xi/engine, followed by the menu path Edit → Recorder → Activate Recording. When you activate a recording, you can enter user names to restrict the recording to the required users. Under URL path, enter the request path to be recorded by the ICF Recorder(the default setting is the service that you most recently selected). Here you can also set the recording time and lifetime (retention period for monitoring data in the database). By default, only the requests are recorded. If you also want to record the response, under Recording Level, select the option Request + Response. Deactivate Recording: After recording, you should always deactivate the ICF Server Recorder to prevent performance problems. To do this, choose the menu path Edit → Recorder → Deactivate Recording. On the following screen, you then need to select the user and then click on Deactivate. Display Recording: To display the recorded ICF communication data, choose the menu path Edit → Recorder → Display Recording. As for the recording, you can also choose restriction criteria here. Hint: Note that although you can record other users’ ICF communication data, you require special authorization to be able to view this data. To edit the recorded data, you must have authorization for the transaction SICFRECORDER. If you have the required authorizations, you can process the recorded communication data. Without additional authorization, you can only edit your own entries. Authorization object: S_ICFREC
116
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: ABAP Server Proxy Implementation
Debugging the Server Proxy If you have activated HTTP debugging for the user that will be used to access the server proxy, you can also debug the server proxy. • • • •
Log on as the user with which the server proxy will be accessed at runtime Navigate to the proxy method that you want to debug and choose Utilities / Settings Navigate to the ABAP Editor tab page and from there to the debugging tab page, and activate external debugging for the user that will access the server proxy Choose Utilities → Breakpoints → Set/Delete, and in the following window, choose External Debugging Hint: An external call is not usually made using the dialog user. For debugging, you may have to change the user for the call.
25-08-2005
© 2005 SAP AG. All rights reserved.
117
Unit 3: Using Generated Proxy Objects
118
© 2005 SAP AG. All rights reserved.
BIT450
25-08-2005
BIT450
Lesson: ABAP Server Proxy Implementation
Exercise 11: Implementing an ABAP Server Proxy Method Exercise Objectives After completing this exercise, you will be able to: • Implement an inbound proxy method in ABAP to process a message received by the Integration Server
Business Example You have already generated the proxy objects for an inbound message interface and are now responsible for implementing the functions in ABAP.
Task: Implement the method execute_synchronous of your implementing class Z##_CL_CUSTOMER_INFORMATION_PR in the business system SAP_BACKEND. 1.
Log on to the business system SAP_BACKEND and navigate to the proxy class Z##_CL_CUSTOMER_INFORMATION_PR that you have already created.
2.
Implement the method with an initial completeness check for the inbound data. If errors occur, you want this to trigger an exception with explanatory text. Otherwise, the method for the customer name searches for a hit in the table SCUSTOM. If it finds an entry, it returns it using the OUTPUT parameter. If not, it triggers an exception. Do not forget to activate your changes. Hint: For help with the solution, you can copy the example solution ABAP_inbound.txt by uploading it to your ABAP coding. The instructor can show you how to do this.
3.
25-08-2005
Test your method in the transaction SPROXY.
© 2005 SAP AG. All rights reserved.
119
Unit 3: Using Generated Proxy Objects
BIT450
Solution 11: Implementing an ABAP Server Proxy Method Task: Implement the method execute_synchronous of your implementing class Z##_CL_CUSTOMER_INFORMATION_PR in the business system SAP_BACKEND. 1.
Log on to the business system SAP_BACKEND and navigate to the proxy class Z##_CL_CUSTOMER_INFORMATION_PR that you have already created. a)
Log on to client 8xx in your SAP system. Use the logon parameters provided by the instructor.
b)
Call transaction SPROXY.
c)
Select the software component version SC_BIT450_CIS in the namespace http://bit450.com/xi/abap##. Navigate to the Message Interface (inbound) node and then to the message interface CustomerInformation_Provide.
d)
To display the generated objects, double click the message interface name CustomerInformation_Provide.
e)
To navigate to the editor, double click on the name of your implementing class Z##_CL_CUSTOMER_INFORMATION_PR and then double click on the name of the method execute_synchronous. Hint: If you know the name of your class, you can enter it directly in the Class Builder (transaction SE24). This is a quicker way to get to the method editor.
2.
Implement the method with an initial completeness check for the inbound data. If errors occur, you want this to trigger an exception with explanatory text. Otherwise, the method for the customer name searches for a hit in the table SCUSTOM. If it finds an entry, it returns it using the OUTPUT parameter. If not, it triggers an exception. Do not forget to activate your changes. Hint: For help with the solution, you can copy the example solution ABAP_inbound.txt by uploading it to your ABAP coding. The instructor can show you how to do this. Continued on next page
120
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: ABAP Server Proxy Implementation
a)
First declare the data structures: * Data structure to get data of input message Data: l_customer_name type Z##_customer_name. * Data structure to get data of output message data: l_customer_info type Z##_customer_info. * Data types generated * from fault message ’MissingInformation’: data: l_standard_data type Z##_EXCHANGE_FAULT_DATA, l_detail_data type Z##_EXCHANGE_LOG_DATA. * Structure to hold data selected from database: DATA: l_scustom type scustom.
b)
Receive the INPUT parameters in local parameters. l_customer_name = input-MT_NAME.
c)
Check whether the customer name is initial. If it is, trigger an exception: if l_customer_name is initial. l_standard_data-fault_text = ’No name was supplied’. ... RAISE Exception TYPE Z##_CX_MISSING_INFORMATION exporting standard = l_standard_data. endif.
d)
Read whether an entry exists for the name in the database table SCUSTOM: select single * from scustom into corresponding fields of l_scustom where name = l_customer_name.
e)
Check whether an entry is found. If not, trigger an exception and use a corresponding error text: if l_scustom is initial. l_standard_data-fault_text = ’No customer found’. ... RAISE Exception TYPE Z##_CX_MISSING_INFORMATION exporting standard = l_standard_data. endif.
f)
If an entry is found, enter the results in the OUTPUT parameter CUSTOMER_INFO: move-corresponding l_scustom to l_customer_info. Continued on next page
25-08-2005
© 2005 SAP AG. All rights reserved.
121
Unit 3: Using Generated Proxy Objects
BIT450
output-mt_customer_info = l_customer_info. 3.
Test your method in the transaction SPROXY. a)
In the transaction SPROXY, you can test your server proxy directly if it is displayed in the right-hand area of the details screen by choosingTest.
b)
In the Enter Application Data area, choose the options Generate Template Data and XML Editor. Choose Execute (F8).
c)
On the following screen you can edit the message that will be processed by your method. In the tag MtName, enter a valid customer name (for example, SAP AG), and choose Execute (F8). The next screen Display Result displays the result of your method call. On the left-hand side, open the folder Inbound Processing and double click to open the area Payload after Service. Check the result of the call. To exit the screen, choose F8.
d)
122
Repeat the test call, but this time leave the MtName tag empty to check whether an error message appears. Do another test, using a customer name for which no entry exists, to check the response in this case.
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: ABAP Server Proxy Implementation
Lesson Summary You should now be able to: • Implement a generated server proxy method in ABAP
25-08-2005
© 2005 SAP AG. All rights reserved.
123
Unit 3: Using Generated Proxy Objects
BIT450
Lesson: Using Java Client Proxies Lesson Overview This lesson introduces the generated Java proxy objects and explains how to use them.
Lesson Objectives After completing this lesson, you will be able to: •
Use a generated client proxy method in Java to generate a message and send it to the Integration Server
Business Example You are a member of an integration project team and are responsible for programming outbound processing using generated Java proxy objects, and therefore need to develop the Java application.
Using Generated Proxy Objects Once you have generated the Java proxy objects in the Integration Repository, you can use them in your own application. As well as the generated class and its method, it is also important to know the data types, data structures, and possible exceptions. You can use a standard Java IDE (Integrated Development Environment) such as the SAP NetWeaver Developer Studio to represent this. You can also use javadoc to generate HTML documentation for the generated Java proxy classes: javadoc -d . For example: javadoc *.java -d \doc\ (if the “doc” directory has already been created). The process for an outgoing message is illustrated in the following diagram.
124
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Using Java Client Proxies
Figure 43: Outbound Java Scenario
You have to perform the following steps in your own application: • • • • • •
Generate the proxy bean Declare the required objects Compile the information to be sent Call the client proxy method Catch any exceptions Receive the response message (in the synchronous case)
In XI 2.0, it was possible to generate and send synchronous Java outbound proxies using a J2SE application. In XI 3.0, all Java proxy applications are Enterprise Java Beans and therefore represent a J2EE application. This also changes the calling behavior of the client application. Proceed as follows: • • •
Create the JNDI context Locate the home interface of the proxy bean Generate the remote interface
Unlike the ABAP proxy method, the classes, interfaces and the method in the Java outbound scenario each have a name that is generated from the message interface name. The classes and interfaces are assigned the suffix _PortType and an ending that identifies their purpose. The method retains its name, but begins with a lower-case letter and does not contain any underscores. For an existing
25-08-2005
© 2005 SAP AG. All rights reserved.
125
Unit 3: Using Generated Proxy Objects
BIT450
message interface CustomerInformation_Request, this means that a method customerInformationRequest is generated, along with the following classes and interfaces: • • • •
CustomerInformationRequest_PortType - Proxy class CustomerInformationRequest_PortTypeHome - Home interface CustomerInformationRequest_PortTypeRemote - Remote interface CustomerInformationRequest_PortTypeBean - Implementation
A client proxy bean can be called by a variety of applications such as servlets, JSPs, applets, or even J2SE applications. The example coding illustrates the required steps.
Generating and Calling a Proxy Bean // Generating the initial JNDI context Context ctx = new InitialContext(); // Using the JDNI name to locate the home interface Object obj = ctx.lookup("bit450.com/sales/CustomerInformationXX"); // Casting the Home Interface CustomerInformationRequest_PortTypeHome homeInterface = (CustomerInformationRequest_PortTypeHome) obj; // Using the home interface to create the remote interface CustomerInformationRequest_PortTypeRemote remoteInterface = homeInterface.create();
// Generating the query object PersonName_Type person = new PersonName_Type(); // ...Filling the query object person // Calling the proxy method to create and send the message CustomerInfo_Type custInfo = remoteInterface.customerInformationRequest(person);
Hint: The names of the objects homeInteface, remoteInteface, personand custInfo are selected arbitrarily.
126
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Using Java Client Proxies
For complex data types, you use the setter methods of the generated classes to set the parameters of the outbound message. Hint: In Java, methods that are used to change (set) or call (get) object attributes (properties) are called setter/getter methods. A class called PersonName_Type is created for a complex data type PersonName stored in the Integration Repository. This class has the fields of the complex data type as attributes (surname and name) and provides setter and getter methods: setSurname() for setting the surname. Using the above coding example, you could set the complex data type PersonName as follows:
Setting the Complex Data Type PersonName_Type person = new PersonName_Type(); person.setName("SAP"); person.setSurname("AG");
The same applies to receiving the response message in a synchronous scenario. In this case the getter methods would be used. Example:
Accessing the Attributes of the Response Message // Call proxy method CustomerInfo_Type custInfo = remoteInterface.customerInformationRequest(person); // Reading the attributes String ID = custInfo.getID().toString(); String city = custInfo.getCITY();
In addition to the exceptions stored in the message interface, you must also catch any system exceptions that occur, for example, if the Integration Server cannot find a receiver due to configuration errors. The exception class (com.sap.aii.proxy.xiruntime.core)ApplicationFaultException is available in Java for this purpose. You can also use the superordinate class of all application classes
25-08-2005
© 2005 SAP AG. All rights reserved.
127
Unit 3: Using Generated Proxy Objects
BIT450
(com.sap.aii.proxy.xiruntime.core)SystemFaultException to catch any application exceptions. In the asynchronous case, the application errors are persisted (saved) in the target system.
Catching Exceptions try { custInfo = custInfoReq.customerInformationRequest(person); } catch (MissingInformation_Message_Exception e) { errorType = "Missing Information"; errorText = e.getMessage(); error = true; } catch (SystemFaultException e) { errorType = "System Fault Exception occurred"; errorText = e.getMessage(); error = true; } catch (ApplicationFaultException e) { errorType = "Application Fault Exception occurred"; errorText = e.getMessage(); error = true; } catch (Exception e) { errorType = "Other occurred"; errorText = e.getMessage(); error = true; }
The additional parameter MessageSpecifier enables you to use further proxy runtime services, for example, adding an additional attachment to the message.
MessageSpecifier:
Additional Attachment
try { custInfo = custInfoReq.customerInformationRequest(person); // Sends an additional document (addData is Object Date type) custInfo.$messageSpecifierRead().createAttachment("AddData", "text/html", addData) }
128
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Using Java Client Proxies
You can also use the MessageSpecifier object to set the logical receiver system, for example. However, note that this procedure does not comply with the central information collection concept in SAP Exchange Infrastructure. Technical changes in particular must then be configured locally. On the other hand, functions such as saving the message after it has been sent successfully are not critical. Default and Initial Values: In the Java outbound case, the default value is set for all initial fields when the XML data stream is generated. Optional, initial, scalable elements without a default value are suppressed in the message to improve performance. The zero pointer in Java is converted to xsd:nil.
Deployment of Java Proxies You must ensure that the proxy beans and proxy classes generated by Java proxy generation are deployed together with the application program. To do this, include them in the same EAR file as the classes of your application. The generated classes depend on the classes of the Java proxy runtime, which must be installed on the J2EE server. To declare this dependency for EJB applications, copy the following packages into the descriptor file application-j2ee-engine.xml: • • • •
com.sap.aii.proxy.xiruntime com.sap.aii.af.sdk.xi com.sap.xi.util.misc com.sap.guid
All library dependencies are of the type weak and have the provider namesap.com.
25-08-2005
© 2005 SAP AG. All rights reserved.
129
Unit 3: Using Generated Proxy Objects
130
© 2005 SAP AG. All rights reserved.
BIT450
25-08-2005
BIT450
Lesson: Using Java Client Proxies
Exercise 12: Using Java Client Proxy Methods Exercise Objectives After completing this exercise, you will be able to: • Use generated proxy objects for an outbound message interface to send a message to the Integration Server
Business Example You are responsible for a scenario in which a JSP application calls information from a back end using the Integration Server. You are also responsible for implementing the proxy method call.
Task: Create a J2EE application that sends a message to the Integration Server by calling the client proxy method. 1.
In the SAP NetWeaver Developer Studio, in the project Exc_Sales_EJB, open the subfolder EJB Candidates. In this subfolder, add the candidate CustomerInformationRequest_PortTypeBean to ejb-jar.xml.
2.
Open the vendor-specific deployment descriptor (ejb-j2ee-engine.xml) and assign the EJB that you have just created the JNDI name bit450.com/sales/CustomerInformation## Hint: The JNDI name is used to find and reference a software component in the J2EE server.
3.
Create the EJB archive for your EJB project.
4.
Open the Web project Exc_Sales_Web in the Project Navigator view and navigate to the class com.bit450.sales.CustomerInformationCheck.
5.
Implement the method checkCustomerInfo in the class com.bit450.sales.CustomerInformationCheck so that the bean class of the JNDI context is used, the required data types are declared and filled, the message is sent, and the result is received.
Continued on next page
25-08-2005
© 2005 SAP AG. All rights reserved.
131
Unit 3: Using Generated Proxy Objects
BIT450
To do this, adjust the variable JNDI_NAME and the import statements to include your group number. The transfer parameters surName and name should be used to fill the class PersonName_Type with values. Assign the return value to the variable cisResult. If an error occurs, enter the relevant values in the fields errorType, errorText and error. If the is successful, the return structure CustomerInfo is issued in a JSP (customerinformationresult.jsp), if an error occurs, the corresponding error message is displayed. The complete presentation logic is already implemented in the form of JSPs and can be copied. Hint: To view the example solution, see the class com.bit450.sales.CustomerInformationCheck in the project Sol_Sales_Web. 6.
Create the Web archive for your Web project.
7.
Optional: Enter your group number in the header line of your JSP.
8.
Create a new Enterprise Application Project with the name Exc_Sales_EAR_##. Assign the two projects Exc_Sales_EJB and Exc_Sales_Web to this.
9.
Change the context /sales## for your Web application in the file application.xml (Modules tab) to include your group number.
10. The proxy beans and proxy classes that you have generated are dependent on the Java proxy framework, which must be installed on the J2EE server. To declare this dependency for EJB applications, copy the following packages to the descriptor file application-j2ee-engine.xml: com.sap.aii.proxy.xiruntime com.sap.aii.af.sdk.xi com.sap.xi.util.misc com.sap.guid All library dependencies are of the type weak and have the provider name sap.com. 11. In the SAP NetWeaver Developer Studio, store the parameters for the SAP J2EE Engine provided by the instructor. 12. Create the Enterprise Application Archive for your EAR project and deploy your EAR in the J2EE server. 13. Start your application using the URL http://:/sales## and send a query to check whether the message has arrived on the Integration Server. 14. Check the inbound message in the monitor on the Integration Server.
132
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Using Java Client Proxies
Solution 12: Using Java Client Proxy Methods Task: Create a J2EE application that sends a message to the Integration Server by calling the client proxy method. 1.
2.
In the SAP NetWeaver Developer Studio, in the project Exc_Sales_EJB, open the subfolder EJB Candidates. In this subfolder, add the candidate CustomerInformationRequest_PortTypeBean to ejb-jar.xml. a)
Start the SAP NetWeaver Developer Studio (or switch to the NWDS if it is already open). In the EJB Explorer, select the project Exc_Sales_EJB and open the subfolder EJB Candidates.
b)
In the context menu, choose Add to ejb-jar.xml for the EJB candidate CustomerInformationRequest_PortTypeBean.
Open the vendor-specific deployment descriptor (ejb-j2ee-engine.xml) and assign the EJB that you have just created the JNDI name bit450.com/sales/CustomerInformation## Hint: The JNDI name is used to find and reference a software component in the J2EE server. a)
Double click to open the file ejb-j2ee-engine.xml.
b)
Click on the tab Enterprise Beans and open the subfolder Session Beans. The EJB CustomerInformationRequest_PortTypeBean that you have just created is displayed. Click on your EJB to select it. A list of input fields is displayed on the right-hand side.
c)
In the field JNDI name, enter your group-specific JNDI name (bit450.com/sales/CustomerInformation##).
d)
Save your setting, for example, with CTRL+S.
Continued on next page
25-08-2005
© 2005 SAP AG. All rights reserved.
133
Unit 3: Using Generated Proxy Objects
3.
4.
5.
BIT450
Create the EJB archive for your EJB project. a)
Switch to the J2EE Explorer view (on the left).
b)
Open the context menu for the root element (Project) Exc_Sales_EJB. Select the menu option Build EJB Archive.
c)
You receive a confirmation message, and the entry Exc_Sales_EJB.jar is displayed in Exc_Sales_EJB.
Open the Web project Exc_Sales_Web in the Project Navigator view and navigate to the class com.bit450.sales.CustomerInformationCheck. a)
To the left of the J2EE Explorer view, switch to the Navigator view.
b)
Select the project Exc_Sales_Web and in the context menu, choose Project → Open Project.
c)
Now return to the J2EE Explorer view. The project Exc_Sales_Web is displayed.
d)
In the project Exc_Sales_Web, open the path source / com / bit450 / sales and double click to open the class com.bit450.sales.CustomerInformationCheck.
Implement the method checkCustomerInfo in the class com.bit450.sales.CustomerInformationCheck so that the bean class of the JNDI context is used, the required data types are declared and filled, the message is sent, and the result is received. To do this, adjust the variable JNDI_NAME and the import statements to include your group number. The transfer parameters surName and name should be used to fill the class PersonName_Type with values. Assign the return value to the variable cisResult. If an error occurs, enter the relevant values in the fields errorType, errorText and error. If the is successful, the return structure CustomerInfo is issued in a JSP (customerinformationresult.jsp), if an error occurs, the corresponding error message is displayed. The complete presentation logic is already implemented in the form of JSPs and can be copied. Hint: To view the example solution, see the class com.bit450.sales.CustomerInformationCheck in the project Sol_Sales_Web.
Continued on next page
134
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Using Java Client Proxies
a)
In the Import statement and in the declaration of the string JNDI_NAME, change the placeholder ## to your group number. Hint: In the SAP NetWeaver Developer Studio, you can use the Tasks tab at the bottom to produce a list of TODOs. You can double click to navigate to the positions that must be edited.
b)
The following points refer to the method checkCustomerInfo: Get the home interface from the JNDI context, and use it to generate the remote interface: Context ctx = new InitialContext(); CustomerInformationRequest_PortTypeHome cisHome = (CustomerInformationRequest_PortTypeHome) ctx.lookup(JNDI_NAME); CustomerInformationRequest_PortTypeRemote cisRemote = cisHome.create();
c)
Declare the required data structure and fill it: PersonName_Type requestType = new PersonName_Type(); requestType.setName(name); requestType.setSurname(surName);
d)
Call the method customerInformationRequest on the remote interface and assign the result of the variable cisResult to: cisResult = cisRemote.customerInformationRequest(requestType);
e)
Catch any exceptions that occur in the application: } catch (RemoteException e) { errorType = "Remote exception occurred"; errorText = e.getMessage(); error = true; } catch (NamingException e) { errorType = "Naming exception occurred"; errorText = e.getMessage(); error = true; } catch (CreateException e) { errorType = "Creation exception occurred"; Continued on next page
25-08-2005
© 2005 SAP AG. All rights reserved.
135
Unit 3: Using Generated Proxy Objects
BIT450
errorText = e.getMessage(); error = true; } catch (MissingInformation_Message_Exception e) { errorType = "Missing Information"; errorText = e.getMessage(); error = true; } catch (SystemFaultException e) { errorType = "System Fault Exception occurred"; errorText = e.getMessage(); error = true; } catch (ApplicationFaultException e) { errorType = "Application Fault Exception occurred"; errorText = e.getMessage(); error = true; } catch (Exception e) { errorType = "System Exception occurred"; errorText = e.getMessage(); error = true; } 6.
7.
Create the Web archive for your Web project. a)
If necessary, switch to the J2EE Explorer view.
b)
Use the context menu Build WEB Archive for the project Exc_Sales_Web.
c)
After you have successfully generated the Web archive (WAR), a success message is displayed.
Optional: Enter your group number in the header line of your JSP. a)
In the project Exc_Sales_Web, double click to open the file WebContent / headerline.html.
b)
In the HTML page display, choose the Source tab.
c)
Navigate to the middle and change the string “BIT450-## JSP Client” to your group number.
d)
Save the file headerline.html. You can then close the file.
Continued on next page
136
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Using Java Client Proxies
8.
9.
Create a new Enterprise Application Project with the name Exc_Sales_EAR_##. Assign the two projects Exc_Sales_EJB and Exc_Sales_Web to this. a)
Choose File → New → Enterprise Application Project.
b)
Assign the name Exc_Sales_EAR_## and click on Next.
c)
In the next window, select your projects Exc_Sales_EJB and Exc_Sales_Web, and choose Finish.
d)
In the J2EE Explorer, a new project Exc_Sales_EAR_## is listed, which contains the subnodes application-j2ee-engine.xml and application.xml.
Change the context /sales## for your Web application in the file application.xml (Modules tab) to include your group number. a)
In the project Exc_Sales_EAR_##, double click to open the file application.xml.
b)
On the Modules tab, select your Web Application Exc_Sales_Web.war.
c)
In the Context Root field, enter the context /sales##.
d)
Save the file. You can now also close the file if required.
10. The proxy beans and proxy classes that you have generated are dependent on the Java proxy framework, which must be installed on the J2EE server. To declare this dependency for EJB applications, copy the following packages to the descriptor file application-j2ee-engine.xml: com.sap.aii.proxy.xiruntime com.sap.aii.af.sdk.xi com.sap.xi.util.misc com.sap.guid
Continued on next page
25-08-2005
© 2005 SAP AG. All rights reserved.
137
Unit 3: Using Generated Proxy Objects
BIT450
All library dependencies are of the type weak and have the provider name sap.com. a)
In your project Exc_Sales_EAR_##, double click to open the file application-j2ee-engine.xml. Perform the following steps for all four of the packages listed above:
b)
Select the entry references.
c)
Use the Add button to define a new reference.
d)
In the next window, choose Create New. In the definition, for Reference Target, set the corresponding package from the above list, Reference type is weak, Reference target type is library, and the Provider name is sap.com. (To reference the next package, select the entry references.)
e)
When you have referenced all four packages, save the file application-j2ee-engine.xml. You can now also close the file if required.
11. In the SAP NetWeaver Developer Studio, store the parameters for the SAP J2EE Engine provided by the instructor. a)
Navigate to the menu Windows → Preferences.
b)
In the Preferences window, select the entry SAP J2EE Engine on the left, and on the right, choose SAP J2EE engine is installed on remote host.
c)
In the fields Message Server Host and Message Server Port, enter the values supplied by the instructor.
d)
Exit maintenance by choosing Apply and OK.
e)
Optionally, you can select the tab J2EE Engine on the bottom right-hand side to view the status of the J2EE Engine.
Continued on next page
138
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Using Java Client Proxies
12. Create the Enterprise Application Archive for your EAR project and deploy your EAR in the J2EE server. a)
If necessary, switch to the J2EE Explorer view.
b)
In the context menu for the project Exc_Sales_EAR_##, choose Build Application Archive.
c)
A success message is displayed and the file Exc_Sales_EAR.ear is listed in the project Exc_Sales_EAR_##.
d)
Now use the context menu for the file Exc_Sales_EAR.ear and choose Deploy to J2EE engine. Enter the password supplied by the instructor. In the Deploy Output View, you can display the log outputs and error messages of the deployment process. The last message should be “Finished Deployment”.
13. Start your application using the URL http://:/sales## and send a query to check whether the message has arrived on the Integration Server. a)
Open a browser and enter the URL http://:/sales##.
b)
Use the test data Name = SAP and Surname = AG and send the query.
c)
You get an error message indicating that the configuration is missing in the Integration Directory (“no receiver”).
14. Check the inbound message in the monitor on the Integration Server.
25-08-2005
a)
Log on to the Integration Server (client 800). Call transaction SXMB_MONI and start the monitor for processed XML messages. On the selection screen, enter WEBAS_JAVA in the Sender Business System field, and choose Execute to start the monitor.
b)
Navigate to the detail view of your message and check the message structure by choosing Inbound Message → Payloads → Main Document.
© 2005 SAP AG. All rights reserved.
139
Unit 3: Using Generated Proxy Objects
BIT450
Lesson Summary You should now be able to: • Use a generated client proxy method in Java to generate a message and send it to the Integration Server
140
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Configuration in the Integration Directory
Lesson: Configuration in the Integration Directory Lesson Overview In this lesson, the necessary configuration settings for the integration scenario are made in the Integration Directory, so that the Java standalone application receives a response from the ABAP proxy object.
Lesson Objectives After completing this lesson, you will be able to: •
Configure the integration scenario in the Integration Directory
Business Example You are a member of a project team. Once the proxy objects have been used, you are responsible for making the configuration settings in the Integration Directory.
Receiver Determination First, you have to create an integration scenario in the Integration Directory, which will contain the configuration settings. In XI 2.0, this integration scenario is not related to the integration scenarios in the Integration Repository. To create a receiver determination, you have to specify the following sender information: business system, (outbound) interface name, and interface namespace. You can create one or more receivers for this sender, and also a condition to determine when a message is sent to these receivers.
Interface Determination You have to create an interface determination for the receiver that is entered in the receiver determination. This involves specifying one or more (inbound) interface names and interface namespaces. You use an interface mapping from the Integration Repository for each interface.
25-08-2005
© 2005 SAP AG. All rights reserved.
141
Unit 3: Using Generated Proxy Objects
BIT450
Figure 44: Configuration Overview Integration Directory
Communication Channel for Integration Engines If a business system has an ABAP Integration Engine, you have to use a communication channel of type Integration Engine. In the current integration scenario, this communication channel must therefore refer to the business system Training. You either create the communication channel as a URL, or as a reference to an SM59 destination. If using the URL option, the required entry is http://:/sap/xi/engine/?type=receiver.
Figure 45: Communication Channel of Local Integration Engine
142
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Configuration in the Integration Directory
If the communication channel is an SM59 destination, you have to maintain it in the ABAP part of the Integration Server. It must reference the local Integration Engine of the business system. As an http destination it must therefore have the following properties: Name
Any name, in upper case letters, in this case: XI_TRAINING
Connection Type
H (HTTP destination for R/3 system)
Target Host
Back-end Host (in this case: localhost)
Service Number
8000 (ABAP HTTP port)
Path Prefix
/sap/xi/engine/?type=receiver (ICM service for local Integration Engine)
Logon Data
(user/pw/language/client of target system)
You then create a communication channel of type Integration Engine in the Integration Directory. In the communication channel, you can either specify the receiver parameters with interface names and namespace, or enter generic placeholders (*). J2EE Integration Engine: If the receiver system is a business system based on an SAP J2EE server with proxy objects, the URL entry in the communication channel must be as follows: http://:/MessagingSystem/receive/JPR/XI. Once you have completed the above steps, you will be able to use the integration scenario to display and call all the maintained configurations.
25-08-2005
© 2005 SAP AG. All rights reserved.
143
Unit 3: Using Generated Proxy Objects
144
© 2005 SAP AG. All rights reserved.
BIT450
25-08-2005
BIT450
Lesson: Configuration in the Integration Directory
Exercise 13: Configuration in the Integration Directory Exercise Objectives After completing this exercise, you will be able to: • Create a configuration scenario in the Integration Directory by copying an integration scenario from the Integration Repository. • Configure the synchronous exercise scenario in the Integration Directory
Business Example You are responsible for configuring a scenario in which a Java application calls information from a back end using the Integration Server.
Task: Configuration in the Integration Directory You make the settings for routing and mapping messages in the Integration Directory. This is where you configure the Integration Repository objects that were created at design time. The following tasks take you through the individual steps that are required to configure the synchronous scenario. Configure the synchronous scenario that was described in the lesson “Business Scenarios in the Integration Repository” Create a configuration scenario by copying the integration scenario from the Integration Repository. 1.
Log on to the Integration Server. From the menu, start the Integration Builder and log on to the Integration Directory.
2.
In the Integration Directory, create the configuration scenario BIT450_Sync_## by copying the integration scenario BIT450_Scenario1_##.
3.
In the configuration scenario BIT450_Sync_## that you created previously, use the automatic Integration Scenario Configurator to save a configuration with the following information: Sender
Receiver
Business System
WEBAS_JAVA
Interface Name
CustomerInformation_Request
Interface Namespace
http://bit450.com/xi/java##
Business System
SAP_BACKEND
Interface Name
CustomerInformation_Provide Continued on next page
25-08-2005
© 2005 SAP AG. All rights reserved.
145
Unit 3: Using Generated Proxy Objects
Interface Mapping
BIT450
Interface Namespace
http://bit450.com/xi/abap##
Interface Mapping Name
CustomerInfoMap
IF Mapping Namespace
http://bit450.com/xi/java##
SWCV
SC_BIT450_SALES 1.0
Communication Channel
SAP_Proxy_In
HTTP Destination
SAP_BACKEND_IE
Connection
4.
146
To check the configuration, resend a message from your Java application (http://:/sales##.
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Configuration in the Integration Directory
Solution 13: Configuration in the Integration Directory Task: Configuration in the Integration Directory You make the settings for routing and mapping messages in the Integration Directory. This is where you configure the Integration Repository objects that were created at design time. The following tasks take you through the individual steps that are required to configure the synchronous scenario. Configure the synchronous scenario that was described in the lesson “Business Scenarios in the Integration Repository” Create a configuration scenario by copying the integration scenario from the Integration Repository. 1.
Log on to the Integration Server. From the menu, start the Integration Builder and log on to the Integration Directory. a)
2.
3.
Choose Exchange Infrastructure: Integration Builder → Start Integration Builder or call transaction SXMB_IFR. Choose Directory (Configuration). The user name and password are the same as those required to log on to the Integration Server.
In the Integration Directory, create the configuration scenario BIT450_Sync_## by copying the integration scenario BIT450_Scenario1_##. a)
Choose Tools → Copy Integration Scenario from the Integration Repository.
b)
Use the F4 help to select your integration scenario BIT450_Scenario1_## and choose Continue to confirm.
c)
Enter the name of the configuration scenario: BIT450_Sync_## and confirm by choosing Finish and Close.
In the configuration scenario BIT450_Sync_## that you created previously, use the automatic Integration Scenario Configurator to save a configuration with the following information: Sender
Receiver
Business System
WEBAS_JAVA
Interface Name
CustomerInformation_Request
Interface Namespace
http://bit450.com/xi/java##
Business System
SAP_BACKEND
Interface Name
CustomerInformation_Provide Continued on next page
25-08-2005
© 2005 SAP AG. All rights reserved.
147
Unit 3: Using Generated Proxy Objects
Interface Mapping
BIT450
Interface Namespace
http://bit450.com/xi/abap##
Interface Mapping Name
CustomerInfoMap
IF Mapping Namespace
http://bit450.com/xi/java##
SWCV
SC_BIT450_SALES 1.0
Communication Channel
SAP_Proxy_In
HTTP Destination
SAP_BACKEND_IE
Connection
a)
Step 1 Select component view: As only one view is available, you can skip this step.
b)
Step 2: Assign services: Select the application components to which you want to assign a service (for example, SALES). Choose Assign Service. Choose the pushbutton with the green cross to insert a line, and then use the F4 help to assign the service: for the component SALES, this is the service WEBAS_JAVA, for the component CustomerInfoSystem, this is the service SAP_BACKEND.
c)
Step 3: Configure connections: Select the connection that you want to configure and click on Configure Connections. Assign the communication channel SAP_Proxy_In to the receiver SAP_BACKEND and check the mapping settings.
d)
Step 4: Generate: Generate the objects by clicking on Generate. Under Settings – General, choose Generate and leave the rest of the settings on the default values. Choose Start to confirm.
e)
Display the resulting log. Close the log window. You do not need to save.
f)
Close the Integration Scenario Configurator window and save the changes.
g)
On the Change Lists tab, in the navigation toolbar (left of the window), activate your change list by clicking the right mouse button and choosing Activate from the context menu.
Continued on next page
148
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Configuration in the Integration Directory
4.
To check the configuration, resend a message from your Java application (http://:/sales##. a)
Open a browser and enter the URL http://:/sales##.
b)
Use the test data Name = SAP and Surname = AG and send the query.
c)
You will see the correct response from the target system (incl. your group number).
d)
You can also call transaction SXMB_MONI in client 800 and use the monitor for processed XML messages. On the selection screen, enter WEBAS_JAVA in the Sender Business System field, and choose Execute to start the monitor. Your message is displayed with a checked flag icon, which indicates that it has been processed successfully.
25-08-2005
© 2005 SAP AG. All rights reserved.
149
Unit 3: Using Generated Proxy Objects
BIT450
Lesson Summary You should now be able to: • Configure the integration scenario in the Integration Directory
150
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Java Server Proxy Implementation
Lesson: Java Server Proxy Implementation Lesson Overview Introduction to Java inbound proxy implementation.
Lesson Objectives After completing this lesson, you will be able to: •
implement and configure a previously generated Java server proxy for generating and sending a message to the Integration Server.
Business Example You are a member of an integration project team and are responsible for programming inbound processing using generated Java proxy objects, and therefore need to implement and configure the server proxy.
Java Server Proxy Implementation You have created an inbound message interface for your service in the Integration Repository. You can use Java proxy generation to generate server proxy beans and server proxy classes and include them in your application.
Figure 46: Java Inbound Proxy Implementation
25-08-2005
© 2005 SAP AG. All rights reserved.
151
Unit 3: Using Generated Proxy Objects
BIT450
On the receiver side, the JPR proxy server listens for inbound messages from the messaging system. The JPR proxy server forwards the message to the corresponding server bean using the Java proxy runtime. This bean must be registered in the JPR registry. This bean uses the generated server-proxy interface to call the implementing class on the J2EE server. The implementing class must have the following properties: • •
It must implement the generated server-proxy interface. The name of the implementing class is fixed. It comprises the name of the server-proxy interface and the suffix Impl. The class must be derived from the class AbstractProxy.
•
If your message interface has the name RequestInformationReceive, then the Java interface RequestInformationReceive_PortType is generated from it that you must implement using the class RequestInformationReceive_PortTypeImpl:
public class RequestInformationReceive_PortTypeImpl extends AbstractProxy implements RequestInformationReceive_PortType { public void requestInformationReceive(RequestInfo_Type mtRequestInformations) throws SystemFaultException, ApplicationFaultException {...} }
The server-proxy interface must then be registered on the proxy registry. This is necessary so that the proxy server can identify the correct server proxy classes for inbound messages from the Integration Server. To inform the proxy server of this assignment, you use a proxy server servlet that you can contact using the Web browser. Using the proxy server servlet, you gain synchronized access to the JPR registry so that the entries within a cluster environment of the SAP J2EE Engine remain consistent. For an overview of the available commands, enter the following URL in the Web browser: http://:/ProxyServer. You can use the following command to register the message interface RequestInformation_Receive with the namespace http://bit450.com/xi/marketingXX and assign it to the server bean bit450.com/marketing/CustomerInformationXX and the calling method requestInformationReceive.
152
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Java Server Proxy Implementation
Registering the Java Proxy http://:/ProxyServer/register ?ns=http://bit450.com/xi/marketingXX &interface=RequestInformation_Receive &bean=bit450.com/marketing/CustomerInformationXX &method=requestInformationReceive
25-08-2005
© 2005 SAP AG. All rights reserved.
153
Unit 3: Using Generated Proxy Objects
BIT450
Lesson Summary You should now be able to: • implement and configure a previously generated Java server proxy for generating and sending a message to the Integration Server.
154
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Using ABAP Client Proxies
Lesson: Using ABAP Client Proxies Lesson Overview Introduction to the generated objects and using the method for an outbound message.
Lesson Objectives After completing this lesson, you will be able to: •
Use a generated client proxy method in ABAP to send a message to XI
Business Example You are an ABAP developer and have already generated the ABAP proxy objects. You now want to know how to use the classes and methods for an outbound call.
Using Generated Proxy Objects Once you have generated the proxy objects using transaction SPROXY, you can use them in your own application. As well as the generated class and its method (execute_synchronous in the synchronous case), it is also important to know the data types, data structures, and possible exceptions. You can check this in transaction SPROXY. The following graphic illustrates the flow of an outbound message for the synchronous and asynchronous case.
25-08-2005
© 2005 SAP AG. All rights reserved.
155
Unit 3: Using Generated Proxy Objects
BIT450
Figure 47: Processing Steps for Outbound Messages
You have to perform the following steps in your own application: • • • • • •
Declare the required types Compile the information to be sent Call the client proxy method Set a commit work (in the asynchronous case) Catch any exceptions Receive the response message (in the synchronous case) Hint: In XI 2.0, the client proxy method was a class method. This means that when you use client proxies on an SAP WebAS 6.20 system, you do not have to generate an instance. As of XI 3.0, (and hence for SAP WebAS from 6.40), the client proxy method is an object method. This means that an instance (an object) of the class must first be generated before the execute_synchronous method can be called.
156
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Using ABAP Client Proxies
Figure 48: Proxy Programming Model for SAP XI 2.0 and 3.0
Hint: The ABAP report SXIVERI_PROXY_GENVERS_CHECK provides support for the migration of proxy objects from XI 2.0 to XI 3.0. It lists proxy objects with an outdated generation version. You also have to catch any system exceptions which occur in addition to the exceptions saved in the message interface, for example, if the Integration Server cannot find a receiver due to configuration errors. The exception class CX_AI_SYSTEM_FAULT is available in ABAP for this purpose. You can also use the superordinate class of all application classes CX_AI_APPLICATION_FAULT to catch any application exceptions. In the asynchronous case, the application errors are persisted (saved) in the target system.
25-08-2005
© 2005 SAP AG. All rights reserved.
157
Unit 3: Using Generated Proxy Objects
BIT450
Figure 49: Schema of an ABAP Outbound Call
If an application error occurs, you have to look at all detailed messages in a loop by using the table faultDetail.
Figure 50: Structure of an Application Error Message
158
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Using ABAP Client Proxies
Extended XML Handling In ABAP, if an interface parameter is initial, you do not know whether the parameter was not assigned a value at all, or an initial value was transferred. In addition, the XSD standard specifies the procedure for default values. For proxy generation, this results in the following standard behavior for client proxies: when the XML data stream is generated, the default value is set in all initial fields. Optional, initial, scalable elements without a default value are suppressed in the message to improve performance. You can override this standard procedure. For rendering/parsing the XML data stream, there is a special mode in which it is permitted, for example, to explicitly suppress certain tags, set them to XSI:NIL, and so on. As this mode is very performance-intensive, you have to activate it explicitly by selecting a flag. CREATE OBJECT lo_abc. lo_payload_protocol ?= lo_abc->get_protocol( if_wsprotocol=>payload ). lo_payload_protocol->set_extended_xml_handling (X). CALL METHOD lo_abc->excecute_asynchronous ...
Hint: The method GET_PROTOCOL returns an object of the type IF_WSPROTOCOL. IF_WSPROTOCOL_ASYNC_MESSAGING implements IF_WSPROTOCOL, so you need to perform a type casting: lo_async_messaging ?= ....
IF_WSPROTOCOL contains all available protocols as constants The ABAP proxy generation functions generate control tables of type PRXCTRLTAB (line type PRXCTRL) for each complex type. This component is called CONTROLLER. Using this table you can define for each individual field whether it is to occur in the message, and how. For a table line, set the FIELD field to the ABAP field names, the VALUE field to a value from the type pool sai, and attach the line to the table. The VALUE field can have the following values:
25-08-2005
© 2005 SAP AG. All rights reserved.
159
Unit 3: Using Generated Proxy Objects
BIT450
Possible values for the VALUE field of the CONTROLLER table Value
Meaning
sai_ctrl_initial
Field appears with type-correct initial value in the message; it controls default handling and performance optimization. Value is ignored for structures or complex types.
sai_ctrl_nil
The value xsi:nil is sent for this field in the message.
sai_ctrl_none
Field does not occur in message, regardless of this value or the default.
Asynchronous Case As mentioned above, in the case of asynchronous ABAP client proxies, you have to execute a commit work after calling the method execute_asynchronous, and this sends the message. For asynchronous messages you can use the CONTROLLER object, for example, to set the Queue ID for the processing type Exactly Once In Order. This queue ID is the serialization context (a string), which ensures that all messages with this string are processed by the receiver in the same order as they are called by the sender.
Setting the Queue ID * Serialization context to bundle asynchronous messages * that shall be received in the same order as sent DATA: lo_async_messaging TYPE REF TO if_wsprotocol_async_messaging. lo_async_messaging ?= lo_abc->get_protocol( if_proxy_protocol=>async_messaging ). lo_async_messaging->set_serialization_context(’MY_QUEUE_ID’). CALL METHOD ...
Hint: The CONTROLLER object from XI 2.0 is no longer supported.
Error Analysis for Client Proxy Similarly to the ICF server recorder, transaction SICF also offers an ICF client recorder. Choose the menu option Client / Recorder to access the functions for activating, deactivating, and displaying a recording.
160
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Using ABAP Client Proxies
Debugging for client proxy calls is the same as the standard debugging in ABAP.
25-08-2005
© 2005 SAP AG. All rights reserved.
161
Unit 3: Using Generated Proxy Objects
162
© 2005 SAP AG. All rights reserved.
BIT450
25-08-2005
BIT450
Lesson: Using ABAP Client Proxies
Exercise 14: Generating ABAP Client Proxy Objects Exercise Objectives After completing this exercise, you will be able to: • Generate ABAP client proxy objects for an outbound message interface
Business Example You will be using an ABAP SAP system to generate a call using proxy technology, and you want to generate the required proxy objects.
Task 1: In the SAP_BACKEND system, generate the proxy objects for the outbound message interface RequestInformation_Send in your namespace (SWCV SC_BIT450_CIS). 1.
Start the transaction SPROXY in the SAP_BACKEND.
2.
Generate the proxy objects for the outbound message interface RequestInformation_Send in your namespace http://bit450.com/xi/abap## (SWCV SC_BIT450_CIS)
Task 2: Test your ABAP client proxy. 1.
25-08-2005
Start a test call in transaction SPROXY.
© 2005 SAP AG. All rights reserved.
163
Unit 3: Using Generated Proxy Objects
BIT450
Solution 14: Generating ABAP Client Proxy Objects Task 1: In the SAP_BACKEND system, generate the proxy objects for the outbound message interface RequestInformation_Send in your namespace (SWCV SC_BIT450_CIS). 1.
2.
Start the transaction SPROXY in the SAP_BACKEND. a)
Log on to the SAP_BACKEND system using the logon information provided by the instructor.
b)
Call transaction SPROXY.
Generate the proxy objects for the outbound message interface RequestInformation_Send in your namespace http://bit450.com/xi/abap## (SWCV SC_BIT450_CIS) a)
In transaction SWCV, navigate to your namespace for the outbound message interface.
b)
Start the proxy generation by double clicking on the message interface. Use the package $TMP and the prefix Z##_.
c)
Check the proxy objects for naming conflicts.
d)
To activate all the objects, choose “Activate” or, from the menu, Proxy → Activate.
Continued on next page
164
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Using ABAP Client Proxies
Task 2: Test your ABAP client proxy. 1.
25-08-2005
Start a test call in transaction SPROXY. a)
If your proxy is visible in the right-hand detail screen, choose “Test Interface” or, from the menu, Proxy → Test Interface to start a test call.
b)
On the next screen, choose “Sender Service” Training as parameters for outbound processing, and select the radio buttons “Generate Template Data” and “XML Editor”. Then choose Start (F8).
c)
On the next screen, Request Payload, you can enter current values in the four fields of the XML payload (optional). Then choose Execute (F8).
d)
Start the Message Monitor (transaction SXI_MONITOR) in the SAP_BACKEND and select your message interface RequestInformation_Send in the namespace http://bit450.com/xi/abap## . Check whether a message has been generated and processed correctly. Make a note of the message ID of your message.
e)
Start the Message Monitor (transaction SXI_MONITOR) in the Integration Server (XI client 800) and select your message interface RequestInformation_Send in the namespace http://bit450.com/xi/abap## . Check whether a message has been generated and processed correctly. Check the message ID of your message and compare it to the message ID that you have written down.
© 2005 SAP AG. All rights reserved.
165
Unit 3: Using Generated Proxy Objects
BIT450
Lesson Summary You should now be able to: • Use a generated client proxy method in ABAP to send a message to XI
166
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Server Proxies, Web Services, and WSDL
Lesson: Server Proxies, Web Services, and WSDL Lesson Overview You want to use inbound interfaces as a Web service.
Lesson Objectives After completing this lesson, you will be able to: • •
Describe how to use server proxies as a Web service Describe any inbound interface as a Web service
Business Example You want to use inbound interfaces as a Web service and need to know which possibilities are available for which interfaces.
Web Services A Web service is a modular function that is described and called by Internet standards. • • • • •
Is an application function Is self-descriptive Is modular Can be published Can be called using standards
A Web service is described in Web Service Description Language (WSDL) by means of XML files. It can be processed automatically, for example, for generating a proxy object to call the service. A Web service is called using Internet standards: based on the http(s) protocol and the XML data format SOAP (Simple Object Access Protocol).
25-08-2005
© 2005 SAP AG. All rights reserved.
167
Unit 3: Using Generated Proxy Objects
BIT450
Figure 51: WSDL for Describing a Web Service
Because a Web service proxy object is adjusted to the respective development environment, the service can be called using a simple local method call. You do not need to program SOAP messages, since this is done by the proxy object. This is exactly what happens when you use XI client proxies. To publish a Web service, you have to make the description file, that is, the WSD (or WSDL file), available in the Service Directory.
Figure 52: Publishing and Calling a Web Service
The directory itself is based on the UDDI standard: Universal Description and Discovery.
168
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Server Proxies, Web Services, and WSDL
Overview: XI and Web Services There are two main methods by which inbound interfaces in XI 3.0 can be used as Web services: • •
A server proxy can be described as a Web service and then called directly; Using the Integration Server, any inbound interface can be described and used as a Web service.
The second option is described in the following graphic as an “Enhanced Web Service”.
Figure 53: XI and Web Services
Server Proxy as Web Service In SAP XI, synchronous server proxies can also be used as a Web service. To do this, you need to create a “virtual interface” and a “Web Service Definition” for the server proxy object.
25-08-2005
© 2005 SAP AG. All rights reserved.
169
Unit 3: Using Generated Proxy Objects
BIT450
Figure 54: Virtual Interface for SAP XI Server Proxy
The SAP WebAS 6.40 introduces the Web Services Framework, which uses virtual interfaces to represent SAP interfaces such as server-proxy, BAPIs, etc. as a Web service. This means that if a virtual interface is created for a server proxy, the server proxy can be used directly as a Web service via this interface. To create these objects, you use the WebService Wizard, which is integrated in the Object Navigator (transaction SE80) and can be called in transaction SPROXY using the menu Goto → WebService Wizard. You enter the names of the virtual interface (for example, Z_VI_CustomerInfo) and the Web service definition (for example, Z_WSD_CustomerInfo) in the WebService Wizard, which then creates the objects. In the Web service definition, the Web service is assigned features such as the communication type, authentication level, and transport properties. The virtual interface defines the mapping of names for operations and end point parameters of the Web service and uses the structures of the proxy. If you want to later enhance the proxy interface using the message types, the virtual interface is automatically enhanced at the same time. As for ABAP Web services in general, the Web service you have created for the server proxy can also be displayed in Web service administration (transaction WSADMIN). You can also call the Web service homepage (menu Web Service → Web Service Homepage) and generate a WSDL file (menu Web Service → WSDL). The WSDL file then enables other systems to call the server proxy as a Web service. It contains information on the address of the Web service, and information on the parameters and
170
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Server Proxies, Web Services, and WSDL
structures. The address of the Web service is also visible directly in the transaction WSADMIN (for example, “/sap/bc/srt/xip/sap/Z_WSD_CustomerInfo”), here you need to add the host and port.
Point-to-Point Connections for Client & Server Proxy So that the Web service created for a server proxy can be called directly from an SAP application system (as of WAS 6.40) using a client proxy, you need to create a logical port in the outbound client of the sending system that points to the Web service.
Figure 55: Point-to-Point Connection Between Client and Server Proxy
To do this, you first need to create an HTTP destination in transaction SM59. Enter the URL of the Web service as the path prefix (see WSADMIN in the target system, for example /sap/bc/srt/xip/sap/Z_WSD_CustomerInfo). Also enter the target machine (with port if applicable) and the logon data. You can then use transaction LPCONFIG to create the logical port for the relevant client proxy. Then assign the HTTP destination you created above to this port (on the Calling Parameters) tab. The logical port must be activated. The web service is then called by first generating an object of the relevant client proxy class. Enter the logical port that you have just created as a parameter in the CREATE method:
Creating a client proxy with a logical port CREATE OBJECT lo_CustomerInfo EXPORTING logical_port_name
25-08-2005
= ’Z_LP_BIT450’.
© 2005 SAP AG. All rights reserved.
171
Unit 3: Using Generated Proxy Objects
BIT450
The call of the client proxy method, the processing of the results, and error handling are the same as in processing using the Integration Server.
Client proxy call to Web service TRY. CALL METHOD lo_ CustomerInfo->execute_synchronous EXPORTING output = ll_output IMPORTING input
= ll_input.
. . . CATCH cx_ai_system_fault. . . . CATCH cx_ai_application_fault . . . ENDTRY.
For more information, see WebService – XI Proxy The direct use of Web services is supported for the first time in XI 3.0. Generation is only possible for synchronous inbound proxies. It is generally faster to use a proxy by calling the corresponding Web service directly, as communication between the two systems is direct and does not use the Integration Server. With this method, however, the XI services are not available, for example: • • • •
No mapping (structure mapping or value mapping) No receiver determination - always static receiver. No monitoring No central system administration in the SLD Hint: With reference to static receiver determination: with a small amount of configuration, you can also set the receiver dynamically using the method GET_LOGICAL_PORT_FROM_RECEIVER.
If you do not need these services, the considerable improvement in performance means that it can be practical to communicate directly using Web services. If you require the services of the Integration Server at a later stage, you can switch from the Web service runtime to the XI runtime without having to change the program code.
172
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Server Proxies, Web Services, and WSDL
Web Services in XI via Integration Server In XI 3.0, other inbound message interfaces can also be addressed as Web services by sending the call to the Integration Server, where it is then forwarded to the target system. To generate an appropriate WSDL, use the Web Service Assistant in the Integration Directory. To use the assistant, choose Tools → Define Web Service . .. To generate the WSDL file, you have to enter another set of parameters. Parameters in the Web Service Assistant Parameter
Value
Integration Engine SOAP inbound
http://:/sap/xi/engine/?type=entry
Message Interface
Receiver interface name, namespace, software component version
Sender
Corresponding sender parameters
To generate the WSDL file, enter the sender information for the outbound message: SOAP sender name, SOAP interface name, and SOAP interface namespace. These values are included in the WSDL file, are used by the proxy object that is generated using this file, and appear in the SOAP message. To generate the WSDL file, choose Finish. To save locally, choose Save to File.
25-08-2005
© 2005 SAP AG. All rights reserved.
173
Unit 3: Using Generated Proxy Objects
BIT450
Figure 56: Web Services in SAP XI via Integration Server
Of course, runtime requires that the Integration Directory contains a configuration with the same data that was specified when you generated the WSDL file, particularly the sender parameters.
174
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Server Proxies, Web Services, and WSDL
Exercise 15: Checking a Web Service for a Server Proxy Exercise Objectives After completing this exercise, you will be able to: • Check Web service definitions for a server proxy
Business Example You want to check whether a Web service definition exists for a server proxy.
Task: Check whether a Web service definition exists for the server proxy CustomerInformation_Provide in the namespace http://bit450.com/xi/abap00 and start the homepage for the Web service.
25-08-2005
1.
Log on to SAP_BACKEND.
2.
Navigate to Web service administration for the SOAP runtime.
3.
Navigate to the Web service definition created by the instructor.
4.
Call the homepage for the Web service.
5.
Test the Web service.
© 2005 SAP AG. All rights reserved.
175
Unit 3: Using Generated Proxy Objects
BIT450
Solution 15: Checking a Web Service for a Server Proxy Task: Check whether a Web service definition exists for the server proxy CustomerInformation_Provide in the namespace http://bit450.com/xi/abap00 and start the homepage for the Web service. 1.
Log on to SAP_BACKEND. a)
2.
Navigate to Web service administration for the SOAP runtime. a)
3.
Start transaction WSADMIN for administration of the Web services for the SOAP runtime.
Navigate to the Web service definition created by the instructor. a)
4.
Use the logon parameters provided by the instructor.
Open the node “SOAP Application for XI Proxies” and open the entry Z_WSD_CustomerInfo, to display the entry BIT450 WebService Demo. Select the entry with the mouse.
Call the homepage for the Web service. a)
Use F8 or choose Web Service → Web Service Homepage to call the homepage.
b)
When asked to select the “Settings for WSDL Generation”, choose Document-Style.
c)
To log on to the Web service homepage, you must have a user for the J2EE server that provides the homepage. Use the logon information provided by the instructor.
Continued on next page
176
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Lesson: Server Proxies, Web Services, and WSDL
5.
Test the Web service. a)
On the Web service homepage, choose Test from the menu to display the test interface.
b)
Under Z_WSD_CustomerInfoSoapBinding, choose the link to CustomerInformation_Provide.
c)
For “parameters (string)”, enter SAP AG and send the data by pressing Send.
d)
The request and the response are then displayed in separate fields. Hint: Note that the test message is not displayed in the XI message monitor (SXI_MONITOR), as the access is not processed using the proxy runtime, but by the SOAP runtime of the system instead.
25-08-2005
© 2005 SAP AG. All rights reserved.
177
Unit 3: Using Generated Proxy Objects
BIT450
Lesson Summary You should now be able to: • Describe how to use server proxies as a Web service • Describe any inbound interface as a Web service
Related Information More information on the subject of Web services in ABAP is provided in the course BC416 “ABAP Web Services”.
178
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Unit Summary
Unit Summary You should now be able to: • Implement a generated server proxy method in ABAP • Use a generated client proxy method in Java to generate a message and send it to the Integration Server • Configure the integration scenario in the Integration Directory • implement and configure a previously generated Java server proxy for generating and sending a message to the Integration Server. • Use a generated client proxy method in ABAP to send a message to XI • Describe how to use server proxies as a Web service • Describe any inbound interface as a Web service
25-08-2005
© 2005 SAP AG. All rights reserved.
179
Unit Summary
180
BIT450
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Test Your Knowledge
Test Your Knowledge
25-08-2005
1.
How do you access the interface parameters in the ABAP inbound method to be implemented?
2.
How is the business system determined for a client proxy bean that sends a message to the Integration Server?
© 2005 SAP AG. All rights reserved.
181
Test Your Knowledge
BIT450
Answers 1.
How do you access the interface parameters in the ABAP inbound method to be implemented? Answer: The parameters INPUT and OUTPUT are available. These correspond to the DDIC data type of the message types for the method.
2.
How is the business system determined for a client proxy bean that sends a message to the Integration Server? Answer: Using the SAP WebAS J2EE Server, which is registered on the SLD as a technical system, the Java proxy runtime determines the assigned business system from the SLD.
182
© 2005 SAP AG. All rights reserved.
25-08-2005
BIT450
Course Summary
Course Summary You should now be able to: • • • •
25-08-2005
Assess when to use proxy objects Execute the necessary proxy generation Use the generated client proxy objects Implement the generated server proxy objects
© 2005 SAP AG. All rights reserved.
183
Course Summary
184
BIT450
© 2005 SAP AG. All rights reserved.
25-08-2005
Feedback SAP AG has made every effort in the preparation of this course to ensure the accuracy and completeness of the materials. If you have any corrections or suggestions for improvement, please record them in the appropriate place in the course evaluation.
25-08-2005
© 2005 SAP AG. All rights reserved.
185