Conversion Agent COM API Reference

Transcription

Conversion Agent COM APIReferenceSAP Conversion Agent by Informatica(Version 8.5)

SAP Conversion Agent COM API ReferenceVersion 8.5June 2008Copyright (c) 2001–2008 Informatica Corporation. All rights reserved.This software and documentation contain proprietary information of Informatica Corporation and are provided under a license agreement containing restrictions on use and disclosure and are alsoprotected by copyright law. Reverse engineering of the software is prohibited. No part of this document may be reproduced or transmitted in any form, by any means (electronic, photocopying,recording or otherwise) without prior consent of Informatica Corporation. This Software is protected by U.S. Patent Numbers and other Patents Pending.Use, duplication, or disclosure of the Software by the U.S. Government is subject to the restrictions set forth in the applicable software license agreement and as provided in DFARS 227.7202-1(a) and227.7702-3(a) (1995), DFARS 252.227-7013(c)(1)(ii) (OCT 1988), FAR 12.212(a) (1995), FAR 52.227-19, or FAR 52.227-14 (ALT III), as applicable.The information in this software and documentation is subject to change without notice. Informatica Corporation does not warrant that this software or documentation is error free.Informatica, PowerCenter, PowerCenterRT, PowerCenter Connect, PowerCenter Data Analyzer, PowerExchange, PowerMart, Metadata Manager, Informatica Data Quality, Informatica Data Explorer,Informatica Complex Data Exchange, Informatica On Demand Data Replicator, and Informatica B2B Data Exchange are trademarks or registered trademarks of Informatica Corporation in the UnitedStates and in jurisdictions throughout the world. All other company and product names may be trade names or trademarks of their respective owners.Portions of this software and/or documentation are subject to copyright held by third parties, including without limitation: Copyright Sun Microsystems. All rights reserved. Copyright 1985-2003Adobe Systems Inc. All rights reserved. Copyright 1996-2004 Glyph & Cog, LLC. All rights reserved.This product includes software developed by Boost (http://www.boost.org/). Permissions and limitations regarding this software are subject to terms available at http://www.boost.org/LICENSE 1 0.txt.This product includes software developed by Mozilla (http://www.mozilla.org/). Your right to use such materials is set forth in the GNU Lesser General Public License Agreement, which may be foundat http://www.gnu.org/licenses/lgpl.html. The Mozilla materials are provided free of charge by Informatica, “as-is”, without warranty of any kind, either express or implied, including but not limited tothe implied warranties of merchantability and fitness for a particular purpose.This product includes software developed by the Apache Software Foundation (http://www.apache.org/) which is licensed under the Apache License, Version 2.0 (the “License”). You may obtain a copyof the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.This product includes software developed by SourceForge (http://sourceforge.net/projects/mpxj/). Your right to use such materials is set forth in the GNU Lesser General Public License Agreement,which may be found at http://www.gnu.org/licenses/lgpl.html. The SourceForge materials are provided free of charge by Informatica, “as-is”, without warranty of any kind, either express or implied,including but not limited to the implied warranties of merchantability and fitness for a particular purpose.This product includes Curl software which is Copyright 1996-2007, Daniel Stenberg, daniel@haxx.se . All Rights Reserved. Permissions and limitations regarding this software are subject to termsavailable at http://curl.haxx.se/docs/copyright.html. Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyrightnotice and this permission notice appear in all copies.This product includes ICU software which is Copyright (c) 1995-2003 International Business Machines Corporation and others. All rights reserved. Permissions and limitations regarding this softwareare subject to terms available at license.jsp.This product includes OSSP UUID software which is Copyright (c) 2002 Ralf S. Engelschall, Copyright (c) 2002 The OSSP Project Copyright (c) 2002 Cable & Wireless Deutschland. Permissions andlimitations regarding this software are subject to terms available at .This product includes Eclipse software which is Copyright (c) 2007 The Eclipse Foundation. All Rights Reserved. Permissions and limitations regarding this software are subject to terms available .libstdc is distributed with this product subject to the terms related to the code set forth at http://gcc.gnu.org/onlinedocs/libstdc /17 intro/license.html.DISCLAIMER: Informatica Corporation provides this documentation “as is” without warranty of any kind, either express or implied, including, but not limited to, the implied warranties of noninfringement, merchantability, or use for a particular purpose. The information provided in this documentation may include technical inaccuracies or typographical errors. Informatica could makeimprovements and/or changes in the products described in this documentation at any time without notice.Part Number: DT-COM-86000-0001

Table of ContentsPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vObtaining Conversion Agent Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vChapter 1: Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Description of the COM API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Platform Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Programming Language Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Procedure for Using the API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Sample Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2RunCMService Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Main Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Chapter 2: Object Model Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5CMDS Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5GetServiceList Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6CMRequest Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Input Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Output Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Request Generation Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9CMEngine Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9InitEngine Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Exec Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10CMStatus Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10IsGood Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10GetDescription Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11GetSeverity Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11GetLogFile Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11GetLogDirectory Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Chapter 3: Deprecated COM API Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13CM COM Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13CMParsingEngine Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13CM COM2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17iii

ivTable of Contents

PrefaceThe Conversion Agent COM API Reference is written for developers who want to run transformations in aMicrosoft COM programming environment. The book documents the COM object model for activatingConversion Agent services within a COM application.Obtaining Conversion Agent DocumentationOn Windows platforms, the Conversion Agent documentation is supplied as online help with the software. Youcan download PDF copies of the Conversion Agent manuals from:http://help.sap.com/saphelp /content.htmv

viPreface

CHAPTER 1OverviewThis chapter includes the following topics: Description of the COM API, 1 Sample Application, 2Description of the COM APIAn application can run a Conversion Agent service by calling the Conversion Agent COM API. The API ismultithreaded and re-entrant, supporting high throughput applications.The API activates Conversion Agent Engine. It enables you to: Retrieve the names of deployed Conversion Agent services. Define the service to run. Define the input location or type, such as a file path, URL, string, stream, or buffer. Define the output location or type, such as a file path, string, or stream. Run the service. Retrieve the execution status.Note: The COM API does not support streamers, service parameters, multiple inputs and outputs, or runningConversion Agent Engine out-of-process. To use those features, use one of the other Conversion Agent APIs.Platform SupportThe COM API runs on Microsoft Windows platforms.Programming Language SupportThe examples and syntax in this book are presented in Microsoft Visual Basic 6.0.You can program in any language that offers COM (ActiveX) support, such as Visual Basic .NET or VisualC .1

Getting StartedFor a hands-on lesson on using the COM API, see Getting Started with Conversion Agent. The lesson uses theCOM API to program an application that runs a Conversion Agent service. The complete source code isprovided.Procedure for Using the APIThe following is a typical procedure for using the COM API:1.In Conversion Agent Studio, configure a transformation.2.Deploy the transformation as a Conversion Agent service.For more information on steps 1 and 2, see the Conversion Agent Studio User Guide.3.Program an application that calls the COM API to run the service.The application should perform the following operations: Optionally, use the CMDS object to retrieve the names of deployed Conversion Agent services. Use the CMRequest object to construct an execution request. The request specifies the service name andinput/output locations or types. Use the CMEngine object to execute the request. Use the CMStatus object to retrieve the execution status, such as the return code and any errorinformation.4.Compile the application.5.Install and run the application on a Windows host where Conversion Agent Engine is installed.Sample ApplicationThe following is a Visual Basic 6.0 application, which uses the COM API to run a Conversion Agent service.The Visual Basic project references the Conversion Agent COM API library, which is called CM COM3 1.0 TypeLibrary (CM COM3.dll).RunCMService FunctionThe application contains a RunCMService function, which calls the COM API. The function accepts a bufferstoring the input of a transformation. It generates the output as a string. The parameters InThe name of the Conversion Agent service.varBufInVariantInAn input buffer containing the source document of thetransformation.The buffer can contain either text or binaryinput.lngBufInLengthLongInThe length of the input buffer in bytes.strOutputStringOutA string containing the output of the transformation. In caseof an error, the string contains an error message.Return valueIntegerOut1 if the service ran successfully.Source CodeFunction RunCMService(2Chapter 1: Overview

strService As String,varBufIn As Variant,lngBufInLength As Long,str

DISCLAIMER: Informatica Corporation provides this documentation “as is” without warranty of any kind, either express or implied , including, but not limited to, the implied warranties of non- infringement, merchantability, or use for a particular purpose. The information provided in this documentation may include tech nical inaccuracies or typographical errors. Informatica could make .