all groups > macromedia flash flash remoting > july 2004 >
You're in the

macromedia flash flash remoting

group:

Problem getting servlet services to work


Problem getting servlet services to work beanhammer
7/16/2004 9:40:38 PM
macromedia flash flash remoting:
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.
Re: Problem getting servlet services to work play();
4/16/2005 12:00:00 AM
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();
RE: Problem getting servlet services to work snapple
4/16/2005 12:00:00 AM
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 :)

From http://www.developmentnow.com/g/72_2005_4_0_0_356191/Problem-getting-servlet-services-to-work.htm

Posted via DevelopmentNow.com Groups
AddThis Social Bookmark Button