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 "Rusda, Sabri" <Sa...@wincor-nixdorf.com> on 2006/09/06 06:27:53 UTC

[AXIS2] - Serialize/Deserialize java.util.Date

Hi there,

Can I serialize/deserialize java.util.Date in Axis2 ? or it's the
limitation of Axis2 ?
I always get error when I call the operation with parameter
java.util.Date. any help are wellcome.


Regards,
srusda

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [AXIS2] - Serialize/Deserialize java.util.Date

Posted by robert lazarski <ro...@gmail.com>.
What's the error? Can you show a stacktrace ?

Robert

On 9/11/06, Rusda, Sabri <Sa...@wincor-nixdorf.com> wrote:
> Hi Robert,
>
> Here is the code :
> ---- service ---
> package sample.axis;
>
> import java.util.Date;
> import java.util.Calendar;
>
> public class HelloWorld {
>     public void echoDate(Date date) throws Exception {
>         System.out.println("date : "+date);
>     }
>     public void echoCalendar(Calendar cal) throws Exception {
>         System.out.println("Calendar : "+cal);
>     }
> }
> ---- service.xml ---
> <service name="HelloService">
>     <description>
>         This service is to get the running HelloWorld
>     </description>
>     <parameter name="ServiceClass"
> locked="false">sample.axis.HelloWorld</parameter>
>     <operation name="echoDate">
>         <messageReceiver
> class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
>     </operation>
>     <operation name="echoCalendar">
>         <messageReceiver
> class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
>     </operation>
> </service>
> ---- client ---
>
> import java.text.SimpleDateFormat;
> import java.util.ArrayList;
> import java.util.Date;
> import java.util.TimeZone;
>
> import javax.xml.namespace.QName;
>
> import org.apache.axis2.AxisFault;
> import org.apache.axis2.Constants;
> import org.apache.axis2.addressing.EndpointReference;
> import org.apache.axis2.client.Options;
> import org.apache.axis2.context.ConfigurationContext;
> import org.apache.axis2.context.ConfigurationContextFactory;
> import org.apache.axis2.rpc.client.RPCServiceClient;
>
> public class ServiceClientVoid {
>
>         /**
>          * @param args
>          */
>         public static void main(String[] args) {
>                 echoDate();
>         }
>         private static void echoDate() {
>                 try {
>                         String opName = "echoDate";
>                         EndpointReference targetEPR = new
> EndpointReference("http://localhost:8080/axis2/services/HelloService");
>                         QName operationName = new
> QName("http://axis.sample/xsd", opName);
>
>                         Options options = new Options();
>                         options.setTo(targetEPR);
>
> options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>
>                         ConfigurationContext configContext =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(nul
> l, null);
>
>                         RPCServiceClient sender = new
> RPCServiceClient(configContext, null);
>                         sender.setOptions(options);
>                         ArrayList params = new ArrayList();
>                 Date date = Calendar.getInstance().getTime();
>                 params.add(date);
>                   sender.invokeBlocking(operationName,
> params.toArray());
>                 } catch (AxisFault e) {
>                         e.printStackTrace();
>                 }
>         }
> }
>
> Looking forward for your help..
>
> Regards,
> srusda
>
> -----Original Message-----
> From: robert lazarski [mailto:robertlazarski@gmail.com]
> Sent: Thursday, September 07, 2006 1:15 AM
> To: axis-user@ws.apache.org
> Subject: Re: [AXIS2] - Serialize/Deserialize java.util.Date
>
> Show us your code and a stacktrace, and maybe we can help.
> java,util.Date is part of our junit tests, which are part of the src
> distro:
>
> http://people.apache.org/dist/axis2/nightly/axis2-std-SNAPSHOT-src.zip
>
> modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java
>
> Take a look at testCalender() .
>
> HTH,
> Robert
>
> On 9/6/06, Rusda, Sabri <Sa...@wincor-nixdorf.com> wrote:
> > Hi there,
> >
> > Can I serialize/deserialize java.util.Date in Axis2 ? or it's the
> > limitation of Axis2 ?
> > I always get error when I call the operation with parameter
> > java.util.Date. any help are wellcome.
> >
> >
> > Regards,
> > srusda
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: [AXIS2] - Serialize/Deserialize java.util.Date

Posted by "Rusda, Sabri" <Sa...@wincor-nixdorf.com>.
Hi Robert,

Here is the code :
---- service ---
package sample.axis;

import java.util.Date;
import java.util.Calendar;

public class HelloWorld {
    public void echoDate(Date date) throws Exception {
	System.out.println("date : "+date);
    }
    public void echoCalendar(Calendar cal) throws Exception {
	System.out.println("Calendar : "+cal);
    }
}
---- service.xml ---
<service name="HelloService">
    <description>
        This service is to get the running HelloWorld
    </description>
    <parameter name="ServiceClass"
locked="false">sample.axis.HelloWorld</parameter>
    <operation name="echoDate">
       	<messageReceiver
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
    </operation>
    <operation name="echoCalendar">
       	<messageReceiver
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
    </operation>
</service>
---- client ---

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.TimeZone;

import javax.xml.namespace.QName;

import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.rpc.client.RPCServiceClient;

public class ServiceClientVoid {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		echoDate();
	}
	private static void echoDate() {
		try {
			String opName = "echoDate";
			EndpointReference targetEPR = new
EndpointReference("http://localhost:8080/axis2/services/HelloService");
			QName operationName = new
QName("http://axis.sample/xsd", opName);

			Options options = new Options();
			options.setTo(targetEPR);
	
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);

			ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(nul
l, null);

			RPCServiceClient sender = new
RPCServiceClient(configContext, null);
			sender.setOptions(options);
			ArrayList params = new ArrayList();
	        Date date = Calendar.getInstance().getTime();
	        params.add(date);
  		  sender.invokeBlocking(operationName,
params.toArray());
		} catch (AxisFault e) {
			e.printStackTrace();
		}
	}
}

Looking forward for your help.. 

Regards,
srusda

-----Original Message-----
From: robert lazarski [mailto:robertlazarski@gmail.com] 
Sent: Thursday, September 07, 2006 1:15 AM
To: axis-user@ws.apache.org
Subject: Re: [AXIS2] - Serialize/Deserialize java.util.Date

Show us your code and a stacktrace, and maybe we can help.
java,util.Date is part of our junit tests, which are part of the src
distro:

http://people.apache.org/dist/axis2/nightly/axis2-std-SNAPSHOT-src.zip

modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java

Take a look at testCalender() .

HTH,
Robert

On 9/6/06, Rusda, Sabri <Sa...@wincor-nixdorf.com> wrote:
> Hi there,
>
> Can I serialize/deserialize java.util.Date in Axis2 ? or it's the
> limitation of Axis2 ?
> I always get error when I call the operation with parameter
> java.util.Date. any help are wellcome.
>
>
> Regards,
> srusda
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [AXIS2] - Serialize/Deserialize java.util.Date

Posted by robert lazarski <ro...@gmail.com>.
Show us your code and a stacktrace, and maybe we can help.
java,util.Date is part of our junit tests, which are part of the src
distro:

http://people.apache.org/dist/axis2/nightly/axis2-std-SNAPSHOT-src.zip

modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java

Take a look at testCalender() .

HTH,
Robert

On 9/6/06, Rusda, Sabri <Sa...@wincor-nixdorf.com> wrote:
> Hi there,
>
> Can I serialize/deserialize java.util.Date in Axis2 ? or it's the
> limitation of Axis2 ?
> I always get error when I call the operation with parameter
> java.util.Date. any help are wellcome.
>
>
> Regards,
> srusda
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org