Author: gnodet
Date: Tue Feb 20 09:06:16 2007
New Revision: 509652

URL: http://svn.apache.org/viewvc?view=rev&rev=509652
Log:
Add pom and fix a few things

Added:
    incubator/servicemix/trunk/common/servicemix-soap2/pom.xml   (with props)
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/xml/BodyOutInterceptor.java
      - copied unchanged from r509136, 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/interceptors/xml/BodyOutInterceptor.java
    incubator/servicemix/trunk/common/servicemix-soap2/src/main/resources/
    incubator/servicemix/trunk/common/servicemix-soap2/src/main/resources/org/
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/resources/org/apache/
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/resources/org/apache/servicemix/
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/resources/org/apache/servicemix/soap/
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/resources/org/apache/servicemix/soap/wsdl/
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/resources/org/apache/servicemix/soap/wsdl/validator/
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/resources/org/apache/servicemix/soap/wsdl/validator/WSIBP.properties
      - copied unchanged from r509136, 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/validator/WSIBP.properties
    incubator/servicemix/trunk/common/servicemix-soap2/src/test/resources/
    incubator/servicemix/trunk/common/servicemix-soap2/src/test/resources/org/
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/resources/org/apache/
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/resources/org/apache/servicemix/
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/resources/org/apache/servicemix/soap/
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/resources/org/apache/servicemix/soap/HelloWorld-DOC-Fault.xml
      - copied unchanged from r509136, 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorld-DOC-Fault.xml
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/resources/org/apache/servicemix/soap/HelloWorld-DOC-Input.xml
      - copied unchanged from r509136, 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorld-DOC-Input.xml
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/resources/org/apache/servicemix/soap/HelloWorld-DOC-Output.xml
      - copied unchanged from r509136, 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorld-DOC-Output.xml
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/resources/org/apache/servicemix/soap/HelloWorld-DOC.wsdl
      - copied unchanged from r509136, 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorld-DOC.wsdl
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/resources/org/apache/servicemix/soap/HelloWorld-RPC-Input.xml
      - copied unchanged from r509136, 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorld-RPC-Input.xml
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/resources/org/apache/servicemix/soap/HelloWorld-RPC-Output.xml
      - copied unchanged from r509136, 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorld-RPC-Output.xml
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/resources/org/apache/servicemix/soap/HelloWorld-RPC.wsdl
      - copied unchanged from r509136, 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorld-RPC.wsdl
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/resources/org/apache/servicemix/soap/convert/
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/resources/org/apache/servicemix/soap/convert/person.wsdl
      - copied unchanged from r509136, 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/convert/person.wsdl
Removed:
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/SoapEndpoint.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/validator/WSIBP.properties
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorld-DOC-Fault.xml
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorld-DOC-Input.xml
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorld-DOC-Output.xml
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorld-DOC.wsdl
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorld-RPC-Input.xml
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorld-RPC-Output.xml
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorld-RPC.wsdl
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/convert/person.wsdl
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/interceptors/xml/BodyOutInterceptor.java
Modified:
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/http/impl/Wsdl2HttpBindingImpl.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/http/interceptors/IriDecoderHelper.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/SoapFault.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapFaultOutInterceptor.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapInInterceptor.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapOutInterceptor.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/core/model/AbstractBinding.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/core/model/AbstractWsdl2Message.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiConstants.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1Interceptor.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiOutWsdl1Interceptor.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/wsdl/WsdlOperationInInterceptor.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/xml/StaxOutInterceptor.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/util/DomUtil.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/ws/security/WsSecurityInInterceptor.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/WSDLUtils.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/Wsdl1Soap11BindingFactory.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/validator/WSIBPValidator.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorldSoapTest.java
    
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/interceptors/xml/StaxOutInterceptorTest.java

Added: incubator/servicemix/trunk/common/servicemix-soap2/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/pom.xml?view=auto&rev=509652
==============================================================================
--- incubator/servicemix/trunk/common/servicemix-soap2/pom.xml (added)
+++ incubator/servicemix/trunk/common/servicemix-soap2/pom.xml Tue Feb 20 
09:06:16 2007
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.servicemix</groupId>
+    <artifactId>common</artifactId>
+    <version>3.2-incubating-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>servicemix-soap2</artifactId>
+  <packaging>jar</packaging>
+  <name>ServiceMix :: SOAP2</name>
+  <description>SOAP Stack v2</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-javamail_1.3.1_spec</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.modules</groupId>
+      <artifactId>geronimo-activation</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-core</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>wss4j</groupId>
+      <artifactId>wss4j</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>bouncycastle</groupId>
+      <artifactId>bcprov-jdk14</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.opensaml</groupId>
+      <artifactId>opensaml</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>xml-security</groupId>
+      <artifactId>xmlsec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.ws.commons.schema</groupId>
+      <artifactId>XmlSchema</artifactId>
+      <version>1.2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.woden</groupId>
+      <artifactId>woden</artifactId>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <!--
+      <plugin>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>maven-xbean-plugin</artifactId>
+        <executions>
+          <execution>
+            <configuration>
+              <namespace>http://servicemix.apache.org/soap/2.0</namespace>
+            </configuration>
+            <goals>
+              <goal>mapping</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <excludes>
+          </excludes>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  
+</project>

Propchange: incubator/servicemix/trunk/common/servicemix-soap2/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/servicemix/trunk/common/servicemix-soap2/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/servicemix/trunk/common/servicemix-soap2/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/http/impl/Wsdl2HttpBindingImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/http/impl/Wsdl2HttpBindingImpl.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/http/impl/Wsdl2HttpBindingImpl.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/http/impl/Wsdl2HttpBindingImpl.java
 Tue Feb 20 09:06:16 2007
@@ -24,7 +24,12 @@
 import org.apache.servicemix.soap.bindings.http.model.Wsdl2HttpBinding;
 import org.apache.servicemix.soap.bindings.http.model.Wsdl2HttpOperation;
 import org.apache.servicemix.soap.core.model.AbstractBinding;
+import org.apache.servicemix.soap.interceptors.jbi.JbiFaultOutInterceptor;
 import org.apache.servicemix.soap.interceptors.jbi.JbiInInterceptor;
+import org.apache.servicemix.soap.interceptors.jbi.JbiOutInterceptor;
+import org.apache.servicemix.soap.interceptors.mime.AttachmentsOutInterceptor;
+import org.apache.servicemix.soap.interceptors.xml.BodyOutInterceptor;
+import org.apache.servicemix.soap.interceptors.xml.StaxOutInterceptor;
 
 public class Wsdl2HttpBindingImpl extends AbstractBinding<Wsdl2HttpOperation> 
implements Wsdl2HttpBinding {
 
@@ -47,6 +52,11 @@
         
         // ServerOut phase
         phase = getInterceptors(Phase.ServerOut);
+        phase.add(new JbiFaultOutInterceptor());
+        phase.add(new JbiOutInterceptor(true));
+        phase.add(new AttachmentsOutInterceptor());
+        phase.add(new StaxOutInterceptor());
+        phase.add(new BodyOutInterceptor());
         
         // ClientOut phase
         phase = getInterceptors(Phase.ClientOut);

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/http/interceptors/IriDecoderHelper.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/http/interceptors/IriDecoderHelper.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/http/interceptors/IriDecoderHelper.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/http/interceptors/IriDecoderHelper.java
 Tue Feb 20 09:06:16 2007
@@ -22,6 +22,7 @@
 import java.util.List;
 
 import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
 
 import org.apache.servicemix.soap.util.DomUtil;
 import org.apache.servicemix.soap.util.IoUtil;
@@ -30,6 +31,8 @@
 import org.apache.ws.commons.schema.XmlSchemaSequence;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 /**
  * @author <a href=""mailto:gnodet [at] gmail.com">Guillaume Nodet</a>
@@ -239,6 +242,61 @@
         return doc;
     }
     
+    public static Document interopolateParams(Document doc, XmlSchemaElement 
element, List<Param> params) {
+        XmlSchemaComplexType cplxType = 
(XmlSchemaComplexType)element.getSchemaType();
+        XmlSchemaSequence seq = (XmlSchemaSequence)cplxType.getParticle();
+        Element root = doc.getDocumentElement();
+        if (root == null) {
+            root = doc.createElementNS(element.getQName().getNamespaceURI(), 
+                                    element.getQName().getLocalPart());
+            root.setAttribute(XMLConstants.XMLNS_ATTRIBUTE, 
element.getQName().getNamespaceURI());
+            doc.appendChild(root);
+        }
+        
+        for (int i = 0; i < seq.getItems().getCount(); i++) {
+            XmlSchemaElement elChild = 
(XmlSchemaElement)seq.getItems().getItem(i);
+            Param param = null;
+            for (Param p : params) {
+                if (p.getName().equals(elChild.getQName().getLocalPart())) {
+                    param = p;
+                    break;
+                }
+            }
+            if (param == null) {
+                continue;
+            }
+            
+            Element ec = getElement(root, elChild.getQName());
+            if (ec == null) {
+                ec = doc.createElementNS(elChild.getQName().getNamespaceURI(), 
elChild.getQName()
+                                         .getLocalPart());
+                if 
(!elChild.getQName().getNamespaceURI().equals(element.getQName().getNamespaceURI()))
 {
+                    ec.setAttribute(XMLConstants.XMLNS_ATTRIBUTE, 
elChild.getQName().getNamespaceURI());
+                }
+                
+                // insert the element at the appropriate position
+                Element insertBeforeEl = getIndexedElement(root, i);
+                if (insertBeforeEl != null) {
+                    root.insertBefore(ec, insertBeforeEl);
+                } else {
+                    root.appendChild(ec);
+                }
+            } else {
+                NodeList childNodes = ec.getChildNodes();
+                for (int j = 0; j < childNodes.getLength(); j++) {
+                    Node n = childNodes.item(j);
+                    ec.removeChild(n);
+                }
+            }
+            
+            if (param != null) {
+                params.remove(param);
+                ec.appendChild(doc.createTextNode(param.getValue()));
+            }
+        }
+        return doc;
+    }
+
     public static List<Param> decode(String uri, String loc, InputStream is) {
         List<Param> params = IriDecoderHelper.decodeIri(uri, loc);
         if (is != null) {
@@ -247,6 +305,34 @@
             IriDecoderHelper.addParams(baos.toString(), 0, baos.size(), 
params);
         }
         return params;
+    }
+
+    private static Element getIndexedElement(Element e, int i) {
+        NodeList childNodes = e.getChildNodes();
+        int elNum = 0;
+        for (int j = 0; j < childNodes.getLength(); j++) {
+            Node n = childNodes.item(j);
+            if (n.getNodeType() == Node.ELEMENT_NODE) {
+                if (i == elNum) {
+                    return (Element) n;
+                }
+                elNum++;
+            }
+        }
+        return null;
+    }
+
+    private static Element getElement(Element element, QName name) {
+        NodeList childNodes = element.getChildNodes();
+        for (int j = 0; j < childNodes.getLength(); j++) {
+            Node n = childNodes.item(j);
+            if (n.getNodeType() == Node.ELEMENT_NODE
+                && n.getLocalName().equals(name.getLocalPart())
+                && n.getNamespaceURI().equals(name.getNamespaceURI())) {
+                return (Element)n;
+            }
+        }
+        return null;
     }
 
 }

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/SoapFault.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/SoapFault.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/SoapFault.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/SoapFault.java
 Tue Feb 20 09:06:16 2007
@@ -126,6 +126,8 @@
                 code = SoapConstants.SOAP_11_CODE_SERVER;
             } else if (SoapConstants.SOAP_12_CODE_SENDER.equals(code)) {
                 code = SoapConstants.SOAP_11_CODE_CLIENT;
+            } else if 
(SoapConstants.SOAP_12_CODE_VERSIONMISMATCH.equals(code)) {
+                code = SoapConstants.SOAP_11_CODE_VERSIONMISMATCH;
             }
         } else {
             code = SoapConstants.SOAP_11_CODE_SERVER;

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapFaultOutInterceptor.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapFaultOutInterceptor.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapFaultOutInterceptor.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapFaultOutInterceptor.java
 Tue Feb 20 09:06:16 2007
@@ -27,9 +27,11 @@
 
 import org.apache.servicemix.soap.api.Fault;
 import org.apache.servicemix.soap.api.Message;
+import org.apache.servicemix.soap.bindings.soap.Soap11;
 import org.apache.servicemix.soap.bindings.soap.SoapConstants;
 import org.apache.servicemix.soap.bindings.soap.SoapFault;
 import org.apache.servicemix.soap.bindings.soap.SoapVersion;
+import org.apache.servicemix.soap.bindings.soap.SoapVersionFactory;
 import org.apache.servicemix.soap.core.AbstractInterceptor;
 import org.apache.servicemix.soap.util.stax.StaxUtil;
 
@@ -45,6 +47,9 @@
         try {
             if (exception instanceof SoapFault) {
                 SoapFault fault = (SoapFault) exception;
+                if (soapVersion == null) {
+                    //soapVersion = Soap11.getInstance();
+                }
                 if (soapVersion.getVersion() == 1.1) {
                     writeSoap11Fault(writer, fault, soapVersion);
                 } else if (soapVersion.getVersion() == 1.2) {

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapInInterceptor.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapInInterceptor.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapInInterceptor.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapInInterceptor.java
 Tue Feb 20 09:06:16 2007
@@ -62,9 +62,11 @@
             }
             if (soapVersion == null) {
                 soapVersion = 
SoapVersionFactory.getInstance().getSoapVersion(name);
+            } else {
+                soapVersion = soapVersion.getDerivedVersion(name.getPrefix());
             }
             if (soapVersion == null) {
-                throw new SoapFault(SoapFault.SENDER, "Unrecognized namespace: 
"
+                throw new 
SoapFault(SoapConstants.SOAP_12_CODE_VERSIONMISMATCH, "Unrecognized namespace: "
                                 + xmlReader.getNamespaceURI() + " at ["
                                 + xmlReader.getLocation().getLineNumber() + ","
                                 + xmlReader.getLocation().getColumnNumber()
@@ -76,7 +78,7 @@
                     throw new 
SoapFault(SoapConstants.SOAP_12_CODE_VERSIONMISMATCH, 
                           "Expected a SOAP " + soapVersion.getVersion() + " 
request");
                 }
-                throw new SoapFault(SoapFault.SENDER, "Unrecognized element: "
+                throw new 
SoapFault(SoapConstants.SOAP_12_CODE_VERSIONMISMATCH, "Unrecognized element: "
                                 + xmlReader.getName() + " at ["
                                 + xmlReader.getLocation().getLineNumber() + ","
                                 + xmlReader.getLocation().getColumnNumber()

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapOutInterceptor.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapOutInterceptor.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapOutInterceptor.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/bindings/soap/interceptors/SoapOutInterceptor.java
 Tue Feb 20 09:06:16 2007
@@ -51,9 +51,9 @@
         if (writer == null) {
             throw new NullPointerException("XMLStreamWriter content not 
found");
         }
-        SoapVersion soapVersion = this.soapVersion; 
+        SoapVersion soapVersion = message.get(SoapVersion.class); 
         if (soapVersion == null) {
-            soapVersion = message.get(SoapVersion.class);
+            soapVersion = this.soapVersion;
             if (soapVersion == null) {
                 throw new IllegalStateException("No soap version specified");
             }
@@ -79,7 +79,6 @@
             // Close elements
             writer.writeEndElement();
             writer.writeEndElement();
-            writer.flush();
         } catch (XMLStreamException e) {
             throw new Fault(e);
         }

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/core/model/AbstractBinding.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/core/model/AbstractBinding.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/core/model/AbstractBinding.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/core/model/AbstractBinding.java
 Tue Feb 20 09:06:16 2007
@@ -58,7 +58,7 @@
     
     public InterceptorChain getInterceptorChain(Phase phase) {
         InterceptorChain chain = new PhaseInterceptorChain();
-        chain.add(getInterceptors(Phase.ClientOut));
+        chain.add(getInterceptors(phase));
         return chain;
     }
     

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/core/model/AbstractWsdl2Message.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/core/model/AbstractWsdl2Message.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/core/model/AbstractWsdl2Message.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/core/model/AbstractWsdl2Message.java
 Tue Feb 20 09:06:16 2007
@@ -26,7 +26,6 @@
 
     private ContentModel contentModel;
     private XmlSchemaElement elementDeclaration;
-    private String label;
     
     /**
      * @return the contentModel

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiConstants.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiConstants.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiConstants.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiConstants.java
 Tue Feb 20 09:06:16 2007
@@ -38,6 +38,8 @@
     
     public static final String PROTOCOL_HEADERS = 
"javax.jbi.messaging.protocol.headers";
 
+    public static final String USE_JBI_WRAPPER = "useJbiWrapper";
+    
     public static final String WSDL11_WRAPPER_NAMESPACE = 
"http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper";;
     public static final String WSDL11_WRAPPER_PREFIX = "jbi";
     public static final String WSDL11_WRAPPER_MESSAGE_LOCALNAME = "message";

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1Interceptor.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1Interceptor.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1Interceptor.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiInWsdl1Interceptor.java
 Tue Feb 20 09:06:16 2007
@@ -56,6 +56,15 @@
         if (message.getContent(Exception.class) != null) {
             return;
         }
+        // Check if we should not use the JBI wrapper
+        if (message.get(JbiConstants.USE_JBI_WRAPPER) instanceof Boolean && 
((Boolean) message.get(JbiConstants.USE_JBI_WRAPPER)) == false) {
+            XMLStreamReader xmlReader = 
message.getContent(XMLStreamReader.class);
+            if (xmlReader != null) {
+                message.setContent(Source.class, 
StaxUtil.createSource(xmlReader));
+            }
+            return;
+        }
+        
         Wsdl1SoapOperation wsdlOperation = getOperation(message);
         Wsdl1SoapMessage wsdlMessage = server ? wsdlOperation.getInput() : 
wsdlOperation.getOutput();
 

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiOutWsdl1Interceptor.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiOutWsdl1Interceptor.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiOutWsdl1Interceptor.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/jbi/JbiOutWsdl1Interceptor.java
 Tue Feb 20 09:06:16 2007
@@ -56,6 +56,10 @@
         if (message.getContent(Exception.class) != null) {
             return;
         }
+        // Check if we should not use the JBI wrapper
+        if (message.get(JbiConstants.USE_JBI_WRAPPER) instanceof Boolean && 
((Boolean) message.get(JbiConstants.USE_JBI_WRAPPER)) == false) {
+            return;
+        }
         Source source = message.getContent(Source.class);
         Element element = DomUtil.parse(source).getDocumentElement();
         if 
(!JbiConstants.WSDL11_WRAPPER_NAMESPACE.equals(element.getNamespaceURI()) ||
@@ -66,9 +70,10 @@
         List<NodeList> partsContent = new ArrayList<NodeList>();
         Element partWrapper = DomUtil.getFirstChildElement(element);
         while (partWrapper != null) {
-            if (!"part".equals(partWrapper.getLocalName())) {
-                throw new Fault("Unexpected part wrapper element '" + 
partWrapper.getLocalName()
-                        + "' expected 'part'");
+            if 
(!JbiConstants.WSDL11_WRAPPER_NAMESPACE.equals(element.getNamespaceURI()) ||
+                
!JbiConstants.WSDL11_WRAPPER_PART_LOCALNAME.equals(partWrapper.getLocalName())) 
{
+                throw new Fault("Unexpected part wrapper element '" + 
QNameUtil.toString(element)
+                        + "' expected '{" + 
JbiConstants.WSDL11_WRAPPER_NAMESPACE + "}part'");
             }
             NodeList nodes = partWrapper.getChildNodes();
             partsContent.add(nodes);
@@ -93,13 +98,20 @@
             NodeList nodes =  partsContent.get(idxPart++);
             if (part.isBody()) {
                 if (wsdlOperation.getStyle() == Style.DOCUMENT) {
-                    if (nodes.getLength() != 1) {
-                        throw new Fault("Body part '" + part.getName() + "' 
contains more than one node; expected a single element.");
+                    Element e = null;
+                    for (int i = 0; i < nodes.getLength(); i++) {
+                        Node n = nodes.item(i);
+                        if (n instanceof Element) {
+                            if (e != null) {
+                                throw new Fault("Body part '" + part.getName() 
+ "' contains more than one element; expected a single element.");
+                            } else {
+                                e = (Element) n;
+                            }
+                        }
                     }
-                    if (nodes.item(0) instanceof Element == false) {
-                        throw new Fault("Body part '" + part.getName() + "' 
must be a single element");
+                    if (e == null) {
+                        throw new Fault("Body part '" + part.getName() + "' 
contains no element; expected a single element.");
                     }
-                    Element e = (Element) nodes.item(0);
                     if 
(!wsdlMessage.getElementName().equals(DomUtil.getQName(e))) {
                         throw new Fault("Body part '" + part.getName() + "' 
element '" + DomUtil.getQName(e) + " doesn't match expected element '" + 
QNameUtil.toString(wsdlMessage.getElementName()) + "'");
                     }
@@ -115,14 +127,21 @@
                 }
             } else {
                 DocumentFragment frag = document.createDocumentFragment();
-                if (nodes.getLength() != 1) {
-                    throw new Fault("Header part '" + part.getName() + "' 
contains more than one node; expected a single element.");
+                Element e = null;
+                for (int i = 0; i < nodes.getLength(); i++) {
+                    Node n = nodes.item(i);
+                    if (n instanceof Element) {
+                        if (e != null) {
+                            throw new Fault("Header part '" + part.getName() + 
"' contains more than one element; expected a single element.");
+                        } else {
+                            e = (Element) n;
+                        }
+                    }
                 }
-                if (nodes.item(0) instanceof Element == false) {
-                    throw new Fault("Header part '" + part.getName() + "' must 
be a single element");
+                if (e == null) {
+                    throw new Fault("Header part '" + part.getName() + "' 
contains no element; expected a single element.");
                 }
                 QName headerName = part.getElement();
-                Element e = (Element) nodes.item(0);
                 if (!headerName.equals(DomUtil.getQName(e))) {
                     throw new Fault("Header part '" + part.getName() + "' 
element '" + DomUtil.getQName(e) + " doesn't match expected element '" + 
QNameUtil.toString(headerName) + "'");
                 }

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/wsdl/WsdlOperationInInterceptor.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/wsdl/WsdlOperationInInterceptor.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/wsdl/WsdlOperationInInterceptor.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/wsdl/WsdlOperationInInterceptor.java
 Tue Feb 20 09:06:16 2007
@@ -23,9 +23,11 @@
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamReader;
 
+import org.apache.servicemix.soap.api.Fault;
 import org.apache.servicemix.soap.api.Message;
 import org.apache.servicemix.soap.api.model.Binding;
 import org.apache.servicemix.soap.api.model.Operation;
+import org.apache.servicemix.soap.bindings.soap.SoapFault;
 import org.apache.servicemix.soap.core.AbstractInterceptor;
 
 /**
@@ -52,6 +54,18 @@
         if (matching.size() == 1) {
             Operation op = matching.get(0);
             message.put(Operation.class, op);
+        } else {
+            StringBuilder sb = new StringBuilder();
+            sb.append("No matching operation found for element: ");
+            sb.append(name);
+            sb.append("\n");
+            sb.append("Expected one of: \n");
+            for (Operation<?> oper : binding.getOperations()) {
+                sb.append("  - ");
+                sb.append(oper.getInput().getElementName());
+                sb.append("\n");
+            }
+            throw new SoapFault(SoapFault.SENDER, sb.toString());
         }
     }
 

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/xml/StaxOutInterceptor.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/xml/StaxOutInterceptor.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/xml/StaxOutInterceptor.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/interceptors/xml/StaxOutInterceptor.java
 Tue Feb 20 09:06:16 2007
@@ -18,8 +18,11 @@
 
 import java.io.OutputStream;
 
+import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.servicemix.soap.api.Fault;
+import org.apache.servicemix.soap.api.InterceptorChain;
 import org.apache.servicemix.soap.api.Message;
 import org.apache.servicemix.soap.core.AbstractInterceptor;
 import org.apache.servicemix.soap.util.stax.StaxUtil;
@@ -39,9 +42,16 @@
         if (os == null) {
             throw new NullPointerException("OutputStream content not found");
         }
-        // TODO: handle encoding
-        XMLStreamWriter writer = StaxUtil.createWriter(os);
-        message.setContent(XMLStreamWriter.class, writer);
+        try {
+            // TODO: handle encoding
+            XMLStreamWriter writer = StaxUtil.createWriter(os);
+            message.setContent(XMLStreamWriter.class, writer);
+            InterceptorChain chain = message.get(InterceptorChain.class);
+            chain.doIntercept(message);
+            writer.flush();
+        } catch (XMLStreamException e) {
+            throw new Fault(e);
+        }
     }
 
 }

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/util/DomUtil.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/util/DomUtil.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/util/DomUtil.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/util/DomUtil.java
 Tue Feb 20 09:06:16 2007
@@ -147,21 +147,21 @@
         Element element;
         if (name.getPrefix() != null && name.getPrefix().length() > 0) {
             element = doc.createElementNS(name.getNamespaceURI(), 
name.getPrefix() + ":" + name.getLocalPart());
-            String attr = recursiveGetAttributeValue(element, 
XMLConstants.XMLNS_ATTRIBUTE + ":" + name.getPrefix());
+            String attr = recursiveGetAttributeValue(parent, 
XMLConstants.XMLNS_ATTRIBUTE + ":" + name.getPrefix());
             if (attr == null || !attr.equals(name.getNamespaceURI())) {
                 element.setAttribute(XMLConstants.XMLNS_ATTRIBUTE + ":" + 
name.getPrefix(), 
                                      name.getNamespaceURI());
             }
         } else if (name.getNamespaceURI() != null && 
name.getNamespaceURI().length() > 0) {
             element = doc.createElementNS(name.getNamespaceURI(), 
name.getLocalPart());
-            String attr = recursiveGetAttributeValue(element, 
XMLConstants.XMLNS_ATTRIBUTE);
+            String attr = recursiveGetAttributeValue(parent, 
XMLConstants.XMLNS_ATTRIBUTE);
             if (attr == null || !attr.equals(name.getNamespaceURI())) {
                 element.setAttribute(XMLConstants.XMLNS_ATTRIBUTE, 
                                      name.getNamespaceURI());
             }
         } else {
             element = doc.createElementNS(null, name.getLocalPart());
-            String attr = recursiveGetAttributeValue(element, 
XMLConstants.XMLNS_ATTRIBUTE);
+            String attr = recursiveGetAttributeValue(parent, 
XMLConstants.XMLNS_ATTRIBUTE);
             if (attr == null || attr.length() > 0) {
                 element.setAttribute(XMLConstants.XMLNS_ATTRIBUTE, 
                                      "");
@@ -198,15 +198,20 @@
     /**
      * Recursive method to find a given attribute value
      */
-    public static String recursiveGetAttributeValue(Element element, String 
attributeName) {
-        String answer = element.getAttribute(attributeName);
-        if (answer == null || answer.length() == 0) {
-            Node parentNode = element.getParentNode();
-            if (parentNode instanceof Element) {
-                return recursiveGetAttributeValue((Element) parentNode, 
attributeName);
+    public static String recursiveGetAttributeValue(Node parent, String 
attributeName) {
+        if (parent instanceof Element) {
+            Element element = (Element) parent;
+            String answer = element.getAttribute(attributeName);
+            if (answer == null || answer.length() == 0) {
+                Node parentNode = element.getParentNode();
+                if (parentNode instanceof Element) {
+                    return recursiveGetAttributeValue((Element) parentNode, 
attributeName);
+                }
             }
+            return answer;
+        } else {
+            return null;
         }
-        return answer;
     }
 
     protected static String getUniquePrefix(Element element) {

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/ws/security/WsSecurityInInterceptor.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/ws/security/WsSecurityInInterceptor.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/ws/security/WsSecurityInInterceptor.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/ws/security/WsSecurityInInterceptor.java
 Tue Feb 20 09:06:16 2007
@@ -26,13 +26,15 @@
 import org.apache.servicemix.soap.api.Message;
 import org.apache.servicemix.soap.bindings.soap.SoapInterceptor;
 import org.apache.servicemix.soap.core.AbstractInterceptor;
-import org.apache.ws.security.WSConstants;
+//import org.apache.ws.security.WSConstants;
 
 public class WsSecurityInInterceptor extends AbstractInterceptor implements 
SoapInterceptor {
 
     public static QName[] HEADERS = {
+    /*
         new QName(WSConstants.WSSE_NS, WSConstants.WSSE_LN),  
-        new QName(WSConstants.WSSE11_NS, WSConstants.WSSE_LN),  
+        new QName(WSConstants.WSSE11_NS, WSConstants.WSSE_LN),
+    */  
     };
     
     private final WsSecurityPolicy policy;

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/WSDLUtils.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/WSDLUtils.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/WSDLUtils.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/WSDLUtils.java
 Tue Feb 20 09:06:16 2007
@@ -43,6 +43,9 @@
 
 public class WSDLUtils {
 
+    public static final String WSDL1_NAMESPACE = 
"http://schemas.xmlsoap.org/wsdl/";;
+    public static final String WSDL2_NAMESPACE = 
"http://www.w3.org/2006/01/wsdl";;
+    
     public static final String WSDL1_STYLE_RPC = "rpc";
     public static final String WSDL1_STYLE_DOCUMENT = "document";
     public static final String WSDL1_USE_LITERAL = "literal";

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/Wsdl1Soap11BindingFactory.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/Wsdl1Soap11BindingFactory.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/Wsdl1Soap11BindingFactory.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/Wsdl1Soap11BindingFactory.java
 Tue Feb 20 09:06:16 2007
@@ -139,9 +139,12 @@
             part.setName(wsdlPart.getName());
             part.setType(wsdlPart.getTypeName());
             part.setElement(wsdlPart.getElementName());
-            if (wsdlSoapBody.getParts().contains(part.getName())) {
+            if ((wsdlSoapBody.getParts() == null && 
wsdlInput.getMessage().getOrderedParts(null).size() == 1) ||
+                wsdlSoapBody.getParts().contains(part.getName())) {
                 part.setBody(true);
-                input.setElementName(wsdlPart.getElementName());
+                if (operation.getStyle() == Style.DOCUMENT) {
+                    input.setElementName(wsdlPart.getElementName());
+                }
             } else {
                 boolean header = false;
                 for (SOAPHeader h : wsdlSoapHeaders) {
@@ -214,7 +217,7 @@
     }
     
     private static Style getStyle(String str) {
-        if (WSDLUtils.WSDL1_STYLE_RPC.equalsIgnoreCase(str)) {
+        if (WSDLUtils.WSDL1_STYLE_DOCUMENT.equalsIgnoreCase(str)) {
             return Style.DOCUMENT;
         } else if (WSDLUtils.WSDL1_STYLE_RPC.equalsIgnoreCase(str)) {
             return Style.RPC;

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/validator/WSIBPValidator.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/validator/WSIBPValidator.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/validator/WSIBPValidator.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/main/java/org/apache/servicemix/soap/wsdl/validator/WSIBPValidator.java
 Tue Feb 20 09:06:16 2007
@@ -187,7 +187,7 @@
             for (Iterator itBop = binding.getBindingOperations().iterator(); 
itBop.hasNext();) {
                 BindingOperation bop = (BindingOperation) itBop.next();
                 SOAPOperation soapBop = WSDLUtils.getExtension(bop, 
SOAPOperation.class);
-                Style opStyle = getStyle(soapBop.getStyle());
+                Style opStyle = soapBop != null ? getStyle(soapBop.getStyle()) 
: null;
                 if (opStyle == null) {
                     opStyle = getStyle(soapBinding.getStyle());
                     if (opStyle == null) {

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorldSoapTest.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorldSoapTest.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorldSoapTest.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/HelloWorldSoapTest.java
 Tue Feb 20 09:06:16 2007
@@ -33,6 +33,7 @@
 
 import junit.framework.TestCase;
 
+import org.apache.log4j.PropertyConfigurator;
 import org.apache.servicemix.soap.api.Message;
 import org.apache.servicemix.soap.api.InterceptorProvider.Phase;
 import org.apache.servicemix.soap.api.model.Binding;
@@ -54,6 +55,14 @@
 
 public class HelloWorldSoapTest extends TestCase {
 
+    static {
+        String conf = System.getProperty("log4j.configuration");
+        System.err.println("Configuring log4j with: " + conf);
+        if (conf != null) {
+            PropertyConfigurator.configure(conf);
+        }
+    }
+    
     public void testDocLitInput() throws Exception {
         Binding<?> binding = getBinding("HelloWorld-DOC.wsdl");
         PhaseInterceptorChain phaseIn = new PhaseInterceptorChain();

Modified: 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/interceptors/xml/StaxOutInterceptorTest.java
URL: 
http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/interceptors/xml/StaxOutInterceptorTest.java?view=diff&rev=509652&r1=509651&r2=509652
==============================================================================
--- 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/interceptors/xml/StaxOutInterceptorTest.java
 (original)
+++ 
incubator/servicemix/trunk/common/servicemix-soap2/src/test/java/org/apache/servicemix/soap/interceptors/xml/StaxOutInterceptorTest.java
 Tue Feb 20 09:06:16 2007
@@ -25,6 +25,7 @@
 
 import org.apache.servicemix.soap.api.Message;
 import org.apache.servicemix.soap.core.MessageImpl;
+import org.apache.servicemix.soap.core.PhaseInterceptorChain;
 
 public class StaxOutInterceptorTest extends TestCase {
 
@@ -42,7 +43,9 @@
     public void testValidInput() throws Exception {
         Message msg = new MessageImpl();
         msg.setContent(OutputStream.class, new ByteArrayOutputStream());
-        interceptor.handleMessage(msg);
+        PhaseInterceptorChain chain = new PhaseInterceptorChain();
+        chain.add(interceptor);
+        chain.doIntercept(msg);
         XMLStreamWriter writer = msg.getContent(XMLStreamWriter.class); 
         assertNotNull(writer);
     }


Reply via email to