You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by bohldan bohldan <gl...@hotmail.com> on 2005/03/09 10:50:10 UTC

Send a Vector with axis

Hi i want to send a Vector with User Objects in it.. my client look like
this (at the moment i receive a Vector with right number of objects in it
but all the values in each object are null)
---------------
            try{
		Service service = new Service();
			Call call = (Call) service.createCall();
			QName qn = new QName( "urn:GlazeService.Service", "User" );
			QName qnVector = new QName("urn:GlazeService.Service", "VectorOfUser");
			call.setOperationName("ldap_GetAllUsernames");
			call.setTargetEndpointAddress( new java.net.URL(endpointURL) );
			call.registerTypeMapping( User.class,
					qn,
					org.apache.axis.encoding.ser.BeanSerializerFactory.class,
					org.apache.axis.encoding.ser.BeanDeserializerFactory.class );
			call.registerTypeMapping( java.util.Vector.class,
					qnVector,
					org.apache.axis.encoding.ser.ArraySerializerFactory.class,
					org.apache.axis.encoding.ser.ArrayDeserializerFactory.class );
			call.setUsername("Larry Fine");
			call.setPassword("larrysecret");
			call.setReturnType(qnVector);
		    Vector tomte = (Vector)call.invoke(new Object [] {});
		    System.out.println("Size: " + tomte.size());
		    for(int i = 0; i < tomte.size(); i++){
		    	System.out.println(((User)(tomte.get(i))).GetGecos());
		    }
		}catch(Exception e){
			System.out.println("Something is really fucked up: " + e.toString());
		}

---------------
and this is how the deploy.wsdd file looks like
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
			xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

	<service name="GlazeService" provider="java:RPC">
	<parameter name="className" value="GlazeService.Service"/>
	<parameter name="allowedMethods" value="*"/>
	<beanMapping qname="myNS:User" xmlns:myNS="urn:GlazeService.Service"
languageSpecificType="java:GlazeService.User"/>
	</service>
</deployment>
----------------------

_________________________________________________________________
Lättare att hitta drömresan med MSN Resor http://www.msn.se/resor/