AnsweredAssumed Answered

Problems with timestamp in JAX-WS client

Question asked by gressho on Sep 4, 2008

I'm trying to develop a webservice client with JAX-WS and implemented a Handler to add the WS-Security header. This works perfectly when I change the
WS-Security configuration to not need a timestamp. If I don't do this (and the timestamp is generated and valid and added as I can see in my client and server
protocols) WSS4J produces an StringIndexOutOfBoundsException:

10:12:33,566 User:admin DEBUG [] Received SOAP request:
10:12:33,571 User:admin DEBUG [] <S:Envelope xmlns:S="">
  <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:SOAP-ENV="" xmlns:wsse="">
   <wsu:Timestamp xmlns:wsu="">
2008-08-29T10:12:33.164+02:00    </wsu:Created>
2008-08-29T10:12:33.164+02:00    </wsu:Expired>
admin    </wsse:Username>
    <wsse:Password Type="">
TICKET_14448e7887355aca67e7afa0d1ca062a42f37ac3    </wsse:Password>
  <queryUsers xmlns="" xmlns:ns2="">

10:12:33,571 User:admin DEBUG [] enter processSecurityHeader()
10:12:33,581 User:admin DEBUG [] Processing WS-Security header for '' actor.
10:12:33,582 User:admin DEBUG [] Found Timestamp list element
10:12:33,595 User:admin DEBUG [axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(addBody00)
10:12:33,596 User:admin DEBUG [axis.message.SOAPBody] Adding body element to message…
10:12:33,596 User:admin DEBUG [apache.axis.SOAPPart] Enter: SOAPPart ctor(FORM_SOAPENVELOPE)
10:12:33,596 User:admin DEBUG [axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(setMsgForm)
10:12:33,596 User:admin DEBUG [apache.axis.SOAPPart] Setting current message form to: FORM_SOAPENVELOPE (currentMessage is now org.apache.axis.message.SOAPEnvelope)
10:12:33,596 User:admin DEBUG [apache.axis.SOAPPart] Exit: SOAPPart ctor()
10:12:33,600 User:admin DEBUG [axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(axisFault00)
10:12:33,600 User:admin DEBUG [apache.axis.EXCEPTIONS] AxisFault:
faultCode: {}Server.userException
faultString: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
   {}stackTrace:java.lang.StringIndexOutOfBoundsException: String index out of range: 0
   at java.lang.String.charAt(
   at java.text.DateFormat.parse(

I imagine there is a formatting problem with my JAX-WS engine?
Has somebody allready tried a JAX-WS client and got rid of this problem?

Thanks and best regards