1. Axis
  2. AXIS-2624

SOAP header element attributes "mustUnderstand" and "actor" added twice


    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Labels:
    • Environment:
      OS: Windows XP Professional SP2
      Application Server: Apache Tomcat 5.5.17



      the described issue occurs in the following environment: web service A is called from a client. During processing, it calls in turn a web service B, running on the same engine. During the call, a handler is used on the client side, which adds a new SOAP header block. The resulting message:

      <?xml version="1.0" encoding="utf-8"?>
      <soapenv:Envelope xmlns:soapenv="" xmlns:xsd="" xmlns:xsi="">
      <wssb:wssbUUID mustUnderstand="0" actor="" mustUnderstand="0" actor="" xmlns:wssb="">0dd3c106-1028-4ef2-b71e-15f6076383b4</wssb:wssbUUID>
      <ns1:getAllAvailCardiologists soapenv:encodingStyle="" xmlns:ns1="HPIndex"/>

      As you can see, the attributes "mustUnderstand" and "actor" of the "wssb:wssbUUID" header element appear twice. Debugging has led me to the conclusion that these attribute duplicates are added during serialization at the client side. I have confirmed that immediately before serialization both attributes appear only once each.

      This is the code in the handler to add the header:

      Name uuidNodeName = currentMessage.getSOAPEnvelope().createName("wssbUUID", "wssb", NAMESPACE);
      uuidNode = currentMessage.getSOAPHeader().addHeaderElement(uuidNodeName);

      All web services run perfectly well if adding the header is omitted (i.e. the above lines are commented out). This issue occurs on Axis, release 1.4 as well as on the current SVN checkout. It also appears on the latest released Xalan and Xerces versions as well as on their latest SVN checkouts.

      The above issue leads to a SAXParseException on the server. The message text reads "Attribute "mustUnderstand" was already specified for element "wssb:wssbUUID"". The stack trace of this exception:

      Thread [http-8080-Processor21] (Suspended (exception SAXParseException))
      DeserializationContext(DefaultHandler).fatalError(SAXParseException) line: not available
      ErrorHandlerWrapper.fatalError(String, String, XMLParseException) line: not available
      XMLErrorReporter.reportError(XMLLocator, String, String, Object[], short) line: not available
      XMLErrorReporter.reportError(String, String, Object[], short) line: not available
      XMLNSDocumentScannerImpl.scanStartElement() line: not available
      XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: not available
      XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: not available
      XIncludeAwareParserConfiguration(XML11Configuration).parse(boolean) line: not available
      XIncludeAwareParserConfiguration(XML11Configuration).parse(XMLInputSource) line: not available
      SAXParserImpl$JAXPSAXParser(XMLParser).parse(XMLInputSource) line: not available
      SAXParserImpl$JAXPSAXParser(AbstractSAXParser).parse(InputSource) line: not available
      SAXParserImpl$JAXPSAXParser.parse(InputSource) line: not available
      SAXParserImpl(SAXParser).parse(InputSource, DefaultHandler) line: not available
      DeserializationContext.parse() line: 227
      SOAPPart.getAsSOAPEnvelope() line: 695
      Message.getSOAPEnvelope() line: 435
      MustUnderstandChecker.invoke(MessageContext) line: 62
      InvocationStrategy.visit(Handler, MessageContext) line: 32
      SOAPService(SimpleChain).doVisiting(MessageContext, HandlerIterationStrategy) line: 118
      SOAPService(SimpleChain).invoke(MessageContext) line: 83
      SOAPService.invoke(MessageContext) line: 454
      AxisServer.invokeService(MessageContext) line: 234
      AxisServer.invoke(MessageContext) line: 375
      AxisServlet.doPost(HttpServletRequest, HttpServletResponse) line: 689
      AxisServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 709
      AxisServlet(AxisServletBase).service(HttpServletRequest, HttpServletResponse) line: 327
      AxisServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 802
      ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 252
      ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 173
      StandardWrapperValve.invoke(Request, Response) line: 213
      StandardContextValve.invoke(Request, Response) line: 178
      StandardHostValve.invoke(Request, Response) line: 126
      ErrorReportValve.invoke(Request, Response) line: 105
      StandardEngineValve.invoke(Request, Response) line: 107
      CoyoteAdapter.service(Request, Response) line: 148
      Http11Processor.process(InputStream, OutputStream) line: 869
      Http11Protocol$JmxHttp11ConnectionHandler(Http11BaseProtocol$Http11ConnectionHandler).processConnection(TcpConnection, Object[]) line: 664
      PoolTcpEndpoint.processSocket(Socket, TcpConnection, Object[]) line: 527
      LeaderFollowerWorkerThread.runIt(Object[]) line: 80
      ThreadPool$ line: 684
      ThreadWithAttributes(Thread).run() line: 595

      This exception is also printed out to the console (stdout), however with a different stack trace. The console transcript is attached to this message.

      I also found a bug report with a similar issue. However, I do not know if the two are related:

      Best regards,
      Martin Dreier



          • Assignee:
            Martin Dreier
          • Votes:
            0 Vote for this issue
            2 Start watching this issue


            • Created: