A Brief Introduction to the JCo Server - Austin Sincock
来源:互联网 发布:php json base64 编辑:程序博客网 时间:2024/04/25 17:28
I am often asked for information as to how to call Java objects fromwithin an ABAP application. Although this functionality is included inthe JCo API, it is neither trivial nor easy to implement. In myupcoming book, Enterprise Java for SAP, I address the subject moreexhaustively and provide an in-depth tutorial application. However, forthe scope of this tip, I wanted to point you in the right direction forbuilding your own JCo server.
You may not know it, but everything you need to create a JCoserver is already available in the JCo download zip provided by SAP.The zip file includes several tutorial applications that show you howto build a sample server. Unfortunately, these examples are notdocumented very well, so the best way to learn the server is to playwith the actual Java classes.
To start with, check out the directory <JCO_INSTALL>/demofor all of the included tutorial Java class files. The files you areinterested in are Example5.java and Example7.java. Before running theseapplications, you must create an RFC destination in SAP that uses aregistered server program called 'JCOSERVER01'. Once this destinationexists, compile and execute one of these classes from the command lineand JCOSERVER01 will register itself to the specified RFC destination.
You can now write an ABAP application that calls thisregistered server program at the RFC destination to access some basicJava object functionality from within SAP. Review the example files todetermine the appropriate import/export parameters and structures foreach Java class.
Unlike other types of JCo development, the JCo server APIrequires that you extend the JCO.Server base class within your ownserver class. JCO.Server provides access to the key methods that mustbe overriden to provide access from within the SAP system.
In order to implement the JCO.Server, you must override atleast the handleRequest() method. This describes how to handle importparameters from the ABAP application and processes export parametersfor return to the ABAP program. handleRequest() takes a JCO.Functioninstance that describes the function structure, similar to thestructure definition found in the SAP Function Builder. In fact, youcan create shell RFC structures in SAP to describe the externalinterface implemented in the JCo server.
You will also need to implement one of the JCO.Server's defaultconstructors. This constructor calls the JCO.Server superclass andloads the actual server based your specific SAP system parameters and aJCO.Repository. This repository can be generated by SAP, if yourexternal interface has been defined there, or you can create your ownJCO.Repository with only the external interfaces used by the server.See the JCo examples for a demonstration of custom JCO.Repositorys.
Finally, you will need a server startup class that passes inthe appropriate SAP system values to the server startup method. In theJCo examples, this startup class is implemented internally in eachclasses' main() method. Hopefully, this will point you in the rightdirection for deploying a JCo server. Again, this is a fairly complextopic that is not easily approached through a single tip. However,there are some nuggets of gold buried within the JCo download thatshould get you going with a JCo server development.
Author Austin Sincock is a freelance Java/SAP consultant whocontributes regularly to Web and print journals. He can be reached at austin@opensourceguru.com. Check out his upcoming book Enterprise Java for SAP
- A Brief Introduction to the JCo Server - Austin Sincock
- brief introduction to the project
- A Brief Introduction to the JTAG Boundary Scan Interface
- A Brief Introduction to the log4net logging library, using C#
- A brief introduction to the Linux graphics stack
- a brief introduction to Loaders and the LoaderManager
- A Brief Introduction to IoC
- A Brief Introduction to IoC
- A Brief Introduction to REST
- A Brief Introduction to REST
- A Brief Introduction to OVF
- A Brief Introduction to Myself
- A brief introduction to VXLAN
- A Brief Introduction to XACML
- A Brief Introduction to UNIX SHELL Virus
- A brief introduction to geospatial coordinates
- A Brief Introduction to Multiset[STL]
- A Brief Introduction to Language Modeling
- java的历程
- 生成一般性规律的序列
- 基于服务的企业集成模式轻松入门,第 2 部分: 进一步介绍基本概念的演变
- 微软的下一个十年何去何从
- uClinux下移植Ne2000兼容的网卡驱动程序[转]
- A Brief Introduction to the JCo Server - Austin Sincock
- OpenBSD 加速 下载安装
- Linux音频编程指南
- 回调函数
- 学习程序
- 移植BOA中遇到的问题
- linux内核启动地址,解压缩,内核参数问题探讨【转】
- BS程序代码与安全与基本攻击/防御模式
- notes error:您没有执行此项操作的权限