Re: NetConnection.Call.Failed

[email protected]
Newsgroups gmane.comp.java.openamf.user
Message-ID <[email protected]>
Ok, I´m so Sorry Martin!

Well, I created one class in Flash and one class in Java and I´m trying to
change objects between them.


Thanks for your interest in help me!!


my web.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<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>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet>
		<servlet-name>AdvancedGateway</servlet-name>
		<display-name>AdvancedGateway</display-name>
		<description>AdvancedGateway</description>
		<servlet-class>org.openamf.AdvancedGateway</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>
		<load-on-startup>1</load-on-startup>
	</servlet>
  <servlet>
    <servlet-name>ServletRedirector</servlet-name>
   
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
  </servlet>
	<servlet-mapping>
		<servlet-name>DefaultGateway</servlet-name>
		<url-pattern>/gateway</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>AdvancedGateway</servlet-name>
		<url-pattern>/gateway2</url-pattern>
	</servlet-mapping>
  <servlet-mapping>
    <servlet-name>ServletRedirector</servlet-name>
    <url-pattern>/ServletRedirector</url-pattern>
  </servlet-mapping>
	<session-config>
		<session-timeout>30</session-timeout>
	</session-config>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>
</web-app>



and my actionscript is:


import Usuario.as;

import mx.remoting.*;

conn =
NetServices.createGatewayConnection("http://localhost:8080/openamf/gateway");


servico = conn.getService("org.openamf.examples.Centralizador", this);


Object.registerClass("Usuario", Usuario);


var novoUsuario:Usuario = new Usuario();
	novoUsuario.nome = "Flavio";
	trace(novoUsuario.toString());


trace("--------------------");
trace("  - SendUser - ");


servico.sendUser(novoUsuario);

function sendUser_Result(result)
{
	trace("Send User (correctly): " + result);

	trace(" ------------------ ");
	trace(" - getUser - ");


	servico.getUser();
}

function getUser_Result(result)
{
	trace("Get User (correctly): " + result);
}


_global.System.onStatus = function(status)
{
	trace(" - onStatus:");
	trace(" codigo:       " + status.code);
	trace(" level:        " + status.level);
	trace(" type:         " + status.type);
	trace(" rootcause:    " + status.rootcause);
	trace(" descricao:    " + status.description);
	trace(" details:      " + status.details);
}

my class Java is:

package pacote;
import java.util.logging.Logger;
import com.carbonfive.flash.ASTranslator;
import flashgateway.io.ASObject;


public class Centralizador {
	private static final Logger log =
Logger.getLogger(Centralizador.class.getName());

	private Usuario usuario;

	public void sendUser(ASObject usuarioAS)
	{
		ASTranslator t = new ASTranslator();
		usuario = (Usuario)t.fromActionScript(usuarioAS);

		log.info("usuario recolhido: " + usuario.toString());
	}
	public ASObject getUser()
	{
		ASTranslator t = new ASTranslator();
		log.info("usuario a enviar: " + usuario.toString());

		return (ASObject)t.toActionScript(usuario);
	}
}


and... my other class:

package pacote;
import java.io.Serializable;

public class Usuario implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	private String nome;


	public String getNome(){
		return nome;
	}


	public void setNome(String novoNome)
	{
		nome = novoNome;
	}


	public String toString()
	{
		return "Usuario[" + getNome() + "]";
	}
}

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.