Re: jsp client for axis2 webservice
cod3nam3 wrote:
Actually this is my problem. I generated the stub code and it created
two java [sic] classes: webservice2stub.java and
Are you sure it wasn't "WebService2Stub.java"?
webservice2callbackhandler.java. If i [sic] use WTP webservice client wizard
and "WebService2CallbackHandler.java"?
in Eclipse i [sic] only get the webservice2stub.java so i [sic] assume i [sic] dont need
the webservice2callbackhandler.java. But what do i [sic] do with the
webservice2stub.java. Where exactly do i [sic] have to put it and more
importand how do ich call the stub code from the jsp [sic] page and what
functions do i [sic] call to do that.
I know thats a lot of stuff i [sic] am asking here, so if you know some how
to with code examples... that would help me a lot. Or if you habe the
time, could you write some short example.
Please do not top-post. Use trim-and-inline posting.
Read the Java EE tutorial on the Sun web site. It talks generally about how
to call logic from a JSP.
Essentially, all the JSP does is POST an HTTP request to the application
server. A servlet on the app server receives the request, parses out the
request parameters, and passes them along to an instance of a regular Java
class, usually a Bean. That object in turn will perform some processing, say,
calling one of the stub methods that you have. This will be just a series of
regular method calls, like
Result result = invokeService( ParmType parameter, ArgType argument );
where invokeService() is one of the methods in a logic or web-service stub class.
The object that the servlet called will produce a result. Using that result
and some identifier for what JSP made the request, the servlet decides what
JSP to show next, extracts a RequestDispatcher from the request and does a
call to the RequestDispatcher forward() method to invoke the new JSP. Usually
some result from the business logic will be embedded into a request attribute
or the session for the new JSP to use.
Google or search Sun for "Model 2 architecture" and the
"model-view-controller" paradigm, also called the "front-controller pattern",
as they apply to web apps. Read the Sun Java EE tutorial. Learn how to use
JSPs to call business logic, then it will be obvious how to call the
particular variety of business logic called a "web service client stub".
Examples abound on the Web. You don't need us to break our fingers coming up
with one when a few minutes search on your part will turn up so much better
stuff. GIYF.
--
Lew