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 2006



Tip: Looking for answers? Try searching our database.

Occur "NoSuchServiceException" using Remoting call

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JayTsao - 18 Apr 2006 11:02 GMT
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
Takatoshi - 19 Apr 2006 10:30 GMT
hello... i know this may sound silly, but try changing your publish settings to flashplayer 6, i had mine set to 8 and it messed up so much
 
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.