How-to Guide
How To…
debug XI
applications
Version 1.00 – September 2004
Applicable Releases:
Exchange Infrastructure 2.0
Exchange Infrastructure 3.0
© Copyright 2004 SAP AG. All rights reserved. contained in this document serves informational
purposes only. National product specifications may vary.
No part of this publication may be reproduced or
transmitted in any form or for any purpose without the These materials are subject to change without notice.
express permission of SAP AG. The information These materials are provided by SAP AG and its affiliated
contained herein may be changed without prior notice. companies ("SAP Group") for informational purposes
only, without representation or warranty of any
Some software products marketed by SAP AG and its kind, and SAP Group shall not be liable for errors or
distributors contain proprietary software components of omissions with respect to the materials. The only
other software vendors. warranties for SAP Group products and services are those
that are set forth in the express warranty statements
Microsoft, Windows, Outlook, and PowerPoint are accompanying such products and services, if any.
registered trademarks of Microsoft Corporation. Nothing herein should be construed as constituting an
additional warranty.
IBM, DB2, DB2 Universal Database, OS/2, Parallel
Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, These materials are provided “as is” without a warranty
iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent of any kind, either express or implied, including but not
Miner, WebSphere, Netfinity, Tivoli, and Informix are limited to, the implied warranties of merchantability,
trademarks or registered trademarks of IBM Corporation fitness for a particular purpose, or non-infringement.
in the United States and/or other countries. SAP shall not be liable for damages of any kind including
without limitation direct, special, indirect, or
Oracle is a registered trademark of Oracle Corporation. consequential damages that may result from the use of
these materials.
UNIX, X/Open, OSF/1, and Motif are registered SAP does not warrant the accuracy or completeness of
trademarks of the Open Group. the information, text, graphics, links or other items
contained within these materials. SAP has no control
Citrix, ICA, Program Neighborhood, MetaFrame, over the information that you may access through the
WinFrame, VideoFrame, and MultiWin are trademarks use of hot links contained in these materials and does not
or registered trademarks of Citrix Systems, Inc. endorse your use of third party web pages nor provide
any warranty whatsoever relating to third party web
HTML, XML, XHTML and W3C are trademarks or pages.
®
registered trademarks of W3C , World Wide Web SAP NetWeaver “How-to” Guides are intended to
Consortium, Massachusetts Institute of Technology. simplify the product implementation. While specific
product features and procedures typically are explained
Java is a registered trademark of Sun Microsystems, Inc. in a practical business context, it is not implied that those
features and procedures are the only approach in solving
JavaScript is a registered trademark of Sun Microsystems, a specific business problem using SAP NetWeaver. Should
Inc., used under license for technology invented and you wish to receive additional information, clarification
implemented by Netscape. or support, please refer to SAP Consulting.
Any software coding and/or code lines / strings (“Code”)
MaxDB is a trademark of MySQL AB, Sweden. included in this documentation are only examples and
are not intended to be used in a productive system
SAP, R/3, mySAP, [Link], xApps, xApp, SAP environment. The Code is only intended better explain
NetWeaver, and other SAP products and services and visualize the syntax and phrasing rules of certain
mentioned herein as well as their respective logos are coding. SAP does not warrant the correctness and
trademarks or registered trademarks of SAP AG in completeness of the Code given herein, and SAP shall
Germany and in several other countries all over the not be liable for errors or damages caused by the usage of
world. All other product and service names mentioned the Code, except if such damages were caused by SAP
are the trademarks of their respective companies. Data intentionally or grossly negligent.
1 Scenario............................................................................................................1
2 Introduction: Graphical overview ..........................................................................1
3 The Step By Step Solution.....................................................................................2
3.1 Prerequisites .........................................................................................2
3.2 Debugging of synchronous interfaces...................................3
3.3 Debugging of asynchronous interfaces ................................8
3.4 Testing Proxies...................................................................................15
3.5 Tracing proxy calls...........................................................................21
3.6 Recording proxy calls ....................................................................24
3.6.1 Client side recording ............................................................................24
3.6.2 Server side recording ...........................................................................26
1 Scenario
In XI it is sometimes necessary to debug an application which is connected to the XI via proxy framework
to analyze problems within the receiving application.
2 Introduction: Graphical overview
XI Scenario:
Application Application
Proxy Runtime Proxy Runtime
Local Central Local
Integration Integration Integration
Engine Engine Engine
Sender Business XI System Receiver Business
System System
WebService Scenario:
Application Application
Proxy Runtime Proxy Runtime
WebService WebService
Runtime HTTP Runtime
SOAP
Sender Business Receiver Business
System System
-1-
3 The Step By Step Solution
3.1 Prerequisites
To debug the receiving application the following prerequisites are necessary:
- the name of the receiving proxy (ABAP OO class) has to be known.
You can find the name of the proxy class in transaction SPROXY:
-2-
3.2 Debugging of synchronous interfaces
To debug a synchronous inbound interface you have to set an external breakpoint in the receiving
inbound method <class name>-><interfacename>~execute_synchronous(..)
Note that you have to switch on the debugging or set the breakpoint for the user which is used to send
the message to the receiving system. You can find this information:
For the XI runtime:
- in the XI directory in the channel for the receiving business system
For the WebService runtime:
- in the URL or
- in the logical port on client side
To activate the debugging do the following:
Log on with the user that is used to send the message to the application server where the message is sent
to
Open the proxy class in SE24:
-3-
Choose Utilities Æ Settings in the menu and activate the HTTP debugging for the user you want to use
for debugging in ABAP Editor Æ HTTP Debugging:
Set the breakpoint via menu Utilities Æ Breakpoints Æ Set/Delete Æ Choose ‘HTTP breakpoint’ in the
popup:
When you send the message the debugger will stop at the breakpoint you have set.
-4-
Another possibility to activate the HTTP debugging is to activate the debugging for a specific user in
transaction SICF. Select the path /sap/xi/engine:
Choose via the menu: Edit Æ Debugging Æ Activate debugging. In the popup you can set the user for
debugging (needs to be the sending user):
-5-
When you send the message the debugger will stop in the method
IF_HTTP_EXTENSION~HANDLE_REQUEST of class CL_XMS_HTTP_HANDLER.
You can now set a breakpoint for your proxy class via menu: Breakpoints Æ Breakpoints at Æ Method.
Choose the proxy class and method you are sending the message to.
F8 will bring you to your proxy class.
-6-
You can analyze the proxy data type using parameter INPUT.
Please note: You need to have an open session (gui window) in the system/client at the moment the call
receives the system!
-7-
3.3 Debugging of asynchronous interfaces
To debug an asynchronous inbound interface you have to deregister the qRFC Inbound queue in the
receiving system. Normally the queues are processed from the Inbound scheduler. The deregistration will
keep the inbound messages in the queue so that you can debug them.
Please note: The deregistration will stop all messages in this queue. This means no message from other
users/interfaces is processed anymore. Keep this in mind. Register the queue again when you have
finished the debugging.
To activate the debugging do the following:
Find the queue name for your inbound message. For this check your receiving messages in transaction
SXMB_MONI and check the column Queue-ID:
-8-
If you can restart a message in error you can deregister the queue with exactly this name. This would be
the better way as it does not stop the processing in all inbound queues. Start transaction SMQR and select
the button ‘Deregistration’ Æ Enter the name of the queue you found in the last step:
If you have to send a new message you have to deregister a generic queue name as the name is given by
the XI in runtime and you do not know it in advance. Then you have to deregister the queue name
XBTR* for EO messages or XBQR* for EOIO messages:
-9-
If the queue is deregistered you see the Type U (unregistered) in the QIN Scheduler monitor:
Now restart or resend the message. This message will stop in the unregistered queue. Start transaction
SMQ2 and select your specific queue or start transaction SXMB_MONI and select your message Æ you
can jump into the queue by clicking on the queue name in column Queue-ID.
By double clicking the queue name you jump into the detailed view for this queue:
- 10 -
Another double clicking on the queue name will show you all entries in this specific queue. The entry on
top is the one you can debug. Select the entry and press the very right button or F8:
- 11 -
The debugger will come up and stop in the XI runtime. Once press F5 (otherwise the breakpoints may
not work):
You can now set a breakpoint for your proxy class via menu: Breakpoints Æ Breakpoints at Æ Method.
Choose the proxy class and method you are sending the message to.
F8 will bring you to your proxy class.
- 12 -
You can analyze the proxy data type using parameter INPUT.
After you have finished debugging please don’t forget to register the queue again! Start transaction SMQR
and select the deregistered queue:
- 13 -
Press the button ‘Registration’ to register the queue. In the popup press Continue. Afterwards the queue
should be visible with type R again:
- 14 -
3.4 Testing Proxies
Active proxies can be tested in transaction SPROXY. Display the interface and press F8:
In the popup set the flag for xml to paste in your payload:
- 15 -
In the next window you can change the generated payload. You may use the payload of another message
in SXMB_MONI. Download the payload in SXMB_MONI and upload it here. In the screen there are two
possibilities for uploading files:
1. Upload the file unchanged: the payload is loaded in binary mode, so you can process exactly the same
payload as in the already processed message in SXMB_MONI:
- 16 -
No further changes can be done to the payload from the editor anymore:
- 17 -
2. Upload the file: the payload is loaded in ASCII mode, so special characters may not be loaded correctly:
- 18 -
In the editor you can change the payload before processing:
- 19 -
Press F8 to execute the call. In the results window you can check if the call could be processed without
error:
- 20 -
3.5 Tracing proxy calls
In transaction SICF you can trace your HTTP call to the receiving business system.
Change to the application server where you sent the messages to via transaction SM51 by double clicking
the correct application server:
Select the path to the xi engine and select Edit Æ Trace Æ Activate Trace via the menu:
- 21 -
In the popup select Client-specific and enter the name of the user that is used to send the message. Select
the trace level 2 or 3 and press the ‘Activate’ Button:
After you sent your message deactivate the trace via the menu Edit Æ Trace Æ Deactivate Trace. You
will get a popup to select the user to deactivate the trace for. Select the correct user and press ‘Deactivate’:
- 22 -
You can check the trace via the menu Edit Æ Trace Æ Display Trace. Enter the user you activated the
trace for:
Now you can check the user trace:
- 23 -
3.6 Recording proxy calls
In transaction SICF you can record your HTTP call from and to the receiving business system.
3.6.1 Client side recording
If you want to record the call leaving the business system (outbound Proxy) you have to use client side
recording.
Call Transaction SICF and select Client Æ Recording Æ Activate Recording via the menu:
In the popup press the ‘Activate’ Button:
After you sent your message deactivate the trace via the menu Client Æ Recording Æ Deactivate
Recording. You will get a popup to select the user to deactivate the recording for. Select the correct user
and press ‘Deactivate’:
- 24 -
You can check the trace via the menu Client Æ Recording Æ Display Recording. Enter the user you
activated the recording for:
Now you will get to the server side recording screen and you have to press the button Client Requests:
Now you can select the request and response of your call:
- 25 -
3.6.2 Server side recording
Change to the application server where you sent the messages to via transaction SM51 by double clicking
the correct application server:
- 26 -
Call Transaction SICF, select the path to the xi engine and select Edit Æ Recorder Æ Activate Recording
via the menu:
In the popup select Client-specific and enter the name of the user that is used to send the message. Press
the ‘Activate’ Button:
- 27 -
After you sent your message deactivate the trace via the menu Edit Æ Recorder Æ Deactivate Recording.
You will get a popup to select the user to deactivate the recording for. Select the correct user and press
‘Deactivate’:
You can check the trace via the menu Edit Æ Recorder Æ Display Recorded HTTP Requests. Enter the
user you activated the recording for:
- 28 -
Now you can check the recorded HTTP requests and responses:
- 29 -
[Link]/irj/sdn/howtoguides