Invoking java service from jsp


How to invoke a Java service from a jsp? I have a “Test” java service which performs a concatenation. I want to do this from the webbased form. How to call the service??

Thanks in advance,

In your JSP use this tag to call a wm service:
“<webm:invoke>” - inside the tag write serviceName=“folderName:Test”

Make sure you include the tag lib at the begining of JSP:
taglib uri=“http://webm-taglib.tld” prefix=“webm”
For detail, pls look at documentation.

Hope this helps

Thanks Ashis for the reply.
Where can I find the documentation on this?

And documentation on,

  1. registering a service in an application server
  2. invoking the registered service from a JSP which is deployed in that application server.


We can find in webMethods JavaServer Pages Developers Guide…

I was able to successfully invoke a service, which does not take any input from the user.
When I tried to pass a parameter to a service from the JSP, i got struck up. Which tag I shd use? Can anyone suggest a link or document for this? (The documents I referred have not talked abt this)


Hi, Padmanaban.

I wrote an article for the webMethods Ezine this month that may be helpful for you. The article is titled, “Using HTML to submit data to Flow” and applies to your use case.

You can read about sending variables to a webMethods Flow at

You can using wM JSP tag webm:scope to set the parameters that used when invoking services, just like <webm:scope> – inside the tage writing options=“param(num1=‘c123’) param(num2=‘easdfasdfadsfasdfasd’)”, then you can invoke the service using the parameters in the scope.
The following is an simple example hope it’s helpful for you.
Flow service Test1:Flow3 needs two parameters, one is num1, the other is num2.

<webm:scope>-- options=“param(num1=‘c123’) param(num2=‘easdfasdfadsfasdfasd’)”
<webm:invoke/> – serviceName=“Test1:Flow3”
Final result: <webm:value>

If you want to passing the dynamical parameters, you can using webm:usePipeline to access the variables in IS pipeline before invoking the IS service. The following is a sample code, wish it is helpful for you ! The IS service Test1:Flow3
needs two input parameters, one is num1, the other is num2.

<%@> – page language=“java” contentType=“text/html” import=“*”
<%@> – taglib uri=“http://webm-taglib.tld” prefix=“webm”

<%!> – String num1=“111234”;
<%!> – String num2=“aaabbb”;

<% IDataCursor pipelineCursor_1 = webm_pipe.getCursor();
IDataUtil.put(pipelineCursor_1, “num1”, num1);
IDataUtil.put(pipelineCursor_1, “num2”, num2);
<webm:invoke> – serviceName=“Test1:Flow3”
Final result: <webm:value> – variable=“result”

I have a hard time using the webm:usePipeline.

My code is:
<% out.print(webm_pipe.toString());
IDataCursor idc = webm_pipe.getCursor();


I can print the webm_pipe like it says in the JSPDevGuide.pdf, but when I try to get its cursor I get a NullPointerException (if I comment the line out, the page loads but lacks the input).

What am I doing wrong?

This is so long off but I want to respond for someone who may stumble over here. The reason for your null error is that you have to either import the proper classes or use an absolute notation. So it would be:
or idc = webm_pipe.getCursor();
Good day.

Yemi Bedu

Sorry for not formatting the html. Here we go, remove underscores in your document:
Good day.

Yemi Bedu