[
http://issues.apache.org/jira/browse/AXIS-1988?page=comments#action_12428071 ]
Serguey Mironov commented on AXIS-1988:
---------------------------------------
I have the similar problem. My version of Axis is 1.3.
I declare service in server-config.wsdd:
<service name="DateService" provider="java:RPC" style="wrapped" use="literal">
<parameter name="allowedMethods" value="*"/>
<parameter name="className" value="wso.service.DateService"/>
<parameter name="wsdlTargetNamespace"
value="http:/www.some.com/namespace"/>
<beanMapping languageSpecificType="java:wso.DateBean"
qname="ns1:db"
xmlns:ns1="http:/www.some.com/namespace/Search"/>
<typeMapping qname="xsd:date"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
languageSpecificType="java:java.util.Date"
serializer="org.apache.axis.encoding.ser.DateSerializerFactory"
deserializer="org.apache.axis.encoding.ser.DateDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
<typeMapping qname="xsd:dateTime"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
languageSpecificType="java:java.util.GregorianCalendar"
serializer="org.apache.axis.encoding.ser.CalendarSerializerFactory"
deserializer="org.apache.axis.encoding.ser.CalendarDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
<operation name="retrieveBean" returnType="ns1:db"
xmlns:ns1="http:/www.some.com/namespace/Search"/>
</service>
Service class:
package wso.service;
import wso.DateBean;
import java.util.Date;
import java.util.GregorianCalendar;
public class DateService {
public DateBean retrieveBean() {
return new DateBean(new Date(), new GregorianCalendar());
}
public Date currentDate() {
return new Date();
}
public GregorianCalendar currentTime() {
return new GregorianCalendar();
}
}
Bean class:
package wso;
import java.util.Date;
import java.util.GregorianCalendar;
public class DateBean implements java.io.Serializable {
public Date getDd() {
return dd;
}
public void setDd(Date dd) {
this.dd = dd;
}
protected java.util.Date dd;
protected java.util.GregorianCalendar gc;
public String toString() {
return "DateBean{" +
"dd=" + dd +
"}";
}
public DateBean(Date dd) {
this.dd = dd;
}
public DateBean() {
}
public DateBean(Date dd, GregorianCalendar gc) {
this.dd = dd;
this.gc = gc;
}
public GregorianCalendar getGc() {
return gc;
}
public void setGc(GregorianCalendar gc) {
this.gc = gc;
}
}
Response always contains dateTime result. If I use rpc/encoded then all works
fine.
> Date/dateTime tag attributes do not get serialized correctly
> ------------------------------------------------------------
>
> Key: AXIS-1988
> URL: http://issues.apache.org/jira/browse/AXIS-1988
> Project: Apache Axis
> Issue Type: Bug
> Components: Serialization/Deserialization
> Affects Versions: 1.2
> Environment: Windows XP, Tomcat 5.0.29
> Reporter: Alessandro Santini
>
> Please have a look to the following WSDL snippet:
> <p:complexType name="Instalment">
> <p:simpleContent>
> <p:extension base="p:double">
> <p:attribute name="date" type="p:date" use="required" />
> <p:attribute default="1" name="multiplicity" type="p:positiveInteger" />
> </p:extension>
> </p:simpleContent>
> </p:complexType>
> with xmlns:p="http://www.w3.org/2001/XMLSchema"
> the "date" attribute gets serialized as "Wed May 11 19:35:11 CEST 2005" which
> is clearly incorrect. We have played with p:dateTime but the result is the
> same.
> Debugging Axis, we have noticed that neither DateSerializer nor
> CalendarSerializer have been invoked.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]