Effective October 27, 2012, online and email support for FuseSource products will move to Red Hat support channels. For more information, please see the JIRA Migration to Red Hat FAQ.
As of October 27th, please open all new issues in the Red Hat Customer Portal .
Issue Details (XML | Word | Printable)

Key: ESB-1109
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Chris Custine
Reporter: Pedro Neveu
Votes: 1
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
FUSE ESB

namespace stripped from request

Created: 22/Jan/10 10:46 PM   Updated: 14/Jun/10 06:36 PM
Component/s: servicemix-cxf-bc
Affects Version/s: 3.4.0.4-fuse
Fix Version/s: 3.4.0.6-fuse

File Attachments: 1. Zip Archive servicemix-cxf-bc-2009.04-fuse-SNAPSHOT-installer.zip (5.14 MB)
2. Zip Archive servicemix-cxf-se-2009.04-fuse-SNAPSHOT-installer.zip (9.33 MB)
3. Java Archive File servicemix-soap2-2010.02-SNAPSHOT.jar (192 kB)
4. GZip Archive test-case.tar.gz (8 kB)
5. GZip Archive testcase-2118.tar.gz (10 kB)
6. File testcase-esb-1109.tgz (26 kB)

Environment: tested with: 3.4.0.4 and 3.4.0-SNAPSHOT
Issue Links:
Linked
 


 Description  « Hide
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.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Jeff Rutman added a comment - 23/Jan/10 03:36 AM
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.

Chris Custine added a comment - 23/Jan/10 03:38 PM
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.

Chris Custine added a comment - 23/Jan/10 08:12 PM
Newer test case with failing and passing client.html

Dave Stanley added a comment - 25/Jan/10 07:40 PM - edited
Attaching snapshot w ssl fix from ESB-1091. Files have been updated. Should contain CXF version 2.2.x-fuse-SNAPSHOT.

Hadrian Zbarcea added a comment - 15/May/10 02:40 AM
Incomplete.

Hadrian Zbarcea added a comment - 15/May/10 02:44 AM
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.

Guillaume Nodet added a comment - 15/May/10 10:06 AM
I have a junit test case that reproduce the issue so i'm trying to find a fix.

Guillaume Nodet added a comment - 15/May/10 10:22 AM
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() {
     }

Guillaume Nodet added a comment - 15/May/10 10:24 AM
Attached is a snapshot of servicemix-soap2 that need to be put in the lib folder to fix the problem