I am passing start and end dates in the following format:
Tried various formats like
But I get webservice throws an error to the effect:
Error in decoding SOAP Message
Caused by: java.lang.IllegalArgumentException: 02/03
at org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl$Parser.parseBigInteger(Unknown Source)
Not sure whats going on.
Any suggestions will be appreciated!
You should know the actual format that target webservice is expecting…check in the wsdl/schema or contact provider…we can’t just predict…
Are you pulling the date information from database ? it looks like SOAP decoder isn’t expecting BigInteger datatype for date field.
No. I am getting the current date string within webmethods in the format MM/dd/yyyy hh:mm:ss and then passing it to the webservice call. The field is defined as dateTime in the webservice.
The provider is telling me it needs to be type dateTime.
I am not sure what is incorrect here.
Try using “getCurrentDate” instead of “getCurrentDateString” since “getCurrentDateString” provides date in string format and “getCurrentDate” provides date in Date object.
The thing is I have created a connector for the webservice. The associsted doc types that were created have strings as datatype for the date fields.
I am trying to poulate these fields and test.
since they are defined as strings, I have to call the getCurrentDateString
Check the WSDL if the date field is defined as dateTime datatype if not then client need to update the wsdl. If it is defined in dateTime format then check the documentType which got created when you created the connector and see in the properties if its contentType is dateTime or string.
Verified all of that you have mentioned. It all looks ok
The content type is dateTime for both of the date fields
XML Schema dateTime values look like the following:
Could you check your SOAP request and make sure that the Request have date fields as dateTime type i.e.
And to get the expected format use the getCurrentDateString(yyyy-MM-dd) and getCurrentDateString(HH:mm:ss) and with few concat service logic to add “T” in between to get the final output 2008-06-02T16:35:00
That “final format” does not use an explicit offset and implies that the date time value is in UTC (aka Greenwich Mean Time or GMT). You need to specify UTC or GMT as the timezone parameter to ensure that this is the case. You can alternately write code to calculate the offset.
IMHO, a better practice than leaving off the timezone offset is to specify a timezone value of “UTC” and then append a literal “Z” on the end of the date pattern.
This is the soap data that is going as the request:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:SOAP-ENC=“http://schemas.xmlsoap.org/soap/encoding/” xmlns:xsd=“http://www.w3.org/1999/XMLSchema” xmlns:xsi=“http://www.w3.org/1999/XMLSchema-instance” SOAP-ENV:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”>
Thanks for all the replies. The format I was passing in was incorrect.