You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ji...@apache.org on 2004/05/30 04:01:00 UTC
[jira] Created: (AXIS-1374) wsdl2java does not deal with java.sql.date properly
Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/AXIS-1374
Here is an overview of the issue:
---------------------------------------------------------------------
Key: AXIS-1374
Summary: wsdl2java does not deal with java.sql.date properly
Type: Bug
Status: Unassigned
Priority: Major
Project: Axis
Components:
WSDL processing
Versions:
1.1
Assignee:
Reporter: Erich Pletsch
Created: Sat, 29 May 2004 6:59 PM
Updated: Sat, 29 May 2004 6:59 PM
Environment: all
Description:
When you attempt to generate a WSDL file from a java class that utilizes java.sql.Date using java2wsdl the generated WSDL file will write the method signature as type of dateTime (java.util.Date) which will cause you to receive an error later when you attempt to deploy your object. The following is the error:
OperationDesc for xxx was not sychronized to a method of yyy.yyy.yyy where xxx is the method name in class yyy.yyy.yyy
/**********************************************************/
*Code example:
*/
//Here is a simple example class importing type java.sql.Date
package com.yourcompany.edi;
import java.sql.Date;
public class XMLRPC implements com.yourcompany.XMLRPC{
public XMLRPC() {
this.ds = new Datastore();
}
//Add User
public boolean addUser(String sUser, String sPass, Date dDate) {
return true;
}
}
/**********************************************************/
<!--Here is the specification in the WSDL file (excerpt only) that will be generated by java2wsdl-->
<wsdl:message name="getAccountTransactionsSinceRequest">
<wsdl:part name="sUser" type="xsd:string"/>
<wsdl:part name="sPass" type="xsd:string"/>
<wsdl:part name="dDate" type="xsd:dateTime"/>
</wsdl:message>
/**********************************************************/
The above example will result in the following error at deploytime:
OperationDesc for addUser was not synchronized to a method of
com.yourcompany.edi.XMLRPC
The reason for the error is that the wsdl specification dateTime is implemented as java.util.Date and your import in the actual class is importing java.sql.Date (without specifying it implicitly in the method signature)
To work around this problem in your java class modify the code as follows:
/**********************************************************/
*Code example:
*/
//Here is a simple example class importing type java.sql.Date
package com.yourcompany.edi;
import java.util.Date;
public class XMLRPC implements com.yourcompany.XMLRPC{
public XMLRPC() {
this.ds = new Datastore();
}
//Add User
public boolean addUser(String sUser, String sPass, Date dDate) {
//Then if for some reason you absolutely must have
//java.sql.date, cast it in here.
return true;
}
}
/**********************************************************/
However, a long term fix for java2wsdl is advisable as anyone who attempts to use java.sql.Date will run into problems here.
---------------------------------------------------------------------
JIRA INFORMATION:
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
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
Re: [jira] Created: (AXIS-1374) wsdl2java does not deal with java.sql.date properly
Posted by Santosh Joshi <sa...@yahoo.co.uk>.
People,
How do I assign myself this problem? I had to patch
our deployment of AXIS for this DateTime problem, and
I suppose I may some quick solution already.
Please suggest/advise.
Regards,
Santosh
--- jira@apache.org wrote: > Message:
>
> A new issue has been created in JIRA.
>
>
---------------------------------------------------------------------
> View the issue:
> http://issues.apache.org/jira/browse/AXIS-1374
>
> Here is an overview of the issue:
>
---------------------------------------------------------------------
> Key: AXIS-1374
> Summary: wsdl2java does not deal with
> java.sql.date properly
> Type: Bug
>
> Status: Unassigned
> Priority: Major
>
> Project: Axis
> Components:
> WSDL processing
> Versions:
> 1.1
>
> Assignee:
> Reporter: Erich Pletsch
>
> Created: Sat, 29 May 2004 6:59 PM
> Updated: Sat, 29 May 2004 6:59 PM
> Environment: all
>
> Description:
> When you attempt to generate a WSDL file from a java
> class that utilizes java.sql.Date using java2wsdl
> the generated WSDL file will write the method
> signature as type of dateTime (java.util.Date) which
> will cause you to receive an error later when you
> attempt to deploy your object. The following is the
> error:
>
> OperationDesc for xxx was not sychronized to a
> method of yyy.yyy.yyy where xxx is the method name
> in class yyy.yyy.yyy
>
>
/**********************************************************/
> *Code example:
> */
>
> //Here is a simple example class importing type
> java.sql.Date
>
> package com.yourcompany.edi;
>
> import java.sql.Date;
>
> public class XMLRPC implements
> com.yourcompany.XMLRPC{
>
> public XMLRPC() {
> this.ds = new Datastore();
> }
>
> //Add User
> public boolean addUser(String sUser, String sPass,
> Date dDate) {
> return true;
> }
> }
>
>
/**********************************************************/
> <!--Here is the specification in the WSDL file
> (excerpt only) that will be generated by
> java2wsdl-->
> <wsdl:message
> name="getAccountTransactionsSinceRequest">
> <wsdl:part name="sUser" type="xsd:string"/>
> <wsdl:part name="sPass" type="xsd:string"/>
>
> <wsdl:part name="dDate" type="xsd:dateTime"/>
> </wsdl:message>
>
>
/**********************************************************/
>
> The above example will result in the following error
> at deploytime:
>
> OperationDesc for addUser was not synchronized to a
> method of
> com.yourcompany.edi.XMLRPC
>
> The reason for the error is that the wsdl
> specification dateTime is implemented as
> java.util.Date and your import in the actual class
> is importing java.sql.Date (without specifying it
> implicitly in the method signature)
>
> To work around this problem in your java class
> modify the code as follows:
>
>
/**********************************************************/
> *Code example:
> */
>
> //Here is a simple example class importing type
> java.sql.Date
>
> package com.yourcompany.edi;
>
> import java.util.Date;
>
> public class XMLRPC implements
> com.yourcompany.XMLRPC{
>
> public XMLRPC() {
> this.ds = new Datastore();
> }
>
> //Add User
> public boolean addUser(String sUser, String sPass,
> Date dDate) {
> //Then if for some reason you absolutely must have
> //java.sql.date, cast it in here.
> return true;
> }
> }
>
>
/**********************************************************/
>
> However, a long term fix for java2wsdl is advisable
> as anyone who attempts to use java.sql.Date will run
> into problems here.
>
>
>
>
>
---------------------------------------------------------------------
> JIRA INFORMATION:
> 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
>
> If you want more information on JIRA, or have a bug
> to report see:
> http://www.atlassian.com/software/jira
>
____________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html