Set http- Header Parameters using the Axis Framework



Similar documents
Download and Install Crystal Reports for Eclipse via the Eclipse Software Update Manager

How To Configure MDM to Work with Oracle ASM-Based Products

Configuring Distribution List in Compliant User Provisioning

prioritize XI messages on integration server

How to Set Up an Authorization for a Business Partner in Customer Relationship Management (CRM) Internet Sales: Sample Case

Extract Archived Data from SAP ERP

Backup & Restore with SAP BPC (MS SQL 2005)

Analyzing Sales Data for Choosing Forecast Strategies

Posting Messages into XI

Methodology to Implement SAP Process Integration

3 rd party Service Desk interface

SAP GRC Access Control: Background jobs for risk analysis and remediation (formerly Virsa Compliance Calibrator)

Implementing Outlook Integration for SAP Business One

Developing Applications for Integration between PI and SAP ERP in Different Network Domains or Landscapes

CREATING A PURCHASE ORDER STORE RECORD WEB SERVICE

Performance Best Practices Guide for SAP NetWeaver Portal 7.3

E-Recruiting Job Board Integration using XI

Ronald Bueck SBO Product Definition

Utilities for downloading and uploading OO ABAP classes in XML format

How to configure BusinessObjects Enterprise with Citrix Presentation Server 4.0

Roster Configuration (Payroll) in SAP ECC 6.0 Tips & Tricks

How to Configure and Trouble Shoot Notification for Process Control 2.5

Integrate Third Party Collaboration Tools in the SAP NetWeaver Portal. SAP NetWeaver Product Management

Problems with your Data Model in SAP NetWeaver MDM Do s and Don ts

How To Balance In Sap Bw

SAP NetWeaver MDM 5.5 SP3 SAP Portal iviews Installation & Configuration. Ron Hendrickx SAP NetWeaver RIG Americas Foundation Team

Budget Control by Cost Center

How To... Call BEx Web Applications from SAP BusinessObjects Dashboards (Xcelsius) and vice versa

Enabling Full-Text Search for Business Objects in mysap ERP

Using SAP Logon Tickets for Single Sign on to Microsoft based web applications

How to Create Web Dynpro-Based iviews. Based on SAP NetWeaver 04 Stack 09. Jochen Guertler

SAP Master Data Governance- Hiding fields in the change request User Interface

Business One in Action - How can we post bank fees and charges while posting Incoming or Outgoing Payment transactions?

Integration of SAP central user administration with Microsoft Active Directory

Sales Rush Sales Order Processing S01- Lean Baseline Package. SAP Lean Baseline Package Version: V1.500 Country: UK Language: EN Date: February 2006

Maintaining Different Addresses and Ids for a Business Partner via CRM Web UI

Collaboration Technology Support Center - Microsoft - Collaboration Brief

SAP Sales and Operations Planning Software Product (xsop)

ARCHIVING OF IDOCS IN SAP

How To... Integrate Custom Formulas into the Formula Builder

Alert Notification in SAP Supply Network Collaboration. SNC Extension Guide

Integrating Easy Document Management System in SAP DMS

How to Configure Access Control for Exchange using PowerShell Cmdlets A Step-by-Step guide

Monitoring and Management of Landscapes with SAP NetWeaver Administrator. Dieter Krieger, SAP AG

Siteco Relies on SDN for its SAP CRM 5.0 Upgrade

Understanding HR Schema and PCR with an Example

mysap ERP Talent Management Dr. Christian Acosta-Flamma

Sending Additional Files from SAP Netweaver PI to third Party System

User Experience in Custom Apps

TM111. ERP Integration for Order Management (Shipper Specific) COURSE OUTLINE. Course Version: 15 Course Duration: 2 Day(s)

USDL XG WP3 SAP use case. Kay Kadner

R/3 and J2EE Setup for Digital Signature on Form 16 in HR Systems

Global Transport Label - General Motors -

Workflow extended notifications

HR400 SAP ERP HCM Payroll Configuration

Enterprise Software - Applications, Technologies and Programming

Debugging Portal Applications

NetWeaver Business Client (NWBC) for Incentives and Commissions Management (ICM)

OData in a Nutshell. August 2011 INTERNAL

SAPFIN. Overview of SAP ERP Financials COURSE OUTLINE. Course Version: 15 Course Duration: 2 Day(s)

Process Archiving using NetWeaver Business Process Management

Single Sign-On between SAP Portal and SuccessFactors

How to Create a Support Message in SAP Service Marketplace

SAP CCMS Monitors Microsoft Windows Eventlog

Accounts Receivable. SAP Best Practices

Table of Contents. How to Find Database Index usage per ABAP Report and Creating an Index

UI Framework Logo exchange without skin copy. SAP Enhancement Package 1 for SAP CRM 7.0

Data Archiving in CRM: a Brief Overview

SAP Business ByDesign Reference Systems. Scenario Outline. SAP ERP Integration Scenarios

Intelligent Business Operations Chapter 1: Overview & Strategy

AC200. Basics of Customizing for Financial Accounting: General Ledger, Accounts Receivable, Accounts Payable COURSE OUTLINE

Third Party Digital Asset Management Integration

BC407 Reporting: QuickViewer, InfoSet Query and SAP Query

SAP Central Process Scheduling (CPS) 8.0 by Redwood

UI Framework Task Based User Interface. SAP Enhancement Package 1 for SAP CRM 7.0

Integration of Outlook Web Access (OWA) into SAP Enterprise Portal

Integration of SAP Netweaver User Management with LDAP

Log Analysis Tool for SAP NetWeaver AS Java

SOP through Long Term Planning Transfer to LIS/PIS/Capacity. SAP Best Practices

Consume an External Web Service in a Nutshell with good old ABAP

How to Add an Attribute to a Case, Record and a Document in NW Folder Management (ex-records Management)

Portfolio and Project Management 5.0: Excel Integration for Financial and Capacity Planning

RUN BETTER Become a Best-Run Business with Remote Support Platform for SAP Business One

DBA Cockpit for Oracle

How to Schedule Report Execution and Mailing

SAP NetWeaver BRM 7.3

Business Requirements... 3 Analytics... 3 Typical Use Cases... 8 Related Content... 9 Copyright... 10

Data Source Enhancement Using User Exit

Unified Service Description Language Enabling the Internet of Services

How To... configure and execute Business Process Flows in SAP BusinessObjects Planning and Consolidation 7.5 version for SAP NetWeaver

FSC130 SAP Bank Communication Management

Compliant, Business-Driven Identity Management using. SAP NetWeaver Identity Management and SBOP Access Control. February 2010

SAP Service Tools for Performance Analysis

Secure MobiLink Synchronization using Microsoft IIS and the MobiLink Redirector

Ariba Network Integration to SAP ECC

Integration of Universal Worklist into Microsoft Office SharePoint

BW Workspaces Use Cases

UI Framework Simple Search in CRM WebClient based on NetWeaver Enterprise Search (ABAP) SAP Enhancement Package 1 for SAP CRM 7.0

Work with XI 3.0 Java Proxies

Transcription:

How-to Guide SAP NetWeaver 7.0 (2004s) How To Set http- Header Parameters using the Axis Framework Version 1.10 June 2008 Applicable Releases: SAP NetWeaver 04 SAP NetWeaver 7.0 (2004s) End-to End-Process Integration Enabling Application-to-Application Processes Enabling Business-to-Business Processes

Copyright 2007 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. 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 MultiWin are 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, 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 mentioned are 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. Should you 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 SAP intentionally or grossly negligent.

1 Scenario As per XI 3.0 SP 20 (SAP NetWeaver 7.0 SP12, Usage Type Process Integration, respectively), HTTP header parameters can be set dynamically by means of the Axis Framework used by XI's SOAP adapter. Within the scope of this How-to guide the relevant settings will be exemplified by the parameters Cookie, Set-Cookie and SOAPAction which often occur in SOA communication scenarios. HTTP cookies are a frequently used technology to enable stateful client-server interactions. This How-to guide provides a detailed description, how cookies can be exchanged between the HTTP header and XI s payload. According to World Wide Web Consortium (W3C), The SOAPAction HTTP request header field can be used to indicate the intent of the SOAP HTTP request. The value is a URI identifying the intent. SOAP places no restrictions on the format or specificity of the URI or that it is resolvable. An HTTP client MUST use this header field when issuing a SOAP HTTP Request. 1 This How-to guide provides a detailed description, how the SOAPAction parameter can be set dynamically by means of the Axis Framework. 2 Introduction 2.1 What are Cookies The HTTP protocol is stateless by definition. Each HTTP call is technically independent from any precedent call. In order to enable stateful processing, session information has to be handled on client side. HTTP cookies are a common technique to associate the session on the client side to the one on the server side. The cookies contain a unique session identifier and they are passed forth and back as HTTP header parameters. Cookies are mainly used in the following use cases: Cookies may support server-sessions where a specific set of session data is kept on the server. This data can then be set-up, re-used, enhanced in multiple sequential HTTP calls. Cookies allow single sign-on to web servers. A session ID transported by the cookie parameters might be used instead of a repetitive sending of logon data. Cookies can be used to enable load balancing on the servers. Cookies are transported as name-value pairs of the attributes Set-Cookie and Cookie in the HTTP header. In case that a session has to be kept during a sequence of HTTP calls, the response message of the first HTTP call of that session returns the cookie information in the Set-Cookie attribute: HTTP/1.0 200 OK Content-Type: text/xml; charset=utf-8 Set-Cookie: SessionID=myOwnPrivateSession12345 All following HTTP calls sent within the scope of that session will make use of the content of the Set-Cookie parameter. The client application will have to provide the cookie information of the initial response message in all following request messages. This 1 See: http://www.w3.org/tr/2000/note-soap-20000508/ - 1 -

information is transported in the Cookie attribute of the HTTP header of the request message: POST /service/services/myservice HTTP/1.0 Content-Type: text/xml; charset=utf-8 Host: <host>:<port> Cookie: SessionID=myOwnPrivateSession12345 The server application will than allocate the HTTP call to the correct session. 2.2 How to Handle Cookies in XI Since XI 3.0 SP 20 (SAP NetWeaver 7.0 SP12, Usage Type Process Integration, respectively), HTTP header attributes can be set and read in the SOAP adapter using the Axis Framework provided by the Adapter Engine. The content of the header attributes can be transferred from/to the DynamicConfiguration header of the XI SOAP protocol using the DynamicConfigurationHandler of the Axis Framework. The relevant settings will be explained in details in section 3. The XI-header parameters of the DynamicConfiguration (the so-called adapter-specific message attributes ASMAs) can then be accessed (read/write) in a mapping program. The following schema provides an overview how cookies can be handled during message processing in XI. 1. During the first call (logon, session create, ) the server application creates cookie to identify the session and sends it in the Set-Cookie parameter of the HTTP header of the response message of the synchronous call. 2. The SOAP adapter transfers the header parameter Set-Cookie to the DynamicConfiguration header of the XI SOAP message using the Axis framework. 3. The DynamicConfiguration header of the XI SOAP message can be accessed by means of a mapping program and its content can be transferred to the message payload. - 2 -

4. The client application handles the cookie within its session and adds it to the payload of all following calls belonging to that session. 5. A mapping program transfers the content of the cookie to the DynamicConfiguration header of the XI SOAP message. 6. By means of the Axis framework the content of the cookie is written to the HTTP header of synchronous request message in the SOAP adapter. 7. The server application allocates the HTTP call to the correct session. 2.3 How to set the SOAPAction HTTP Header Field dynamically The handling of the SOAPAction HTTP Header field in the Axis Framework of the SOAP adapter follows the schema of the Cookie attribute described in section 3.3: In a first step an ASMA of the DynamicConfiguration header of the XI SOAP protocol has to be filled with the relevant value (e.g. by means of a mapping). Its content is then populated to the HTTP header using the DynamicConfigurationHandler of the Axis Framework. Since the configuration for the SOAPAction header field varies slightly from the one for the Cookie attribute, it will be highlighted in section 3.4. - 3 -

3 The Step By Step Solution 3.1 General settings for the Axis Framework of the SOAP adapter 1. Set up the SOAP receiver Communication Channel to handle HTTP header parameter dynamically It is important to set following parameters: Transport Protocol HTTP(Axis) Message Protocol Axis Keep XI Headers true 3.2 Transferring the content of Set-Cookie to the message payload 1. We assume that the content aimed for the cookie is provided by the Set- Cookie parameter in the HTTP message header. 2. To transfer the HTTP header parameter Set-Cookie to the XI s Dynamic Configuration header called SetCookie add a module of type AF_Adapters/axis/HandlerBean to your processing sequence of the SOAP receiver Communication Channel created before. It has to be inserted just before the predefined module xires. You may choose an arbitrary name as module key (here dcres ) HTTP/1.0 200 OK Content-Type: text/xml; charset=utf-8 Set-Cookie: SessionID=myOwnPrivateSession12345-4 -

3. Specify the following parameters for that module Modul e Key dcres Parame ter Name handler.type Parameter Value java:com.sap.aii.axis.xi.xi 30DynamicConfigurationHandl er dcres key.a read http://sap.com/xi/system/ht TP SetCookie dcres locatio n.a header dcres value.a Set-Cookie Your Module Configuration should look like this: 4. Set up a mapping program for the response message (here: a Message Mapping). Develop a user-defined function getheaderparameter to transfer the content of XI s Dynamic Configuration parameter SetCookie to the message payload. public String getheaderparameter(string paramname,string paramnamespace,container container){ //write your code here DynamicConfiguration conf = (DynamicConfiguration) container.gettransformationparameters(). get(streamtransformationconstants.dynami C_CONFIGURATION); DynamicConfigurationKey key = DynamicConfigurationKey.create(paramName space, paramname); String value = conf.get(key); 5. Set up a mapping to transfer the parameter to the relevant field of your message payload. The input parameters have to follow the names of the keys of XI s Dynamic Configuration header defined in step 3 of this section. 6. This field can now be evaluated in your client application and can be used in the following calls of your session. } return value; <Item>SessionID=myOwnPrivateSession12345</Item > - 5 -

3.3 Filling the Cookie parameter of the HTTP header 1. We assume that the content aimed for the Cookie parameter is provided by the message payload (here: within a field called Item). 2. Set up a mapping program for the request mapping (here: a Message Mapping). Develop a user-defined function setheaderparameter to transfer the content of the message payload to XI s Dynamic Configuration parameter Cookie. <Item>SessionID=myOwnPrivateSession12345</Item > public String setheaderparameter(string paramvalue,string paramname,string paramnamespace,container container){ //write your code here DynamicConfiguration conf =(DynamicConfiguration) container.gettransformationparameters(). get(streamtransformationconstants.dynami C_CONFIGURATION); DynamicConfigurationKey key =DynamicConfigurationKey.create(paramNam espace, paramname); conf.put(key, paramvalue); } return paramvalue; 3. Set up a mapping to transfer the parameter to XI s Dynamic Configuration parameter Cookie. The input parameters have to follow the names of the keys of XI s Dynamic Configuration header defined in step 5 of this section (here: http://sap.com/xi/system/ht TP Cookie). 4. To transfer XI s Dynamic Configuration header called Cookie to the HTTP header parameter Cookie you have to add two modules of type AF_Adapters/axis/HandlerBean to your processing sequence of the SOAP receiver Communication Channel created before. They have to be inserted just after the predefined module xireq. You may choose an arbitrary name as module key (here dcreq and rem ) - 6 -

5. Specify the following parameters for these modules Modul e Key dcreq Parame ter Name handler.type Parameter Value java:com.sap.aii.axis.xi.xi 30DynamicConfigurationHandl er dcreq key.b write http://sap.com/xi/system/ht TP Cookie dcreq locatio n.b header dcreq value.b Cookie rem rem handler.type namespa ce java:com.sap.aii.axis.soap. HeaderRemovalHandler http://sap.com/xi/xi/messag e/30 Your Module Configuration should look like this. Note: 1. The parameters key.c, location.c and value.c are discussed in section 3.4 2. The module rem has to be used in order to remove the XI specific SOAP header. 6. The header of your HTTP request looks like the following POST /service/services/myservice HTTP/1.0 Content-Type: text/xml; charset=utf-8 Host: <host>:<port> SOAPAction: "urn:dosomething" Cookie: SessionID=myOwnPrivateSession12345-7 -

3.4 Filling the SOAPAction parameter of the HTTP header 1. We assume that the content aimed for the SOAPAction parameter is provided by the message payload (here: within a field called Item). 2. Set up a mapping program for the request mapping (here: a Message Mapping). Develop a user-defined function setheaderparameter to transfer the content of the message payload to XI s Dynamic Configuration parameter THeaderSOAPACTION (You may reuse the user-defined function of step 2 of section 3.3). <Item>urn:doSomethingDifferent</Item> public String setheaderparameter(string paramvalue,string paramname,string paramnamespace,container container){ //write your code here DynamicConfiguration conf =(DynamicConfiguration) container.gettransformationparameters(). get(streamtransformationconstants.dynami C_CONFIGURATION); DynamicConfigurationKey key =DynamicConfigurationKey.create(paramNam espace, paramname); 3. Set up a mapping to transfer the parameter to XI s Dynamic Configuration parameter THeaderSOAPACTION. The input parameters have to follow the names of the keys of XI s Dynamic Configuration header defined in step 5 of this section. You can make use of the Adapter-Specific Message Attribute http://sap.com/xi/xi/system /SOAP THeaderSOAPACTION of the SOAP adapter. 4. To transfer XI s Dynamic Configuration header called THeaderSOAPACTION to the HTTP header parameter SOAPAction, add two modules of type AF_Adapters/axis/HandlerBean to your processing sequence of the SOAP receiver Communication Channel created before. They have to be inserted just after the predefined module xireq. You may choose an arbitrary name as module key (here dcreq and rem ) } conf.put(key, paramvalue); return paramvalue; - 8 -

5. Specify the following parameters for these modules Module Key xireq xireq dcreq Parame ter Name default SOAPAct ion handler.type handler.type Parameter Value urn:dosomething java:com.sap.aii.axis.xi.x I30OutboundHandler java:com.sap.aii.axis.xi.x I30DynamicConfigurationHan dler dcreq key.c write http://sap.com/xi/xi/syste m/soap THeaderSOAPACTION dcreq locatio n.c context dcreq value.c javax.xml.rpc.soap.http.so apaction.uri rem rem handler.type namespa ce java:com.sap.aii.axis.soap.headerremovalhandler http://sap.com/xi/xi/messa ge/30 Your Module Configuration should look like this. Note: 1. It is mandatory to set the parameter defaultsoapaction in module xireq 2. The parameters key.b, location.b and value.b are discussed in section 3.3. 3. The module rem has to be used in order to remove the XI specific SOAP header. 6. The header of your HTTP request looks like the following POST /service/services/myservice HTTP/1.0 Content-Type: text/xml; charset=utf-8 Host: <host>:<port> SOAPAction: "urn:dosomethingdifferent" Cookie: SessionID=myOwnPrivateSession12345-9 -

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