aspose file tools*
The moose likes Web Services and the fly likes java.text.ParseException in Web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "java.text.ParseException in Web service" Watch "java.text.ParseException in Web service" New topic
Author

java.text.ParseException in Web service

Santosh Raveendran
Ranch Hand

Joined: Jun 29, 2008
Posts: 83
In my project i am pulling data from people soft application using people soft web services but when i am creating the response i am getting java.text.ParseException, please help



The full exception is



xisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.RuntimeException: java.text.ParseException: Unparseable date: "1981-01-01"
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.lang.RuntimeException: java.text.ParseException: Unparseable date: "1981-01-01"
at org.apache.axis.encoding.ser.SimpleDeserializer.onEndElement(SimpleDeserializer.java:176)
at org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:502)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2448)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at com.oracle.xmlns.Enterprise.Tools.services.CI_CI_PERSONAL_DATA_1.CI_CI_PERSONAL_DATA_BindingStub.CI_CI_PERSONAL_DATA_G(CI_CI_PERSONAL_DATA_BindingStub.java:2832)
at com.ustri.OrionWebService.ProcessMain.main(ProcessMain.java:37)

{http://xml.apache.org/axis/}hostname:C124USS

java.lang.RuntimeException: java.text.ParseException: Unparseable date: "1981-01-01"
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.client.Call.invoke(Call.java:2451)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at com.oracle.xmlns.Enterprise.Tools.services.CI_CI_PERSONAL_DATA_1.CI_CI_PERSONAL_DATA_BindingStub.CI_CI_PERSONAL_DATA_G(CI_CI_PERSONAL_DATA_BindingStub.java:2832)
at com.ustri.OrionWebService.ProcessMain.main(ProcessMain.java:37)
Caused by: java.lang.RuntimeException: java.text.ParseException: Unparseable date: "1981-01-01"
at org.apache.axis.encoding.ser.SimpleDeserializer.onEndElement(SimpleDeserializer.java:176)
at org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:502)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2448)
... 4 more


SCJP 1.4,SCWCD5, SCBCD5
Thanks, Santhosh
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
How is that date passed to the WS call (i.e., in what format)? If it's a string, have you tried other formats?


Ping & DNS - updated with new look and Ping home screen widget
Santosh Raveendran
Ranch Hand

Joined: Jun 29, 2008
Posts: 83
Ulf

i am not passing any dates i am pulling the data from the people soft application by passing a unique string id and when creating the response object i am getting this error, i checked in the data base and application every where date is in the correct format.

Thanks
santhosh
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Originally posted by santosh raveendran:
In my project i am pulling data from people soft application using people soft web services but when i am creating the response i am getting java.text.ParseException, please help


You are not being clear here. If you are using PeopleSoft web services to obtain this information you are the "client" and you should be creating a request - not a response.

java.text.ParseException: Unparseable date: "1981-01-01"


This suggests that the (PeopleSoft?) web service was unable to parse the date-string that you provided.

i checked in the data base and application every where date is in the correct format

The formats used in the application/database are not necessarily relevant. Apparently some logic is expecting a certain date format and the one that you are using isn't it.


"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
Santosh Raveendran
Ranch Hand

Joined: Jun 29, 2008
Posts: 83
Hi Peer

I am sending a request to the web service as a SOAP request and

the web service returns me a SOAP response which is received as a object in

my deployed code from which i need to extract my required information,

exception is getting thrown while creating the out put or response object

i am having a doubt wheather its the axis client thats causing the issue as

one of my coworkers successfully deployed the same wsdl in .NET without issues .

Thanks
santhosh
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Originally posted by santosh raveendran:
I am sending a request to the web service as a SOAP request and the web service returns me a SOAP response which is received as a object in my deployed code from which i need to extract my required information, exception is getting thrown while creating the out put or response object


Your original post shows a SOAPFault which clearly lists:


According to the SOAP standard

The Server class of errors indicate that the message could not be processed for reasons not directly attributable to the contents of the message itself but rather to the processing of the message. For example, processing could include communicating with an upstream processor, which didn't respond. The message may succeed at a later point in time. See also section 4.4 for a description of the SOAP Fault detail sub-element.


This would then mean that your request was ultimately responsible for the failure. The contents of "1981-01-01" in the request message was OK because the message treats it as a String. It's only later in the service logic (processing) that conversion of the String to a Date fails - hence the Server.userException code.

So technically your aren't receiving a SOAP response but a SOAP Fault which is thrown as an AxisFault.

Otherwise you are telling me that "1981-01-01" is nowhere in the SOAP request but is actually in your SOAP response and that the client stub is failing and throwing an AxisFault - setting the faultCode to "Server.userException" even though the problem is occurring locally, not on the server.

one of my coworkers successfully deployed the same wsdl in .NET without issues.[/QB]


Do you mean that your co-worker has successfully accessed the PeopleSoft web service with a .NET based client?

At this point I would capture the SOAP requests and responses from both clients with Apache TCPMon (Tutorial) or java.net tcpmon and compare the sets - that might give you a clue as to what is going wrong.

If after that you still need help, please refer to How to Get Help with SOAP web services.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java.text.ParseException in Web service
 
Similar Threads
Junit Test Case for axis WebService
org.xml.sax.SAXException: Unregistered type: class java.lang.Object
faultString: java.lang.IllegalArgumentException: argument type mismatch
faultCode: Server.userException
Can't deserialize xsd:date attributes using Axis WSDL2Java classes