Re: Servlet and openamf

"Parag Dharmadhikari" <[email protected]> Tue, 3 Apr 2007 17:00:10 +0530
Newsgroups gmane.comp.java.openamf.user
Message-ID <CA74C4124F0CC64C8BBC33789F60020D017CF97F@MPMULBPEX01.corp.mphasis.com>
Hi All,

 

After battle with code I could figure out that by using AdvancedGateway
and by extending TestServlet from org.openamf.AdvancedGateway atleast I
could invoke method from servlet. This method is normal java method. But
still could not understand how I could get hold of request & response
object in servlet class. Because neither service() nor doPost/doGet
methods are getting invoked.

 

My Servlet code is 

 

 

package com.flashdb.services.servlets;

 

import javax.servlet.ServletException;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import com.flashdb.services.remoteHelloWorld;

 

import org.openamf.AdvancedGateway;

import org.openamf.examples.Authentication;

 

public class TestServlet extends AdvancedGateway {

 

      public void init() throws ServletException {

            System.out.println("inside init");

      }

      

      /*public void service (HttpServletRequest request,
HttpServletResponse response){

            System.out.println("inside service");

      }*/

      

      public void doGet (HttpServletRequest request, HttpServletResponse
response){

            System.out.println("inside doGet");

      }

 

      public void doPost (HttpServletRequest request,
HttpServletResponse response){

            System.out.println("inside doPost");

      }

 

      public String echo(String msg,Authentication authentication){

            System.out.println("inside echo");

            return msg;

      }

 

}

 

echo() method is getting invoked but I am interested in getting hold of
HttpServletRequest & HttpServletResponse.

 

And openamf-config.xml is

 

<service>

                        <name>TestServlet</name>

 
<service-location>com.flashdb.services.servlets.TestServlet</service-loc
ation>

                        <invoker-ref>Java</invoker-ref>

                        <method>

                        <!-- Operation's are matched by the name and
parameters -->

                                    <name>echo</name>

                                    <state-bean-ref>

 
<name>Authentication</name>

                                    </state-bean-ref>

                                    <parameter>

                                    <!-- 

                                                type can be the the name
of the class, 

                                                a * for any types,

                                                or a ? any 1 type

                                    -->

                                    <type>*</type>

                                    </parameter>

                        </method>

</service>

 

 

Can anybody help me?

 

Regards

Parag

 

________________________________

From: [email protected]
[mailto:[email protected]] On Behalf Of Parag
Dharmadhikari
Sent: Tuesday, April 03, 2007 12:45 PM
To: [email protected]
Subject: Re: [Openamf-user] Servlet and openamf
Importance: High

 

Sorry for typo error... point 1 should then become
myservice.TestServlet("hi");

 

________________________________

From: [email protected]
[mailto:[email protected]] On Behalf Of Parag
Dharmadhikari
Sent: Tuesday, April 03, 2007 12:28 PM
To: [email protected]
Subject: [Openamf-user] Servlet and openamf

 

Hi All,

 

After writing the simple java class with openamf, I am trying to invoke
servlet with openamf. But I have following doubts:

 

1.	In flash MX we can call service method of the servlet. So can
same be done in openamf.

So my flash code would become

 

myService = new
Service("http://172.20.77.162:8080/helloWorld/gateway",myLogger,"com.fla
shdb.services.servlets.TestServlet",null,null);

 

And then invoke myservice.service();

 

2.	As per Flash MX document service() method is executed from
servlet so in case of openamf what is the course of action? Can doGet()
or doPost() be invoked in same way?
3.	Also in Flash MX, service () method receives FLASH.PARAMS
argument which is java.util.list so in case of openamf can I use same
parameter or there is different parameter / tech. to be used?

 

Kindly guide me for above queries.

 

Regards

Parag

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Openamf-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openamf-user