Skip to main content

Metro security header date format to be: YYYY-MM-DDThh:mm:ss.mmmZ

4 replies [Last post]
wuntee
Offline
Joined: 2009-07-23

I am getting the following error when trying to use Metro to send an authenticated SOAP message to an endpoint:

<br />
javax.xml.ws.soap.SOAPFaultException: Error. Handler Exception. com.sun.xml.wss.XWSSecurityException: com.sun.xml.wss.impl.WssSoapFaultException: javax.security.auth.callback.UnsupportedCallbackException: Date format is invalid, please use YYYY-MM-DDThh:mm:ss.mmmZ<br />
	at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:189)<br />
	at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:130)<br />
	at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)<br />
	at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)<br />
	at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)<br />
	at $Proxy41.create(Unknown Source)<br />
	at com.cable.comcast.neto.sams.test.ServiceRequestServiceTest.test(Unknown Source)<br />
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br />
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />
	at java.lang.reflect.Method.invoke(Method.java:597)<br />
	at junit.framework.TestCase.runTest(TestCase.java:164)<br />
	at junit.framework.TestCase.runBare(TestCase.java:130)<br />
	at junit.framework.TestResult$1.protect(TestResult.java:106)<br />
	at junit.framework.TestResult.runProtected(TestResult.java:124)<br />
	at junit.framework.TestResult.run(TestResult.java:109)<br />
	at junit.framework.TestCase.run(TestCase.java:120)<br />
	at junit.framework.TestSuite.runTest(TestSuite.java:230)<br />
	at junit.framework.TestSuite.run(TestSuite.java:225)<br />
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)<br />
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)<br />
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)<br />
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)<br />
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)<br />
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)<br />

After dumping the XML via the 'dumpMessages="true"' flag in the security header .xml file, I can see that the message is in fact not in the correct format (missing the millisecond). Is there a way to change the message to conform to the expected format?

<br />
<?xml version="1.0" encoding="UTF-8"?></p>
<p>sams<br />
****<br />
****<br />
2009-08-13T14:57:49Z</p>
<p>

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
wuntee
Offline
Joined: 2009-07-23

I am using metro 1.5. Someone mentioned that I need to override the java RI classes with JAX-WS. I tried doing this, and still run into the same problem. Have put the JAX-WS libraries in the endorsed directory, as well as added them to the classpath of the project. Not sure if that would help at all.

kumarjayanti
Offline
Joined: 2003-12-10

That won't help.

Metro impl always sends : YYYY-MM-DDThh:mm:ssZ but it can recieve both

YYYY-MM-DDThh:mm:ss.mmmZ
and
YYYY-MM-DDThh:mm:ssZ

wuntee
Offline
Joined: 2009-07-23

So, I have finally figured out what the issue was; it was a dependency on using Metro1.1. I think the server was implemented in Metro1.1, and will only accept the date as:

YYYY-MM-DDThh:mm:ss.mmmZ

I tested with 2.0, 1.5, 1.4, and 1.3 and they all send the date without the milliseconds.

Very frustrating issue to troubleshoot.

kumarjayanti
Offline
Joined: 2003-12-10

No configurable way. Which version of metro you are using.