axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomek Minkowski <tmink...@cezar.ce3.com.pl>
Subject Re: Adding objects as parameters
Date Wed, 02 Feb 2005 16:38:40 GMT



 	Hello,

 	Create a bean with with fields as needed by the service and then:

 	call.registerTypeMapping(YourBean.class, ...);
 	As serializer /deserializer use
 	org.apache.axis.encoding.ser.BeanDeserializerFactory and
 	org.apache.axis.encoding.ser.BeanSerializerFactory.

 	Then you populate the bean and push it on the params[] array.

 	Hope this helps,
 	TM


On Wed, 2 Feb 2005, Suzy Fynes wrote:

>
>
> Hey,
>
> I'm calling a service that has objects as its parameters, how do I use
> it in the client? Do I enter each attribute as a string or do I create
> an object of the required type?
> (this is all in axis with a java client)
>
> e.g.
>
> if it was just wsdl with string parameters I do the following
> .
> call.addParameter("customerAccountName" , XMLType.XSD_STRING,
> ParameterMode.IN);
>            call.addParameter("customerAccountNumber" ,
> XMLType.XSD_STRING, ParameterMode.IN);
>            call.addParameter("customerEmailAddress" ,
> XMLType.XSD_STRING, ParameterMode.IN);
>            call.addParameter("customerFaxNumber" , XMLType.XSD_STRING,
> ParameterMode.IN);
>            call.addParameter("customerHomeTelephoneNumber" ,
> XMLType.XSD_STRING, ParameterMode.IN);
>            call.addParameter("customerMobileNumber" ,
> XMLType.XSD_STRING, ParameterMode.IN);
>
>    . Object[] params = new Object[] {"Joan
> McDonald","00217096","mc@yahoo.com","","0744552224","074455613"}
>
> .. String valid = (String) call.invoke(params);
>
> now if the service requires a customer object, which has the above
> parameters as attributes do I create a customer object and
> call.invoke(.)
>
> thanks
>

Mime
View raw message