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 "Asensio, Rodrigo" <ro...@gilbarco.com> on 2008/08/20 16:13:57 UTC
OMElement with date paremeter
axis2
my code
OMFactory fac =
OMAbstractFactory.getOMFactory();
OMNamespace omNs =
fac.createOMNamespace("http://myns", "ns");
OMElement method =
fac.createOMElement("myaction", omNs);
OMElement date = fac.createOMElement("date",
omNs);
date.setText(new Date().toString());
method.addChild(date);
String url =
"http://localhost/axis2/services/myws";
ServiceClient client = new ServiceClient();
Options opts = new Options();
opts.setTo(new EndpointReference(url));
opts.setAction("myaction");
client.setOptions(opts);
OMElement res = client.sendReceive(method);
System.out.println(res);
I'm getting
org.apache.axis2.AxisFault: invalid date format (Wed Aug 20 09:03:31 ACT
2008) wiht out - s at correct place
for sure the OMelement needs a special date format. any clue what is it
thanks
Rodrigo
This message (including any attachments) contains confidential
and/or proprietary information intended only for the addressee.
Any unauthorized disclosure, copying, distribution or reliance on
the contents of this information is strictly prohibited and may
constitute a violation of law. If you are not the intended
recipient, please notify the sender immediately by responding to
this e-mail, and delete the message from your system. If you
have any questions about this e-mail please notify the sender
immediately.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
RE: OMElement with date paremeter FIXED
Posted by "Asensio, Rodrigo" <ro...@gilbarco.com>.
well... researching a little bit I found this and it worked. posting
here the solution
import
com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImp
l;
XMLGregorianCalendarImpl xmlCalendar = new XMLGregorianCalendarImpl(new
GregorianCalendar());
OMElement date = fac.createOMElement("date",omNs);
date.setText(xmlCalendar.toString());
method.addChild(date);
seems that there is a bug in here
http://www.archivum.info/axis-user@ws.apache.org/2007-02/msg00620.html
be smart
-----Original Message-----
From: Asensio, Rodrigo [mailto:rodrigo.asensio@gilbarco.com]
Sent: Wednesday, August 20, 2008 11:42 AM
To: axis-user@ws.apache.org
Subject: RE: OMElement with date paremeter
adding info.
the interface of the method is clearly
public OMElement myaction(Date date) throws Exception;
-----Original Message-----
From: Asensio, Rodrigo [mailto:rodrigo.asensio@gilbarco.com]
Sent: Wednesday, August 20, 2008 11:14 AM
To: axis-user@ws.apache.org
Subject: OMElement with date paremeter
axis2
my code
OMFactory fac =
OMAbstractFactory.getOMFactory();
OMNamespace omNs =
fac.createOMNamespace("http://myns", "ns");
OMElement method =
fac.createOMElement("myaction", omNs);
OMElement date = fac.createOMElement("date",
omNs);
date.setText(new Date().toString());
method.addChild(date);
String url =
"http://localhost/axis2/services/myws";
ServiceClient client = new ServiceClient();
Options opts = new Options();
opts.setTo(new EndpointReference(url));
opts.setAction("myaction");
client.setOptions(opts);
OMElement res = client.sendReceive(method);
System.out.println(res);
I'm getting
org.apache.axis2.AxisFault: invalid date format (Wed Aug 20 09:03:31 ACT
2008) wiht out - s at correct place
for sure the OMelement needs a special date format. any clue what is it
thanks
Rodrigo
This message (including any attachments) contains confidential
and/or proprietary information intended only for the addressee.
Any unauthorized disclosure, copying, distribution or reliance on
the contents of this information is strictly prohibited and may
constitute a violation of law. If you are not the intended
recipient, please notify the sender immediately by responding to
this e-mail, and delete the message from your system. If you
have any questions about this e-mail please notify the sender
immediately.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
This message (including any attachments) contains confidential
and/or proprietary information intended only for the addressee.
Any unauthorized disclosure, copying, distribution or reliance on
the contents of this information is strictly prohibited and may
constitute a violation of law. If you are not the intended
recipient, please notify the sender immediately by responding to
this e-mail, and delete the message from your system. If you
have any questions about this e-mail please notify the sender
immediately.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
This message (including any attachments) contains confidential
and/or proprietary information intended only for the addressee.
Any unauthorized disclosure, copying, distribution or reliance on
the contents of this information is strictly prohibited and may
constitute a violation of law. If you are not the intended
recipient, please notify the sender immediately by responding to
this e-mail, and delete the message from your system. If you
have any questions about this e-mail please notify the sender
immediately.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
RE: OMElement with date paremeter
Posted by "Asensio, Rodrigo" <ro...@gilbarco.com>.
adding info.
the interface of the method is clearly
public OMElement myaction(Date date) throws Exception;
-----Original Message-----
From: Asensio, Rodrigo [mailto:rodrigo.asensio@gilbarco.com]
Sent: Wednesday, August 20, 2008 11:14 AM
To: axis-user@ws.apache.org
Subject: OMElement with date paremeter
axis2
my code
OMFactory fac =
OMAbstractFactory.getOMFactory();
OMNamespace omNs =
fac.createOMNamespace("http://myns", "ns");
OMElement method =
fac.createOMElement("myaction", omNs);
OMElement date = fac.createOMElement("date",
omNs);
date.setText(new Date().toString());
method.addChild(date);
String url =
"http://localhost/axis2/services/myws";
ServiceClient client = new ServiceClient();
Options opts = new Options();
opts.setTo(new EndpointReference(url));
opts.setAction("myaction");
client.setOptions(opts);
OMElement res = client.sendReceive(method);
System.out.println(res);
I'm getting
org.apache.axis2.AxisFault: invalid date format (Wed Aug 20 09:03:31 ACT
2008) wiht out - s at correct place
for sure the OMelement needs a special date format. any clue what is it
thanks
Rodrigo
This message (including any attachments) contains confidential
and/or proprietary information intended only for the addressee.
Any unauthorized disclosure, copying, distribution or reliance on
the contents of this information is strictly prohibited and may
constitute a violation of law. If you are not the intended
recipient, please notify the sender immediately by responding to
this e-mail, and delete the message from your system. If you
have any questions about this e-mail please notify the sender
immediately.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
This message (including any attachments) contains confidential
and/or proprietary information intended only for the addressee.
Any unauthorized disclosure, copying, distribution or reliance on
the contents of this information is strictly prohibited and may
constitute a violation of law. If you are not the intended
recipient, please notify the sender immediately by responding to
this e-mail, and delete the message from your system. If you
have any questions about this e-mail please notify the sender
immediately.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org