| Join wMUsers | Blog at wMUsers | User Control Panel | Site Map | webMethods Jobs |For Employers |
![]() |
![]() |
IntroductionFor the webMethods Integration Server, "native" refers to the server's ability to call an API directly. With respect to C/C++, the webMethods concept of native is not as accurate as webMethods makes it sound. An entire chapter of the webMethods Developer User's Guide is devoted to "Building Services in C/C++" so it is easy to see where managers and developers are misled. Seamlessly integrating IS and back-end systems at the API level can be critical, especially where back-end systems limit access to its internal underlying data other than through an API or where some complexity discourages direct access to its data store. The webMethods Developer User’s Guide illustrates an approach to building services in C/C++. The samples and examples are tedious for developers, are not efficient and offer little code reusability. This article discusses the pitfalls associated with the webMethods approach and proposes a better approach based on the Façade design pattern and Java Native Interface (JNI). This proposed approach allows a back-end system's C/C++ API to be exposed to the webMethods Integration Server as reusable, efficient, object-oriented services. The pitfalls of the webMethods approachLet’s look at what’s involved in building services using C/C++, according to webMethods. To generate a C service from the webMethods Developer, one must specify a specification and generate a C service based on that specification. The mechanical procedure is select "File > New", select "Specification" and go through the rest of wizard. After generating a specification, again select "File >New", select "C Service" and then finish the rest of the wizard. webMethods Developer then generates a Java service that loads a DLL or shared library, which must be implemented by the user in C/C++. The Java generated skeleton code can be seen in the Source and Shared tabs. ![]() Source Code ![]() Shared Code In addition, Developer generates a source code file in C and a make file. Users are required to add custom Java code to the service, provide the implementation to the C file, and then accurately modify the make file. Inspecting these generated codes, it is clear that IS uses JNI to bridge to the C/C++ code. Modifying this generated, skeleton code by adding in your own custom code results in code that is, at best, "spaghetti" code and, at worst, inefficient and non-reusable. The webMethods-supported approach has several pitfalls:
In addition, when trying to create a subfolder to contain C services, if the subfolder’s parent folder already contains some C services, webMethods Developer does not seem to handle this situation gracefully. Façade design patternThe Façade design pattern "provides a unified interface to a set of interfaces in a subsystem. Façade defines a higher-level interface that makes the subsystem easier to use"1. Clearly, the Façade design pattern is applicable for webMethods-based integrations where 1) the subsystem is the back-end system, and 2) its interface is in the form of a C/C++ API. The goal is to build a façade or an interface layer that allows the Integration Server Java services to access the back-end system as clients. Go Deeper on the Subject: The wMUsers Discussion Forums Kevin Le has 10 years experience in the IT industry. Since 2000, he has been working with WebMethods, first on a B2B project and recently on an EAI project. Prior to that, he was involved in a couple of projects utilizing J2EE technologies and numerous C++ projects. His recent computer-related interests include Web Services and J2EE. Kevin holds certification as a WebMethods Certified Business Partner Integration Developer and a Sun Certified Java Programmer.
Kevin works for Novoforum, Inc and can be reached via email at |
| © All Rights Reserved, 2001-2008. |