[ 
http://jira.codehaus.org/browse/XFIRE-517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_88670
 ] 

zidoff commented on XFIRE-517:
------------------------------

i'm trying to return a multiple rows in my XFire Web service.

You have to describe the Vector (Vector<Object>) so you will not get the 
exception

but the problem is when i'm using a Vector of Array of Object 
(Vector<Object[]>) i'm getting an exception 

Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not 
invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: 
Unable to write '[Ljava.lang.Object;@fab5b1' [[Ljava.lang.Object;]. Type is 
unknown.
org.codehaus.xfire.fault.XFireFault: Unable to write 
'[Ljava.lang.Object;@fab5b1' [[Ljava.lang.Object;]. Type is unknown.

regards

> Return types on standalone server
> ---------------------------------
>
>                 Key: XFIRE-517
>                 URL: http://jira.codehaus.org/browse/XFIRE-517
>             Project: XFire
>          Issue Type: Bug
>          Components: Aegis Module, Core
>    Affects Versions: 1.1.2
>         Environment: JRE 1.5.0_06, XFire 1.1.2
>            Reporter: Edgardo Avilés López
>         Assigned To: Dan Diephouse
>            Priority: Critical
>
> Is there any restriction on which types are alowed for return types? I am 
> only able to use Hashtable (also normal types) as return type. By example 
> using Vector as return type the next error is printed:
> Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Cannot 
> create mapping for java.util.Vector, unspecified component type for return 
> type of method obtAzar in interface DemoServ2
>       at 
> org.codehaus.xfire.aegis.type.DefaultTypeCreator.createCollectionType(DefaultTypeCreator.java:43)
>       at 
> org.codehaus.xfire.aegis.type.java5.Java5TypeCreator.createCollectionType(Java5TypeCreator.java:159)
>       at 
> org.codehaus.xfire.aegis.type.XMLTypeCreator.createCollectionType(XMLTypeCreator.java:181)
>       at 
> org.codehaus.xfire.aegis.type.AbstractTypeCreator.createTypeForClass(AbstractTypeCreator.java:90)
>       at 
> org.codehaus.xfire.aegis.type.AbstractTypeCreator.createType(AbstractTypeCreator.java:347)
>       at 
> org.codehaus.xfire.aegis.AegisBindingProvider.getSuggestedName(AegisBindingProvider.java:125)
>       at 
> org.codehaus.xfire.service.binding.DefaultServiceConfiguration.getOutParameterName(DefaultServiceConfiguration.java:174)
>       at 
> org.codehaus.xfire.service.binding.ObjectServiceFactory.getOutParameterName(ObjectServiceFactory.java:958)
>       at 
> org.codehaus.xfire.service.binding.ObjectServiceFactory.addOperation(ObjectServiceFactory.java:719)
>       at 
> org.codehaus.xfire.service.binding.ObjectServiceFactory.initializeOperations(ObjectServiceFactory.java:645)
>       at 
> org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:350)
>       at DemoServ2Main.start(DemoServ2Main.java:18)
>       at DemoServ2Main.main(DemoServ2Main.java:35)
> The source code used is:
> DemoServ2.java:
> import java.util.Vector;
> public interface DemoServ2 {
>       
>       Vector obtAzar();
> }
> DemoServ2Impl.java:
> import java.text.*;
> import java.util.*;
> public class DemoServ2Impl implements DemoServ2 {
>       public Vector obtAzar() {
>               NumberFormat nf = new DecimalFormat("0.00");
>               Vector v = new Vector();
>               for (int i = 0; i < 5; i++)
>                       v.add(nf.format(Math.random()));
>               return v;
>       }
> }
> DemoServ2Main.java:
> import org.codehaus.xfire.XFire;
> import org.codehaus.xfire.XFireFactory;
> import org.codehaus.xfire.server.http.XFireHttpServer;
> import org.codehaus.xfire.service.Service;
> import org.codehaus.xfire.service.binding.ObjectServiceFactory;
> import org.codehaus.xfire.service.invoker.BeanInvoker;
> public class DemoServ2Main {
>       
>       static XFireHttpServer server;
>       
>       public static void start() throws Exception {
>               XFire xfire = XFireFactory.newInstance().getXFire();
>               
>               // Create an XFire Service
>               ObjectServiceFactory serviceFactory = new 
> ObjectServiceFactory(xfire.getTransportManager());
>               Service service = serviceFactory.create(DemoServ2.class, 
> "Test", "test", null);
>               service.setInvoker(new BeanInvoker(new DemoServ2Impl()));
>               
>               // Register the service in the ServiceRegistry
>               xfire.getServiceRegistry().register(service);
>               
>               // Start the HTTP server
>               server = new XFireHttpServer();
>               server.setPort(8080);
>               server.start();
>       }
>       
>       public void stop() throws Exception {
>               server.stop();
>       }
>       
>       public static void main(String[] args) throws Exception {
>               start();
>       }
> }
> Your help on this issue is greatly appreciated.
> Edgardo.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to