TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Programing Languages > Java

Notices

Reply
 
Thread Tools Display Modes
Old 29-10-2007, 05:31 PM   #1
cod3nam3
Guest
 
Posts: n/a
jsp client for axis2 webservice

lam trying to write a jsp client for an axis2 web service.
The web service is already up and running, so the wsdl is already
created by axis2 automatically. I still don't know how to create a jsp
client, which would just call a axis2 web service function. I would
really appreciate ur help.

  Reply With Quote
Old 29-10-2007, 07:31 PM   #2
Chris ( Val )
Guest
 
Posts: n/a
Re: jsp client for axis2 webservice

On Oct 29, 9:42 pm, cod3nam3 <shakhnovskiy.i...@googlemail.com> wrote:
> lam trying to write a jsp client for an axis2 web service.
> The web service is already up and running, so the wsdl is already
> created by axis2 automatically. I still don't know how to create a jsp
> client, which would just call a axis2 web service function. I would
> really appreciate ur help.


Are you able to call it (test it) from the command line,
to check if it is returning a result?

I am in the same boat as you otherwise :-)

I have seen that a lot of people are having difficulty
with it, and I have to say that although the initial
setup is easy enough to get going (just dropping a war
file into place, and setting up the AXIS2_HOME) getting
the rest of it to gel is not a trivial thing to sort out,
at least not in my experience so far.

IMHO, the Axis project has some of the worst documentation
that I have ever come across. The documentation seems as if
though it was written in an arrogant way, oozing a sign of
vindictiveness that tends to push people away from it :-)

--
Chris


  Reply With Quote
Old 30-10-2007, 07:38 AM   #3
Arne Vajhøj
Guest
 
Posts: n/a
Re: jsp client for axis2 webservice

cod3nam3 wrote:
> lam trying to write a jsp client for an axis2 web service.
> The web service is already up and running, so the wsdl is already
> created by axis2 automatically. I still don't know how to create a jsp
> client, which would just call a axis2 web service function. I would
> really appreciate ur help.


The easiest way is to:
- generate stub code
- put the stub code into your web app
- call the stub code from your JSP page

Arne
  Reply With Quote
Old 30-10-2007, 07:31 PM   #4
Lew
Guest
 
Posts: n/a
Re: jsp client for axis2 webservice

Arne Vajhøj wrote:
> The easiest way is to:
> - generate stub code
> - put the stub code into your web app
> - call the stub code from your JSP page


That's the nutshell version of the answers over on clj.help for this question.

--
Lew
  Reply With Quote
Old 31-10-2007, 01:33 AM   #5
cod3nam3
Guest
 
Posts: n/a
Re: jsp client for axis2 webservice

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.

On 30 Okt., 13:51, Lew <l...@lewscanon.com> wrote:
> Arne Vajhøj wrote:
> > The easiest way is to:
> > - generate stub code
> > - put the stub code into your web app
> > - call the stub code from your JSP page

>
> That's the nutshell version of the answers over on clj.help for this question.
>
> --
> Lew



  Reply With Quote
Old 31-10-2007, 06:33 AM   #6
Lew
Guest
 
Posts: n/a
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
  Reply With Quote
Old 10-11-2007, 03:30 PM   #7
cod3nam3
Guest
 
Posts: n/a
Re: jsp client for axis2 webservice

On 31 Okt., 00:22, Lew <l...@lewscanon.com> wrote:
> 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


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.

  Reply With Quote
Old 10-11-2007, 05:30 PM   #8
Andrew Thompson
Guest
 
Posts: n/a
Re: jsp client for axis2 webservice

cod3nam3 wrote:
...
>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).

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.asp...neral/200711/1

  Reply With Quote
Old 10-11-2007, 05:30 PM   #9
Ed Kirwan
Guest
 
Posts: n/a
Re: jsp client for axis2 webservice

Andrew Thompson wrote:

> Andrew Thompson

http://www.athompson.info/andrew/

Link's down, Andrew.

--
..ed

www.EdmundKirwan.com - Home of the mathematical laws of encapsulation.
  Reply With Quote
Old 10-11-2007, 08:31 PM   #10
cod3nam3
Guest
 
Posts: n/a
Re: jsp client for axis2 webservice

On 10 Nov., 12:51, Ed Kirwan <IAmFrac...@hotmail.com> wrote:
> Andrew Thompson wrote:
> > Andrew Thompson

>
> http://www.athompson.info/andrew/
>
> Link's down, Andrew.
>
> --
> .ed
>
> 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 %> ) --&gt;
<% 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>

  Reply With Quote
Reply

Thread Tools
Display Modes




New To Site? Need Help?

All times are GMT +5.5. The time now is 02:51 AM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2009, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional