This exception is triggered when an XDS Toolkit conformance server test logs a particular patient discovery SOAP response sent by vendor client. XDS Toolkit is the client and the system under test is the server. Toolkit sends a request and an exception is thrown when it logs a particular type of response. Test fails.
************* Skipped adding Namespace for 'wsu:Id' under the element 'wsu:Timestamp' *******
Attempt to access a parser that has thrown a parse exception before; rethrowing the original exception.
Attempt to access a parser that has thrown a parse exception before; rethrowing the original exception.
Cannot log soap request
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "wsu" (for attribute "Id")
at [row,col {unknown-source}]: [9,103]
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:293)
at org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling(OMElementImpl.java:337)
at org.apache.axiom.om.impl.traverse.OMChildElementIterator.next(OMChildElementIterator.java:104)
at gov.nist.toolkit.utilities.xml.OMFormatter.element(OMFormatter.java:175)
at gov.nist.toolkit.utilities.xml.OMFormatter.toString(OMFormatter.java:63)
at gov.nist.toolkit.testengine.engine.OmLogger.add_name_value(OmLogger.java:144)
at gov.nist.toolkit.testengine.transactions.BasicTransaction.logSoapRequest(BasicTransaction.java:1451)
at gov.nist.toolkit.testengine.transactions.BasicTransaction.soapCall(BasicTransaction.java:1421)
at gov.nist.toolkit.testengine.transactions.XcpdTransaction.run(XcpdTransaction.java:27)
at gov.nist.toolkit.testengine.transactions.BasicTransaction.doRun(BasicTransaction.java:226)
at gov.nist.toolkit.testengine.engine.StepContext.run(StepContext.java:466)
at gov.nist.toolkit.testengine.engine.PlanContext.run(PlanContext.java:251)
at gov.nist.toolkit.testengine.engine.XdsTest.runAndReturnLogs(XdsTest.java:223)
at gov.nist.toolkit.testengine.engine.Xdstest2.run(Xdstest2.java:266)
at gov.nist.toolkit.session.server.serviceManager.UtilityRunner.getResult(UtilityRunner.java:168)
at gov.nist.toolkit.session.server.serviceManager.UtilityRunner.run(UtilityRunner.java:133)
at gov.nist.toolkit.session.server.serviceManager.TestRunner.run(TestRunner.java:89)
at gov.nist.toolkit.session.server.serviceManager.XdsTestServiceManager.runTest(XdsTestServiceManager.java:155)
at gov.nist.toolkit.xdstools2.server.ToolkitServiceImpl.runTest(ToolkitServiceImpl.java:911)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:587)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:333)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:303)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:373)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.filters.RequestDumperFilter.doFilter(RequestDumperFilter.java:203)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
at org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java:827)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1580)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1537)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "wsu" (for attribute "Id")
at [row,col {unknown-source}]: [9,103]
at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:630)
at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:473)
at com.ctc.wstx.sr.NsAttributeCollector.resolveNamespaces(NsAttributeCollector.java:180)
at com.ctc.wstx.sr.NsInputElementStack.resolveAndValidateElement(NsInputElementStack.java:375)
at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2947)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2848)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:672)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
at org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling(OMElementImpl.java:337)
at org.apache.axiom.om.impl.traverse.OMChildElementIterator.next(OMChildElementIterator.java:104)
at gov.nist.toolkit.utilities.xml.OMFormatter.element(OMFormatter.java:175)
at gov.nist.toolkit.utilities.xml.OMFormatter.toString(OMFormatter.java:63)
at gov.nist.toolkit.utilities.xml.Util.deep_copy(Util.java:136)
at gov.nist.toolkit.testengine.engine.OmLogger.add_name_value(OmLogger.java:136)
... 48 more
************* Skipped adding Namespace for 'wsu:Id' under the element 'wsu:Timestamp' *******
Reporting run parameters: {}
Generating Report Report correlatedPid_Part1 section=Result value=Unavailable
Section correlatedPid_Part1 is not defined
Toolkit Code
BasicTransaction.java: Line?
public void logSoapRequest(Soap soap) {
testLog.add_name_value(instruction_output, "OutHeader", soap.getOutHeader());
testLog.add_name_value(instruction_output, "OutAction", getRequestAction());
testLog.add_name_value(instruction_output, "ExpectedInAction", getResponseAction());
testLog.add_name_value(instruction_output, "InHeader", soap.getInHeader()); /* <-- PROBLEM HERE */
testLog.add_name_value(instruction_output, "Result", soap.getResult());
Example toolkit log.xml has no "top-level" namepsace context here. Attributes do not reuse the capital "S" namespace prefix even though the lowercase "s" namespace value is identical.
I found the following problems in the Toolkit OMFormatter Java class:
1) The code always assumed that the Timestamp element used a "wsu" string literal namespace prefix.
2) The code did not account for the Timestamp element to be represented using a default namespace.
Another hidden Toolkit issue:
When an XML fragment was serialized in Toolkit,
For example in gov.nist.toolkit.soap.axis2.Soap#loadInHeaderinHeader = Util.deep_copy(in.getEnvelope().getHeader());
The namespaces will be as shown in the localized namespace prefix example above (it does not have a top-level namespace prefix but uses a locally assigned element namespace prefix). The view of the actual internal XML will be different than the actual XML request/response which was sent by vendor system.
Fix
If the element namespace prefix is same as attribute prefix, do not add the namespace (namespace was already added by the element method before calling the attribute method). Otherwise add namespace at the attribute method.
After the fix, here is an example of the SOAP header containing the correct namespace:
**Element namespace** | **Attribute namespace**| **New attribute() method fix action**
Default namespace | Prefix | Adds attribute namespace with the Prefix (fixes undeclared prefix exception).
Prefix1 | Prefix2 | Adds attribute namespace with the Prefix2 (fixes undeclared prefix exception).
Prefix | Same prefix or no prefix| Does not add an attribute namespace since the element() method already adds it (fixes duplicate namespace prefix exception).
This exception is triggered when an XDS Toolkit conformance server test logs a particular patient discovery SOAP response sent by vendor client. XDS Toolkit is the client and the system under test is the server. Toolkit sends a request and an exception is thrown when it logs a particular type of response. Test fails.
Toolkit Code
BasicTransaction.java
: Line?Example toolkit
log.xml
has no "top-level" namepsace context here. Attributes do not reuse the capital "S" namespace prefix even though the lowercase "s" namespace value is identical.I found the following problems in the Toolkit OMFormatter Java class: 1) The code always assumed that the Timestamp element used a "wsu" string literal namespace prefix. 2) The code did not account for the Timestamp element to be represented using a default namespace.
Another hidden Toolkit issue: When an XML fragment was serialized in Toolkit, For example in
gov.nist.toolkit.soap.axis2.Soap#loadInHeader
inHeader = Util.deep_copy(in.getEnvelope().getHeader());
The namespaces will be as shown in the localized namespace prefix example above (it does not have a top-level namespace prefix but uses a locally assigned element namespace prefix). The view of the actual internal XML will be different than the actual XML request/response which was sent by vendor system.
Fix If the element namespace prefix is same as attribute prefix, do not add the namespace (namespace was already added by the element method before calling the attribute method). Otherwise add namespace at the attribute method.
After the fix, here is an example of the SOAP header containing the correct namespace:
OMFormatter Java class Scenarios