RE: JAVA Service

How to write a JAVA Service in Developer.

do i need to do any before writing any java service plz help me this. its very urgent okey

waiting for the reply Guys

Hi

Have a look at the webMethods Developer’s User Guide, Chapter 12: Building Coded Services. There is information on how to build Java services within the webMethods Developer ide or your own Java ide (e.g. Eclipse).

You can find the document in the directory \Developer\doc

You can also refer to the GEAR document “Developer Handbook - GEAR 6.5 - White Paper” (GEAR_6_5_Developer’s_Handbook.pdf) for best practices, including Java services.

Regards,

Wayne

Vijay,

The easiest way to write Java services is indeed in Developer. Within a folder in a package, click New > Java service. You can then enter Java code into the editor within Developer.

Tip: First define the inputs/outputs for your service, then choose Tools > Generate code, For implementing this service, then accept the defaults. After the wizard has completed, paste (Ctrl-V) into your Java service window. This will generate suitable code using the IData API for reading the inputs and setting the outputs.
The Java IData API documentation can be found under the Help menu in Developer.

If, when you save a Java service, you get an error “unable to find compiler”, then do either one of the following:
a) Make sure that the Java compiler of your choice (javac) is in the Path of the user running Integration Server.

-or-

b) Define the complete path by editing the watt.server.compile extended setting. You can do this in Administrator (described in the IS Admin Guide). Set it to something like this:
watt.server.compile=C:\wm65\jvm\win142\bin\javac -classpath {0} -d {1} {2}
Or wherever your Java compiled is located. There is no need to restart IS after changing this setting.

Hope this helps.

Jonathan Heywood

Hi Vijay,

Java services in webmethods are coded using IData.

first create a Pipeline Cursor
since you have to retrieve the fields you desire form the pipeline.

IDataCursor pipelineCursor = pipeline.getCursor();

now…

IDataUtil.getString( pipelineCursor , “StirngName”);

this will retrieve the field StringName from Pipeline.

now you can do all the manipulation with this field.

and
if you want the field to be output of the java service you have to use.

IDataUtil.put(pipelineCursor , “String1Name”);

this String1Name will be the output of the java service.

and now that you have used the pipeline cursor you should destroy it.

pipelineCursor .destroy();

if you are facing specific problem… mention it…
i will try to solve it .
have a good time bye

1 Like

please give clear step-by-step information about how to configure java service.,