all groups > macromedia flash flash remoting > april 2006 >
You're in the

macromedia flash flash remoting

group:

Occur "NoSuchServiceException" using Remoting call


Occur "NoSuchServiceException" using Remoting call JayTsao
4/18/2006 12:00:00 AM
macromedia flash flash remoting:
This problems are in the Flash Remoting MX for java environment.
Please help to look what's problems?

Using Flash 8 to careate a flash file, "say.fla"
Using ActionScript2.0
Using JDK 1.4.2_09
Using Tomcat 4.1.31

I installed Flash Remote Gateway Servlet (from "flashgateway-samples.war") to
Tomcat and using contextRoot is "flashservices".

Then flash using remote gateway to call java bean are successfully.
Then I write a new servlet "FlashServlet" add to Flash Remote Gateway web
application.
I using browser just access servlet, it work.

Then modify my flash to call this servlet, always occur
"flashgateway.adapter.NoSuchServiceException: No service named flashservices
is known to Flash Remoting MX"

The servlet code is below:
------------------------------------------------------
package chess;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class FlashServlet extends HttpServlet {

public void service(HttpServletRequest req, HttpServletResponse rsp)
throws ServletException, IOException {

System.out.println("System out from FlashServlet");
req.setAttribute("FLASH.RESULT", "Test by FlashServlet");
}
}
------------------------------------------------------

The add part for this servlet in the web.xml are below:
------------------------------------------------------
<servlet>
<servlet-name>ChessFlashServlet</servlet-name>
<display-name>ChessFlashServlet</display-name>
<servlet-class>chess.FlashServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>ChessFlashServlet</servlet-name>
<url-pattern>/chessServlet</url-pattern>
</servlet-mapping>
------------------------------------------------------

After start Tomcat, I just using browser to connect
"http://localhost:8080/examples/chessServlet" servlet, you can see "
System out from FlashServlet" string in the Tomcat standard output.

The I using the flash to call servlet by remoting gateway, it's below:
------------------------------------------------------
import mx.remoting.NetServices;
import mx.remoting.Connection;

mx.remoting.NetServices.setDefaultGatewayUrl("http://localhost:8080/flashservice
s/gateway");
gatewayConnnection = mx.remoting.NetServices.createGatewayConnection();
flashtestService = gatewayConnnection.getService("flashservices", this);
flashtestService.ChessFlashServlet();

function ChessFlashServlet_Result(result) {
output_label.text = result;
}

function ChessFlashServlet_Status(result){
output_label.text = "status: " + result.details;
}
------------------------------------------------------


FYI

Jay


Re: Occur "NoSuchServiceException" using Remoting call Takatoshi
4/19/2006 12:00:00 AM
AddThis Social Bookmark Button