how to debug xi applications

Upload: extrapratik

Post on 07-Apr-2018

234 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 How to Debug XI Applications

    1/33

    How-to Guide

    How ToHow ToDebug XIApplications

    Version 1.00 September 2004

    Applicable Releases:Exchange Infrastructure 2.0Exchange Infrastructure 3.0

  • 8/3/2019 How to Debug XI Applications

    2/33

    Copyright 2004 SAP AG. All rights reserved.

    No part of this publication may be reproduced ortransmitted in any form or for any purpose 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.

    Microsoft, Windows, Outlook,and PowerPoint

    are

    registered trademarks of Microsoft Corporation.

    IBM, DB2, DB2 Universal Database, OS/2, Parallel

    Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400,

    iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent

    Miner, WebSphere, Netfinity, Tivoli, and Informix are

    trademarks or registered trademarks of IBM Corporation

    in the United States and/or other countries.

    Oracle is a registered trademark of Oracle Corporation.

    UNIX, X/Open, OSF/1, and Motif are registered

    trademarks of the Open Group.

    Citrix, ICA, Program Neighborhood, MetaFrame,

    WinFrame, VideoFrame, and MultiWinare trademarks

    or registered trademarks of Citrix Systems, Inc.

    HTML, XML, XHTML and W3C 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.

    MaxDB is a trademark of MySQL AB, Sweden.

    SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP

    NetWeaver, and other SAP products and services

    mentioned herein as well as their respective logos are

    trademarks or registered trademarks of SAP AG in

    Germany and in several other countries all over the

    world. All other product and service names mentionedare the trademarks of their respective companies. Data

    contained in this document serves informational

    purposes only. National product specifications may vary.

    These materials are subject to change without notice.

    These materials are provided by SAP AG and its affiliated

    companies ("SAP Group") for informational purposes

    only, without representation or warranty of any

    kind, and SAP Group shall not be liable for errors or

    omissions with respect to the materials. The only

    warranties for SAP Group products and services are those

    that are set forth in the express warranty statements

    accompanying such products and services, if any.

    Nothing herein should be construed as constituting an

    additional warranty.

    These materials are provided as is without a warranty

    of any kind, either express or implied, including but not

    limited to, the implied warranties of merchantability,

    fitness for a particular purpose, or non-infringement.

    SAP shall not be liable for damages of any kind including

    without limitation direct, special, indirect, or

    consequential damages that may result from the use of

    these materials.

    SAP does not warrant the accuracy or completeness of

    the information, text, graphics, links or other items

    contained within these materials. SAP has no control

    over the information that you may access through the

    use of hot links contained in these materials and does not

    endorse your use of third party web pages nor provide

    any warranty whatsoever relating to third party web

    pages.

    SAP NetWeaver How-to Guides are intended to

    simplify the product implementation. While specific

    product features and procedures typically are explained

    in a practical business context, it is not implied that those

    features and procedures are the only approach in solving

    a specific business problem using SAP NetWeaver. Shouldyou wish to receive additional information, clarification

    or support, please refer to SAP Consulting.

    Any software coding and/or code lines / strings (Code)

    included in this documentation are only examples and

    are not intended to be used in a productive system

    environment. The Code is only intended better explain

    and visualize the syntax and phrasing rules of certain

    coding. SAP does not warrant the correctness and

    completeness of the Code given herein, and SAP shall

    not be liable for errors or damages caused by the usage of

    the Code, except if such damages were caused by SAPintentionally or grossly negligent.

  • 8/3/2019 How to Debug XI Applications

    3/33

    1 Scenario............................................................................................................12 Introduction: Graphical overview..........................................................................13 The Step By Step Solution.....................................................................................2

    3.1 Prerequisites .........................................................................................2

    3.2 Debugging of synchronous interfaces...................................33.3 Debugging of asynchronous interfaces ................................83.4 Testing Proxies ...................................................................................15

    3.5 Tracing proxy calls...........................................................................213.6 Recording proxy calls ....................................................................24

    3.6.1 Client side recording............................................................................24

    3.6.2 Server side recording ...........................................................................26

  • 8/3/2019 How to Debug XI Applications

    4/33

    1 ScenarioIn 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 overviewXI Scenario:

    WebService Scenario:

    Sender Business

    System

    Application

    Proxy Runtime

    WebService

    Runtime

    Receiver Business

    System

    Application

    Proxy Runtime

    WebService

    RuntimeHTTP

    SOAP

    Sender BusinessSystem

    Application

    Proxy Runtime

    Local

    Integration

    Engine

    XI System

    Central

    Integration

    Engine

    Receiver BusinessSystem

    Application

    Proxy Runtime

    Local

    Integration

    Engine

    - 1 -

  • 8/3/2019 How to Debug XI Applications

    5/33

    3 The Step By Step Solution3.1 PrerequisitesTo 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 -

  • 8/3/2019 How to Debug XI Applications

    6/33

    3.2 Debugging of synchronous interfacesTo debug a synchronous inbound interface you have to set an external breakpoint in the receiving

    inbound method ->~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 systemFor 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 sentto

    Open the proxy class in SE24:

    - 3 -

  • 8/3/2019 How to Debug XI Applications

    7/33

    Choose Utilities Settings in the menu and activate the HTTP debugging for the user you want to use

    for debugging in ABAP EditorHTTP Debugging:

    Set the breakpoint via menu Utilities Breakpoints Set/DeleteChoose HTTP breakpoint in the

    popup:

    When you send the message the debugger will stop at the breakpoint you have set.

    - 4 -

  • 8/3/2019 How to Debug XI Applications

    8/33

    Another possibility to activate the HTTP debugging is to activate the debugging for a specific user intransaction 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 -

  • 8/3/2019 How to Debug XI Applications

    9/33

    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 atMethod.

    Choose the proxy class and method you are sending the message to.

    F8 will bring you to your proxy class.

    - 6 -

  • 8/3/2019 How to Debug XI Applications

    10/33

    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 callreceives the system!

    - 7 -

  • 8/3/2019 How to Debug XI Applications

    11/33

    3.3 Debugging of asynchronous interfacesTo 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 willkeep 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 otherusers/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 -

  • 8/3/2019 How to Debug XI Applications

    12/33

    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 -

  • 8/3/2019 How to Debug XI Applications

    13/33

    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 -

  • 8/3/2019 How to Debug XI Applications

    14/33

    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 -

  • 8/3/2019 How to Debug XI Applications

    15/33

    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 atMethod.

    Choose the proxy class and method you are sending the message to.

    F8 will bring you to your proxy class.

    - 12 -

  • 8/3/2019 How to Debug XI Applications

    16/33

    You can analyze the proxy data type using parameter INPUT.

    After you have finished debugging please dont forget to register the queue again! Start transaction SMQR

    and select the deregistered queue:

    - 13 -

  • 8/3/2019 How to Debug XI Applications

    17/33

    Press the button Registration to register the queue. In the popup press Continue. Afterwards the queue

    should be visible with type R again:

    - 14 -

  • 8/3/2019 How to Debug XI Applications

    18/33

    3.4 Testing ProxiesActive 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 -

  • 8/3/2019 How to Debug XI Applications

    19/33

    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 -

  • 8/3/2019 How to Debug XI Applications

    20/33

    No further changes can be done to the payload from the editor anymore:

    - 17 -

  • 8/3/2019 How to Debug XI Applications

    21/33

    2. Upload the file: the payload is loaded in ASCII mode, so special characters may not be loaded correctly:

    - 18 -

  • 8/3/2019 How to Debug XI Applications

    22/33

    In the editor you can change the payload before processing:

    - 19 -

  • 8/3/2019 How to Debug XI Applications

    23/33

    Press F8 to execute the call. In the results window you can check if the call could be processed without

    error:

    - 20 -

  • 8/3/2019 How to Debug XI Applications

    24/33

    3.5 Tracing proxy callsIn 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 -

  • 8/3/2019 How to Debug XI Applications

    25/33

    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 TraceDeactivate Trace. You

    will get a popup to select the user to deactivate the trace for. Select the correct user and press Deactivate:

    - 22 -

  • 8/3/2019 How to Debug XI Applications

    26/33

    You can check the trace via the menu Edit TraceDisplay Trace. Enter the user you activated the

    trace for:

    Now you can check the user trace:

    - 23 -

  • 8/3/2019 How to Debug XI Applications

    27/33

    3.6 Recording proxy callsIn transaction SICF you can record your HTTP call from and to the receiving business system.

    3.6.1 Client side recordingIf 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 userand press Deactivate:

    - 24 -

  • 8/3/2019 How to Debug XI Applications

    28/33

    You can check the trace via the menu Client RecordingDisplay Recording. Enterthe user youactivated 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 -

  • 8/3/2019 How to Debug XI Applications

    29/33

    3.6.2 Server side recordingChange to the application server where you sent the messages to via transaction SM51 by double clicking

    the correct application server:

    - 26 -

  • 8/3/2019 How to Debug XI Applications

    30/33

    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 -

  • 8/3/2019 How to Debug XI Applications

    31/33

    After you sent your message deactivate the trace via the menu Edit RecorderDeactivate 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 RecorderDisplay Recorded HTTP Requests. Enter the

    user you activated the recording for:

    - 28 -

  • 8/3/2019 How to Debug XI Applications

    32/33

    - 29 -

    Now you can check the recorded HTTP requests and responses:

  • 8/3/2019 How to Debug XI Applications

    33/33

    www.sdn.sap.com/irj/sdn/howtoguides

    http://www.sdn.sap.com/irj/sdn/howtoguideshttp://www.sdn.sap.com/irj/sdn/howtoguideshttp://www.sdn.sap.com/irj/sdn/howtoguides