What I do is I have an object that I store in the Servlet application scope
memory that interface with my Axis WebService.
In the JSP that do the work. I simply do:
// Retreive the WebService interface object that we cache as an
// application scoped object.
WSInterfacews = (WSInterface)application.getAttribute("ws") == null
? new WSInterface(endPoint, application)
: (WSInterface)application.getAttribute("ws");
ws.doTheThing("parmam1");
....
Where WSInterface.java looks like:
class WSInterface {
// ReportNet service
MyServiceLocator service = null;
MyPortType binding = null;
// Application context
ServletContext application = null;
// Tranformation factory
TransformerFactory tf = null;
public WSInterface(String endPoint, ServletContext app) throws Exception {
// Did we received a valid endPoint
if ( endPoint == null)
throw new Exception("Invalid endPoint provided: ["+ endPoint +"]");
// Instantiate the transformer factory
tf = TransformerFactory.newInstance();
// Retreive the service
service = new MyServiceLocator();
binding = service.getMyPort(new java.net.URL(endPoint));
// Keep a handle to the application context to retreive the ressources
application = app;
}
public void doTheThing(String thing) {
// Implement doTheThing
}
}
Enjoy!
Sylvain.
-----Original Message-----
From: Lai Jay Hung [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 5:51 AM
To: [EMAIL PROTECTED]
Subject: Re: How to start learning SOAP call...
Hello, Juergen
Thank you very much.
Actually, I have studied Web Service for a long time.
I am familiar with the concept of Web Sercice and have read most article
on
http://www.ibm.com/developerWorks/webservices/ and other sites.
I have tried to use WSTK(IBM),jwsdp(JAVA) and AXIS(APACHE) and the
examples on them.
But, my problem is how to call the example or other service on internet
like
StockQuote within a JSP page.
Because I am not familiar with Java and JSP technique, I don't get the
point how to implement a service call via JSP page.
Do I need to write a service call Java and compile to a class and use it
like a
<jsp:useBean> ?
Thanks again...
Jayhung
----- Original Message -----
From: "Juergen Kaatz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 13, 2002 5:26 PM
Subject: Re: How to start learning SOAP call...
>
> >How to start using JSP page to call Web Services On Internet ?
> >Is there any site or information can help me to start ?
> >Thankx ,
> >JayHung.
>
> Hello JayHung,
>
> First install the tomcat server, then download the axis software and try
> out all
> the examples delivered with axis. Starting with axis/soap/java is not
> trivial, but
> if you try to understand the examples it will be a good way.
>
> Furthermore, there are many sites on the web, which you can read.
>
> For example th ibm website has a lot of tutorials and examples :
> http://www.ibm.com/developerWorks/xml/ and
> http://www.ibm.com/developerWorks/webservices/
>
> Greetings
> Juergen
>
> -----------------------------
> Juergen Kaatz
> Entwickler / Developer
> WWE e-commerce IT GmbH
> Eiffestrasse 462
> 20537 Hamburg
> URL: http://www.e-commerceit.de/
> URL: http://www.iets.de/ (Internet Export Trading System)
> Tel: +49-40-2530659-32
> Fax: +49-40-2530659-50
> Tel. +49-40-2530659-0 (Zentrale)
> E-Mail : [EMAIL PROTECTED]
>
>
>
==========================================================
PC home �q�l�H�c�A�ӽнЦ�: http://www.pchome.com.tw
PC home Online �����a�x�G�|���Ĥ@�A�x�W�̤j���J�f����
==========================================================
This message may contain privileged and/or confidential information. If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so. Thank you.