Actually this is my problem. I generated the stub code and it created
two java classes: webservice2stub.java and
webservice2callbackhandler.java. If i use WTP webservice client wizard
in Eclipse i only get the webservice2stub.java so i assume i dont need
the webservice2callbackhandler.java. But what do i do with the
webservice2stub.java. Where exactly do i have to put it and more
importand how do ich call the stub code from the jsp page and what
functions do i call to do that.
I know thats a lot of stuff iam 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.
> 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
[quoted text clipped - 4 lines]
> 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.

Signature
Lew
cod3nam3 - 10 Nov 2007 09:53 GMT
> > Actually this is my problem. I generated the stub code and it created
> > two java [sic] classes: webservice2stub.java and
[quoted text clipped - 49 lines]
> --
> Lew
I still don't get it. I've now done all that u suggested, but i still
don't get it. And using Google i still haven't found one decent
example that is actually proper explained.
I reduced everything to that:
Webservice:
package pack;
public class Wser {
public double test(double a){
return a+a;
}
}
I have deployed it as a webservice with the name webs2.
So please can someone write a simple jsp client to that, so i finally
can get an idea how this works.
I read the Java EE Tutorial, i tried the examples and a lot of other
examples on the net. I can't get this working.
Andrew Thompson - 10 Nov 2007 11:38 GMT
...
>I have deployed it as a webservice with the name webs2.
>So please can someone write a simple jsp client to that, so i finally
>can get an idea how this works.
>I read the Java EE Tutorial, i tried the examples and a lot of other
>examples on the net. I can't get this working.
I have not read this thread carefully, nor do know the
immediate answer. But from my scanning of the questions
and responses, I am promted to ask..
Have you considered hiring a consultant, for this?
It seems like you need specific, step-by-step help.
Usenet newsgroups are bad for that, whereas consultants
are excellent (though much more expensive).

Signature
Andrew Thompson
http://www.athompson.info/andrew/
Ed Kirwan - 10 Nov 2007 11:51 GMT
> Andrew Thompson
http://www.athompson.info/andrew/
Link's down, Andrew.

Signature
.ed
www.EdmundKirwan.com - Home of the mathematical laws of encapsulation.
cod3nam3 - 10 Nov 2007 14:36 GMT
> > Andrew Thompson
>
[quoted text clipped - 6 lines]
>
> www.EdmundKirwan.com- Home of the mathematical laws of encapsulation.
Solved. You need Jakarta Taglibs IO.
And the client could look something like this:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<%@ taglib uri="/WEB-INF/taglibs-io.tld" prefix="io" %>
<%
final String urlLocalhost =
"http://localhost:8080/axis2/services/webs2";
String url = request.getParameter( "url" );
String a = request.getParameter( "a" );
url = ( null != url ) ? url.trim() : urlLocalhost;
a = ( null != a ) ? a.trim() : "64";
%>
<html>
<head> <title>webs</title> </head>
<body>
<h2>webs</h2>
<form method="post"><pre>
Enpoint-URL : <input type="text" name="url" value='<%= url %>'
size=80>
Wert : <input type="text" name="a" value='<%= a %>'
size=20>
<input type="submit" name="submit"
value="Rechnen">
</pre></form>
<h3><hr>test( <%= a %> ) -->
<% out.flush(); %>
<io:soap url="<%= url %>" SOAPAction="">
<io:body>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
envelope/">
<SOAP-ENV:Body>
<m:test xmlns:m="http://pack">
<in0><%= a %></in0>
</m:test>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</io:body>
</io:soap>
<hr></h3>
</body>
</html>
cod3nam3 - 10 Nov 2007 14:38 GMT
@Andrew: no thanks, i'am just a student...