Hello.


I use xfire+aegis 1.2.3 (1.2.4 has critical a bug for me:

http://jira.codehaus.org/browse/XFIRE-831) without aegis configs.



I want to transfer Objects of unknown (at compile time) type:



public static class TestRpc implements ITestRpc {

 public Object call1() { return new myclass(); } // fail

 public myclass call0() { return new myclass(); } // ok

 public Object[] call2() { return new Object[]{new myclass()}; } // fail

 public Object[] call3() { return new Object[]{"123"}; } // ok

}

//myclass is a normal pojo class.

got:

[INFO] DefaultFaultHandler - Fault occurred!

<org.codehaus.xfire.fault.XFireFault: Unable to write

'[EMAIL PROTECTED]' [test.WSTest$myclass]. Type is

unknown.>org.codehaus.xfire.fault.XFireFault: Unable to write

'[EMAIL PROTECTED]' [test.WSTest$myclass]. Type is unknown.

        at

org.codehaus.xfire.aegis.type.basic.ObjectType.handleNullType(ObjectType.java:255)



attached simple junit test of it.



How can I get around this?

(How can I transfer Objects of unknown (at compile time) type)



-- 

  Artem Melentyev, UralSU, CS401

package test;

import junit.framework.TestCase;
import acmsoft.client.transport.WSClientTransport;
import acmsoft.server.ws.WebServiceServer;

public class WSTest extends TestCase {
	WebServiceServer starter = new WebServiceServer();
	WSClientTransport transport = new WSClientTransport("http://localhost:8091";);
	
	public static interface ITestRpc {
		public myclass call0();
		public Object call1();
		public Object[] call2();
		public Object[] call3();
	}
	public static class TestRpc implements ITestRpc {
		public Object call1() { return new myclass(); } // fail
		public myclass call0() { return new myclass(); } // ok 
		public Object[] call2() { return new Object[]{new myclass()}; } // fail
		public Object[] call3() { return new Object[]{"123"}; } // ok
	}
	public static class myclass {
		int a;
		public myclass() { a = 1; }
		public int getA() {
			return a;
		}
		public void setA(int a) {
			this.a = a;
		}
	}
	
	public void test1() throws Exception {
		starter.registerWS(ITestRpc.class, new TestRpc());
		starter.start();
		ITestRpc testRpc = (ITestRpc) transport.getService(ITestRpc.class);
		assertEquals(1, testRpc.call0().getA());
		assertEquals("123", testRpc.call3()[0]);
		((myclass) testRpc.call1()).getA(); // exception
		testRpc.call2(); // exception
	}
}
---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to