Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / April 2005



Tip: Looking for answers? Try searching our database.

Problem getting servlet services to work

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
beanhammer - 16 Jul 2004 22:40 GMT
I have installed mm's flashgateway and gotten most of the flash remoting
examples to work.  However, I want to call a servlet as a service as described
in the Flash Gateway documentation and on page 254 of the Oreilly Flash
Remoting book.  I have everything set up exactly as described in the Flash
Gateway document and the book and it keeps generating a NoSuchServiceException.
"No service named myservice is known to Flash Remoting MX".

Has anyone else been able to get servlet services to work?  I notice that
OpenAMF does not even support servlet services.  Not sure why.
play(); - 16 Apr 2005 11:41 GMT
Hi  beanhamme,

..or anyone who has had the same problem., i am experiencing the same problem
too. Can anyone here give any advice as to common problems, my fornt-end code
is as follows:

[code]
#include "NetServices.as"
#include "NetDebug.as"

NetServices.setDefaultGatewayUrl(
"http://localhost/flashServletExample/gateway" );
var gatewayConnection:NetConnection = NetServices.createGatewayConnection();
var service = gatewayConnection.getService( "flashServletExample", this );

service.ServletService( "Hello." );

function showServletResult( result ):Void
{
    trace( result );
}
[/as]

and my Java servlet is as follows:

[code]
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.IOException;

public class ServletService extends HttpServlet
{
    public void service( HttpServletRequest request, HttpServletResponse
response ) throws ServletException
    {
        List params = ( List ) request.getAttribute( "FLASH.PARAMS" );
        request.setAttribute( "FLASH.RESULT", params );
    }
}
[/code]

and my web.xml is as follows:

[code]
<web-app>

    <servlet>
        <servlet-name>DefaultGateway</servlet-name>
        <display-name>DefaultGateway</display-name>
        <description>DefaultGateway</description>
        <servlet-class>org.openamf.DefaultGateway</servlet-class>
        <init-param>
            <param-name>OPENAMF_CONFIG</param-name>
            <param-value>/WEB-INF/openamf-config.xml</param-value>
            <description>Location of the OpenAMF config file.</description>
        </init-param>
    </servlet>

    <display-name>flashServletExample</display-name>
    <description>This better work</description>
    <servlet>
        <servlet-name>ServiceServlet</servlet-name> <!-- mapping name below -->
        <servlet-class>ServiceServlet</servlet-class> <!-- name of class -->
    </servlet>

    <servlet-mapping>
        <servlet-name>DefaultGateway</servlet-name>
        <url-pattern>/gateway</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>ServiceServlet</servlet-name>
        <url-pattern>/ServiceServlet</url-pattern>
    </servlet-mapping>

</web-app>
[/code]

Thanks in advance for any help.

Regards, play();
snapple - 16 Apr 2005 18:54 GMT
So does openamf actually support Serlvet Services? I would really appreciate it if anyone had a solid answer because i have nearly had a breakdown today trying to get things towork.

Regards, snapple :)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.