Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Blocker Blocker
    • Resolution: Done
    • Affects Version/s: 3.4.0.4-fuse
    • Fix Version/s: 3.4.0.6-fuse
    • Component/s: servicemix-cxf-bc
    • Labels:
      None
    • Environment:
      tested with: 3.4.0.4 and 3.4.0-SNAPSHOT
    • Similar Issues:
      Show 9 results 

      Description

      The attached test case contains a modified version of the cxf-wsdl-first demo with an additional CXF BC and HTTP provider. The flow is a request comes into a CXF BC that sends it on to the HTTP provider, who in turn invokes the actual demo CXF BC, so the additional components are effectively a pass through. However, the HTTP provider strips off the namespace qualifier of the response:

       <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:typ="http://servicemix.apache.org/samples/wsdl-first/types">
         <soapenv:Header/>
         <soapenv:Body>
            <typ:GetPerson>
               <typ:personId xsi:type="OpportunityType">
                  <typ:somename>?</typ:somename>
                  <typ:test>?</typ:test>
               </typ:personId>
            </typ:GetPerson>
         </soapenv:Body>
      </soapenv:Envelope>
      
      

      becomes:

         <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><typ:GetPerson xmlns:typ="http://servicemix.apache.org/samples/wsdl-first/types">
               <typ:personId xsi:type="OpportunityType">
                  <typ:somename>?</typ:somename>
                  <typ:test>?</typ:test>
               </typ:personId>
            </typ:GetPerson></soap:Body>
         </soap:Envelope>
      
      

      To run the test just build the project, deploy it and use soapui or client.html to invoke on the service, the returned XML will look like the above.

      1. test-case.tar.gz
        8 kB
        Pedro Neveu
      2. testcase-2118.tar.gz
        10 kB
        Pedro Neveu
      3. testcase-esb-1109.tgz
        26 kB
        Chris Custine

        Issue Links

          Activity

          Hide
          Jeff Rutman
          added a comment -

          Raising this bug to a blocker as it is preventing the customer from starting their integration testing. They are under extremely tight timelines and the visibility of this issue is very high. They need this resolved asap. Ideally we could get them a snapshot so they could start their integration testing.

          Show
          Jeff Rutman
          added a comment - Raising this bug to a blocker as it is preventing the customer from starting their integration testing. They are under extremely tight timelines and the visibility of this issue is very high. They need this resolved asap. Ideally we could get them a snapshot so they could start their integration testing.
          Hide
          Chris Custine
          added a comment -

          I am able to reproduce the problem and I am getting closer to a fix. It looks like we are losing the namespaces when transferring the stream out of the http component. Primary concern is not breaking something else in the process of fixing this so I will give another update later this afternoon.

          Show
          Chris Custine
          added a comment - I am able to reproduce the problem and I am getting closer to a fix. It looks like we are losing the namespaces when transferring the stream out of the http component. Primary concern is not breaking something else in the process of fixing this so I will give another update later this afternoon.
          Hide
          Chris Custine
          added a comment -

          Newer test case with failing and passing client.html

          Show
          Chris Custine
          added a comment - Newer test case with failing and passing client.html
          Hide
          Dave Stanley
          added a comment - - edited

          Attaching snapshot w ssl fix from ESB-1091. Files have been updated. Should contain CXF version 2.2.x-fuse-SNAPSHOT.

          Show
          Dave Stanley
          added a comment - - edited Attaching snapshot w ssl fix from ESB-1091 . Files have been updated. Should contain CXF version 2.2.x-fuse-SNAPSHOT.
          Hide
          Hadrian Zbarcea
          added a comment -

          Incomplete.

          Show
          Hadrian Zbarcea
          added a comment - Incomplete.
          Hide
          Hadrian Zbarcea
          added a comment -

          With the two messages shown in the description, the xsi:type is preserved, as expected, but the xmlns:xsi=... is stripped. With xmlns:xsi present on the <soapenv:Envelope> it does not work, but if the xmlns:xsi mapping is added to one of the inner elements (like the one with the xsi:type attribute) everything works fine.

          Show
          Hadrian Zbarcea
          added a comment - With the two messages shown in the description, the xsi:type is preserved, as expected, but the xmlns:xsi=... is stripped. With xmlns:xsi present on the <soapenv:Envelope> it does not work, but if the xmlns:xsi mapping is added to one of the inner elements (like the one with the xsi:type attribute) everything works fine.
          Hide
          Guillaume Nodet
          added a comment -

          I have a junit test case that reproduce the issue so i'm trying to find a fix.

          Show
          Guillaume Nodet
          added a comment - I have a junit test case that reproduce the issue so i'm trying to find a fix.
          Hide
          Guillaume Nodet
          added a comment -

          Here is a patch that fixes the problem:

          Index: src/main/java/org/apache/servicemix/soap/util/stax/DOMStreamReader.java
          ===================================================================
          --- src/main/java/org/apache/servicemix/soap/util/stax/DOMStreamReader.java	(revision 941780)
          +++ src/main/java/org/apache/servicemix/soap/util/stax/DOMStreamReader.java	(working copy)
          @@ -%ld,%ld +%ld,%ld @@
                   this.frame = new ElementFrame(element, null);
                   frames.add(this.frame);
                   newFrame(frame);
          +        findParentNamespaces(frame);
                   this.document = element.getOwnerDocument();
               }
           
          @@ -%ld,%ld +%ld,%ld @@
                   }
               }
           
          +    protected void findParentNamespaces(ElementFrame frame) {
          +        for (Node element = ((Node) frame.element).getParentNode();
          +             element instanceof Element;
          +             element = element.getParentNode())
          +        {
          +            NamedNodeMap nodes = element.getAttributes();
          +            for (int i = 0; i < nodes.getLength(); i++) {
          +                Node node = nodes.item(i);
          +                String prefix = node.getPrefix();
          +                String localName = node.getLocalName();
          +                String value = node.getNodeValue();
          +                String name = node.getNodeName();
          +
          +                if (prefix == null)
          +                    prefix = "";
          +
          +                if (name != null && name.equals("xmlns")) {
          +                    frame.uris.add(value);
          +                    frame.prefixes.add("");
          +                } else if (prefix.length() > 0 && prefix.equals("xmlns")) {
          +                    frame.uris.add(value);
          +                    frame.prefixes.add(localName);
          +                } else if (name.startsWith("xmlns:")) {
          +                    prefix = name.substring(6);
          +                    frame.uris.add(value);
          +                    frame.prefixes.add(prefix);
          +                }
          +            }
          +        }
          +    }
          +
               protected void endElement() {
               }
           
          
          Show
          Guillaume Nodet
          added a comment - Here is a patch that fixes the problem: Index: src/main/java/org/apache/servicemix/soap/util/stax/DOMStreamReader.java =================================================================== --- src/main/java/org/apache/servicemix/soap/util/stax/DOMStreamReader.java (revision 941780) +++ src/main/java/org/apache/servicemix/soap/util/stax/DOMStreamReader.java (working copy) @@ -%ld,%ld +%ld,%ld @@ this .frame = new ElementFrame(element, null ); frames.add( this .frame); newFrame(frame); + findParentNamespaces(frame); this .document = element.getOwnerDocument(); } @@ -%ld,%ld +%ld,%ld @@ } } + protected void findParentNamespaces(ElementFrame frame) { + for (Node element = ((Node) frame.element).getParentNode(); + element instanceof Element; + element = element.getParentNode()) + { + NamedNodeMap nodes = element.getAttributes(); + for ( int i = 0; i < nodes.getLength(); i++) { + Node node = nodes.item(i); + String prefix = node.getPrefix(); + String localName = node.getLocalName(); + String value = node.getNodeValue(); + String name = node.getNodeName(); + + if (prefix == null ) + prefix = ""; + + if (name != null && name.equals( "xmlns" )) { + frame.uris.add(value); + frame.prefixes.add(""); + } else if (prefix.length() > 0 && prefix.equals( "xmlns" )) { + frame.uris.add(value); + frame.prefixes.add(localName); + } else if (name.startsWith( "xmlns:" )) { + prefix = name.substring(6); + frame.uris.add(value); + frame.prefixes.add(prefix); + } + } + } + } + protected void endElement() { }
          Hide
          Guillaume Nodet
          added a comment -

          Attached is a snapshot of servicemix-soap2 that need to be put in the lib folder to fix the problem

          Show
          Guillaume Nodet
          added a comment - Attached is a snapshot of servicemix-soap2 that need to be put in the lib folder to fix the problem

            People

            • Assignee:
              Chris Custine
              Reporter:
              Pedro Neveu
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: