cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject svn commit: r483359 - in /incubator/cxf/trunk: rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ rt/core/src/m...
Date Thu, 07 Dec 2006 06:48:24 GMT
Author: tli
Date: Wed Dec  6 22:48:23 2006
New Revision: 483359

URL: http://svn.apache.org/viewvc?view=rev&rev=483359
Log:
CXF-283, CXF-295, CXF-296, CXF-297 bug fix with unit tests

Added:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInterceptor.java   (with props)
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java   (with props)
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceUtils.java   (with props)
    incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs-Import.wsdl   (with props)
    incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs.wsdl   (with props)
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/Server.java   (with props)
Modified:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/AbstractBindingFactory.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/MultipartMessageInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLBindingFactory.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentUnmarshaller.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?view=diff&rev=483359&r1=483358&r2=483359
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java Wed Dec  6 22:48:23 2006
@@ -34,8 +34,8 @@
 import javax.wsdl.extensions.mime.MIMEPart;
 import javax.xml.namespace.QName;
 
-
 import org.apache.cxf.Bus;
+
 import org.apache.cxf.binding.AbstractBindingFactory;
 import org.apache.cxf.binding.Binding;
 import org.apache.cxf.binding.BindingFactoryManager;
@@ -47,6 +47,7 @@
 import org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor;
 import org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor;
 import org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor;
+import org.apache.cxf.binding.soap.interceptor.SoapActionInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapInPostInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor;
@@ -149,6 +150,7 @@
         sb.getInInterceptors().add(new MustUnderstandInterceptor());
         sb.getInInterceptors().add(new StaxInInterceptor());        
         
+        sb.getOutInterceptors().add(new SoapActionInterceptor());
         sb.getOutInterceptors().add(new AttachmentOutInterceptor());
         
         sb.getOutInterceptors().add(new StaxOutInterceptor());
@@ -184,11 +186,8 @@
         return sb;
     }
 
-    public BindingInfo createBindingInfo(ServiceInfo service, javax.wsdl.Binding binding) {
-        String ns = ((ExtensibilityElement) binding.getExtensibilityElements().get(0)).getElementType()
-                        .getNamespaceURI();
+    public BindingInfo createBindingInfo(ServiceInfo service, javax.wsdl.Binding binding, String ns) {
         SoapBindingInfo bi = new SoapBindingInfo(service, ns);
-
         // Copy all the extensors
         initializeBindingInfo(service, binding, bi);
 

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java?view=diff&rev=483359&r1=483358&r2=483359
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java Wed Dec  6 22:48:23 2006
@@ -34,7 +34,6 @@
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
-import org.apache.cxf.service.model.ServiceModelUtil;
 import org.apache.cxf.staxutils.StaxUtils;
 
 public class RPCOutInterceptor extends AbstractOutDatabindingInterceptor {
@@ -95,24 +94,16 @@
     protected String addOperationNode(NSStack nsStack, Message message, XMLStreamWriter xmlWriter) 
         throws XMLStreamException {
         String responseSuffix = !isRequestor(message) ? "Response" : "";
-        String namespaceURI = ServiceModelUtil.getTargetNamespace(message.getExchange());
-        nsStack.add(namespaceURI);
-        String prefix = nsStack.getPrefix(namespaceURI);
-
-        String operationName = getOperationName(message) + responseSuffix;
-
-        StaxUtils.writeStartElement(xmlWriter, prefix, operationName, namespaceURI);
-        return namespaceURI;
+        BindingOperationInfo boi = message.getExchange().get(BindingOperationInfo.class);
+        String ns = boi.getName().getNamespaceURI();
+        nsStack.add(ns);
+        String prefix = nsStack.getPrefix(ns);
+        StaxUtils.writeStartElement(xmlWriter, prefix, boi.getName().getLocalPart() + responseSuffix, ns);
+        return ns;
     }
 
     protected XMLStreamWriter getXMLStreamWriter(Message message) {
         return message.getContent(XMLStreamWriter.class);
-    }
-
-    private String getOperationName(Message message) {
-        BindingOperationInfo boi = (BindingOperationInfo) message.getExchange().get(
-                        BindingOperationInfo.class);       
-        return boi.getOperationInfo().getName().getLocalPart();
     }
 
 }

Added: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInterceptor.java?view=auto&rev=483359
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInterceptor.java (added)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInterceptor.java Wed Dec  6 22:48:23 2006
@@ -0,0 +1,75 @@
+/**
+ * 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.
+ */
+
+package org.apache.cxf.binding.soap.interceptor;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cxf.binding.soap.Soap11;
+import org.apache.cxf.binding.soap.Soap12;
+import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.binding.soap.model.SoapOperationInfo;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.model.BindingOperationInfo;
+
+public class SoapActionInterceptor extends AbstractSoapInterceptor {
+    
+    public SoapActionInterceptor() {
+        super();
+        setPhase(Phase.POST_LOGICAL);
+    }
+    
+    @SuppressWarnings("unchecked")
+    public void handleMessage(SoapMessage message) throws Fault {
+        // TODO Auto-generated method stub
+        if (!(message == message.getExchange().getInMessage())) {
+            setSoapAction(message);
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    private void setSoapAction(SoapMessage message) {
+        List<String> value = new ArrayList<String>();
+        
+        BindingOperationInfo boi = message.getExchange().get(BindingOperationInfo.class);
+        if (boi == null) {
+            value.add("\"\"");
+        } else {
+            SoapOperationInfo soi = (SoapOperationInfo) boi.getExtensor(SoapOperationInfo.class);            
+            value.add(soi == null ? "\"\"" : soi.getAction() == null ? "\"\"" : soi.getAction());
+        }
+        Map<String, List<String>> reqHeaders = (Map<String, List<String>>)
+            message.get(Message.PROTOCOL_HEADERS);
+        if (reqHeaders == null) {
+            reqHeaders = new HashMap<String, List<String>>();
+            message.put(Message.PROTOCOL_HEADERS, reqHeaders);
+        }
+        if (message.getVersion() instanceof Soap11 && !reqHeaders.containsKey("SOAPAction")) {            
+            reqHeaders.put("SOAPAction", value);            
+        } else if (message.getVersion() instanceof Soap12 && !reqHeaders.containsKey("action")) {
+            reqHeaders.put("action", value);
+        }
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapActionInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java?view=diff&rev=483359&r1=483358&r2=483359
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java Wed Dec  6 22:48:23 2006
@@ -59,10 +59,9 @@
     
     public void handleMessage(SoapMessage message) {
         SoapVersion soapVersion = message.getVersion();
-        try {
+        try {            
             XMLStreamWriter xtw = message.getContent(XMLStreamWriter.class);
             message.setContent(XMLStreamWriter.class, xtw);            
-            
             xtw.setPrefix(soapVersion.getPrefix(), soapVersion.getNamespace());
             xtw.writeStartElement(soapVersion.getPrefix(), 
                                   soapVersion.getEnvelope().getLocalPart(),

Added: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java?view=auto&rev=483359
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java (added)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java Wed Dec  6 22:48:23 2006
@@ -0,0 +1,59 @@
+/**
+ * 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.
+ */
+
+package org.apache.cxf.binding.soap;
+
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.binding.soap.interceptor.SoapActionInterceptor;
+import org.apache.cxf.message.ExchangeImpl;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+
+public class SoapActionInterceptorTest extends TestCase {
+
+    @SuppressWarnings("unchecked")
+    public void testSoapAction() throws Exception {
+        Message message = new MessageImpl();
+        message.setExchange(new ExchangeImpl());
+        message.getExchange().setOutMessage(message);
+        SoapBinding sb = new SoapBinding();
+        message = sb.createMessage(message);
+        assertNotNull(message);
+        assertTrue(message instanceof SoapMessage);
+        SoapMessage soapMessage = (SoapMessage) message;
+        assertEquals(Soap11.getInstance(), soapMessage.getVersion());
+        (new SoapActionInterceptor()).handleMessage(soapMessage);
+        Map<String, List<String>> reqHeaders = (Map<String, List<String>>) soapMessage
+                .get(Message.PROTOCOL_HEADERS);
+        assertNotNull(reqHeaders);
+        assertEquals("\"\"", reqHeaders.get("SOAPAction").get(0));
+
+        sb.setSoapVersion(Soap12.getInstance());
+        soapMessage = (SoapMessage) sb.createMessage(soapMessage);
+        (new SoapActionInterceptor()).handleMessage(soapMessage);
+        reqHeaders = (Map<String, List<String>>) message.get(Message.PROTOCOL_HEADERS);
+        assertNotNull(reqHeaders);
+        assertEquals("\"\"", reqHeaders.get("action").get(0));
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java?view=diff&rev=483359&r1=483358&r2=483359
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapBindingFactoryTest.java Wed Dec  6 22:48:23 2006
@@ -50,6 +50,7 @@
 import org.easymock.IMocksControl;
 
 import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
 import static org.easymock.classextension.EasyMock.createNiceControl;
 
 public class SoapBindingFactoryTest extends TestCase {
@@ -63,8 +64,9 @@
         return control.createMock(Bus.class);        
     }
     
-    private BindingFactoryManager getBindingFactoryManager(String ns) throws BusException {
+    private BindingFactoryManager getBindingFactoryManager(String ns, Bus bus) throws BusException {
         SoapBindingFactory bindingFactory = new SoapBindingFactory();
+        bindingFactory.setBus(bus);
         BindingFactoryManager bfm = new BindingFactoryManagerImpl();
         bfm.registerBindingFactory(ns, bindingFactory);
         return bfm;
@@ -75,9 +77,10 @@
 
         Bus bus = getMockBus();
 
-        BindingFactoryManager bfm = getBindingFactoryManager(WSDLConstants.SOAP11_NAMESPACE);
+        BindingFactoryManager bfm = getBindingFactoryManager(WSDLConstants.SOAP11_NAMESPACE, bus);
 
-        expect(bus.getExtension(BindingFactoryManager.class)).andReturn(bfm);
+        bus.getExtension(BindingFactoryManager.class);
+        expectLastCall().andReturn(bfm).anyTimes();
         
         DestinationFactoryManager dfm = control.createMock(DestinationFactoryManager.class);
         expect(bus.getExtension(DestinationFactoryManager.class)).andStubReturn(dfm);
@@ -119,7 +122,7 @@
 
         Bus bus = getMockBus();
 
-        BindingFactoryManager bfm = getBindingFactoryManager(WSDLConstants.SOAP12_NAMESPACE);
+        BindingFactoryManager bfm = getBindingFactoryManager(WSDLConstants.SOAP12_NAMESPACE, bus);
 
         expect(bus.getExtension(BindingFactoryManager.class)).andReturn(bfm);
         

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java?view=diff&rev=483359&r1=483358&r2=483359
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentDeserializer.java Wed Dec  6 22:48:23 2006
@@ -22,6 +22,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.PushbackInputStream;
+import java.net.URLDecoder;
 import java.util.Enumeration;
 
 import javax.activation.DataHandler;
@@ -138,7 +139,7 @@
         if (id != null && id.startsWith("<")) {
             id = id.substring(1, id.length() - 1);
         }
-        id = id.startsWith("cid:") ? id.substring(4) : id;
+        id = URLDecoder.decode(id.startsWith("cid:") ? id.substring(4) : id, "UTF-8");
         
         AttachmentImpl att = new AttachmentImpl(id);
         setupAttachment(att, headers);

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java?view=diff&rev=483359&r1=483358&r2=483359
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java Wed Dec  6 22:48:23 2006
@@ -41,7 +41,7 @@
      */
     public static String createContentID(String ns) throws UnsupportedEncodingException {
         // tend to change
-        String cid = "cxf.apache.org";
+        String cid = "http://cxf.apache.org/";
         String name = UUID.randomUUID() + "@";
         if (ns != null && (ns.length() > 0)) {
             try {
@@ -55,7 +55,7 @@
                 cid = URLEncoder.encode(ns, "UTF-8");
             }
         }
-        return name + cid;
+        return URLEncoder.encode(name + cid, "UTF-8");
     }
 
     public static String getUniqueBoundaryValue(int part) {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/AbstractBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/AbstractBindingFactory.java?view=diff&rev=483359&r1=483358&r2=483359
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/AbstractBindingFactory.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/binding/AbstractBindingFactory.java Wed Dec  6 22:48:23 2006
@@ -74,11 +74,9 @@
      * @param binding
      * @return
      */
-    public BindingInfo createBindingInfo(ServiceInfo service, Binding binding) {
+    public BindingInfo createBindingInfo(ServiceInfo service, Binding binding, String ns) {
 
-        String namespace = ((ExtensibilityElement)binding.getExtensibilityElements().get(0))
-            .getElementType().getNamespaceURI();
-        BindingInfo bi = createBindingInfo(service, namespace);
+        BindingInfo bi = createBindingInfo(service, ns);
         
         return initializeBindingInfo(service, binding, bi);
     }
@@ -96,7 +94,8 @@
             if (bop.getBindingOutput() != null) {
                 outName = bop.getBindingOutput().getName();
             }
-            BindingOperationInfo bop2 = bi.buildOperation(new QName(service.getName().getNamespaceURI(),
+            String portTypeNs = binding.getPortType().getQName().getNamespaceURI();
+            BindingOperationInfo bop2 = bi.buildOperation(new QName(portTypeNs,
                                                                     bop.getName()), inName, outName);
             if (bop2 != null) {
 

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/MultipartMessageInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/MultipartMessageInterceptor.java?view=diff&rev=483359&r1=483358&r2=483359
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/MultipartMessageInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/MultipartMessageInterceptor.java Wed Dec  6 22:48:23 2006
@@ -51,16 +51,19 @@
             return;
         }
         
-        if (!Boolean.TRUE.equals(
-            message.getContextualProperty(org.apache.cxf.message.Message.MTOM_ENABLED))) {
-            return;
-        }
-
-        AttachmentDeserializer ad = new AttachmentDeserializer(message);
-        try {
-            ad.initializeAttachments();
-        } catch (IOException e) {
-            throw new Fault(e);
+//        if (!Boolean.TRUE.equals(
+//            message.getContextualProperty(org.apache.cxf.message.Message.MTOM_ENABLED))) {
+//            return;
+//        }
+        
+        String contentType = (String) message.get(Message.CONTENT_TYPE);
+        if (contentType != null && contentType.toLowerCase().indexOf("multipart/related") != -1) {
+            AttachmentDeserializer ad = new AttachmentDeserializer(message);
+            try {
+                ad.initializeAttachments();
+            } catch (IOException e) {
+                throw new Fault(e);
+            }
         }
     }
 

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLBindingFactory.java?view=diff&rev=483359&r1=483358&r2=483359
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLBindingFactory.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLBindingFactory.java Wed Dec  6 22:48:23 2006
@@ -26,5 +26,5 @@
 import org.apache.cxf.service.model.ServiceInfo;
 
 public interface WSDLBindingFactory extends BindingFactory {
-    BindingInfo createBindingInfo(ServiceInfo serviceInfo, Binding binding);
+    BindingInfo createBindingInfo(ServiceInfo serviceInfo, Binding binding, String ns);
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?view=diff&rev=483359&r1=483358&r2=483359
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java Wed Dec  6 22:48:23 2006
@@ -50,7 +50,7 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusException;
 import org.apache.cxf.binding.BindingFactory;
-import org.apache.cxf.binding.BindingFactoryManager;
+
 import org.apache.cxf.resource.XmlSchemaURIResolver;
 import org.apache.cxf.service.model.AbstractMessageContainer;
 import org.apache.cxf.service.model.AbstractPropertiesHolder;
@@ -69,6 +69,7 @@
 import org.apache.cxf.service.model.UnwrappedOperationInfo;
 import org.apache.cxf.transport.DestinationFactory;
 import org.apache.cxf.transport.DestinationFactoryManager;
+
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
@@ -247,20 +248,14 @@
 
     public BindingInfo buildBinding(ServiceInfo service, Binding binding) {
         BindingInfo bi = null;
-        String ns = ((ExtensibilityElement)binding.getExtensibilityElements().get(0)).getElementType()
-            .getNamespaceURI();
-        try {
-            BindingFactory factory = bus.getExtension(BindingFactoryManager.class).getBindingFactory(ns);
-            if (factory instanceof WSDLBindingFactory) {
-                WSDLBindingFactory wFactory = (WSDLBindingFactory)factory;
-                bi = wFactory.createBindingInfo(service, binding);
-            }
-        } catch (BusException e) {
-            // ignore, we'll use a generic BindingInfo
+        StringBuffer ns = new StringBuffer(100);
+        BindingFactory factory = WSDLServiceUtils.getBindingFactory(binding, bus, ns);
+        if (factory instanceof WSDLBindingFactory) {
+            WSDLBindingFactory wFactory = (WSDLBindingFactory)factory;
+            bi = wFactory.createBindingInfo(service, binding, ns.toString());
         }
-
         if (bi == null) {
-            bi = new BindingInfo(service, ns);
+            bi = new BindingInfo(service, ns.toString());
             bi.setName(binding.getQName());
             copyExtensors(bi, binding.getExtensibilityElements());
 
@@ -522,7 +517,8 @@
         
         List orderedParam = msg.getOrderedParts(paramOrder);
         for (Part part : cast(orderedParam, Part.class)) {
-            MessagePartInfo pi = minfo.addMessagePart(part.getName());
+            MessagePartInfo pi = minfo.addMessagePart(new QName(minfo.getName().getNamespaceURI(), 
+                    part.getName()));
             if (part.getTypeName() != null) {
                 pi.setTypeQName(part.getTypeName());
                 pi.setElement(false);

Added: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceUtils.java?view=auto&rev=483359
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceUtils.java (added)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceUtils.java Wed Dec  6 22:48:23 2006
@@ -0,0 +1,59 @@
+/**
+ * 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.
+ */
+
+package org.apache.cxf.wsdl11;
+
+import javax.wsdl.Binding;
+import javax.wsdl.extensions.ExtensibilityElement;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusException;
+import org.apache.cxf.binding.BindingFactory;
+import org.apache.cxf.binding.BindingFactoryManager;
+
+public final class WSDLServiceUtils {
+
+    private WSDLServiceUtils() {
+
+    }
+
+    public static BindingFactory getBindingFactory(Binding binding, Bus bus, StringBuffer sb) {
+        BindingFactory factory = null;
+        for (Object obj : binding.getExtensibilityElements()) {
+            if (obj instanceof ExtensibilityElement) {
+                ExtensibilityElement ext = (ExtensibilityElement) obj;
+                sb.delete(0, sb.length());
+                sb.append(ext.getElementType().getNamespaceURI());
+                try {
+                    factory = bus.getExtension(BindingFactoryManager.class).getBindingFactory(sb.toString());
+                } catch (BusException e) {
+                    // ignore, we'll use a generic BindingInfo
+                }
+
+                if (factory != null) {
+                    break;
+                }
+            }
+
+        }
+
+        return factory;
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceUtils.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java?view=diff&rev=483359&r1=483358&r2=483359
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java (original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java Wed Dec  6 22:48:23 2006
@@ -87,12 +87,12 @@
     private DestinationFactoryManager destinationFactoryManager;
 
     public void setUp() throws Exception {
-        setUpWSDL(WSDL_PATH);
+        setUpWSDL(WSDL_PATH, 0);
     }
 
 
     
-    private void setUpWSDL(String wsdl) throws Exception {
+    private void setUpWSDL(String wsdl, int serviceSeq) throws Exception {
         String wsdlUrl = getClass().getResource(wsdl).toString();
         LOG.info("the path of wsdl file is " + wsdlUrl);
         WSDLFactory wsdlFactory = WSDLFactory.newInstance();
@@ -102,10 +102,15 @@
         def = wsdlReader.readWSDL(new WSDLLocatorImpl(wsdlUrl));
 
         WSDLServiceBuilder wsdlServiceBuilder = new WSDLServiceBuilder(bus);
+        int seq = 0;
         for (Service serv : CastUtils.cast(def.getServices().values(), Service.class)) {
             if (serv != null) {
                 service = serv;
-                break;
+                if (seq == serviceSeq) {
+                    break;
+                } else {
+                    seq++;
+                }
             }
         }
 
@@ -334,7 +339,7 @@
     }
 
     public void testBare() throws Exception {
-        setUpWSDL(BARE_WSDL_PATH);
+        setUpWSDL(BARE_WSDL_PATH, 0);
         BindingInfo bindingInfo = null;
         bindingInfo = serviceInfo.getBindings().iterator().next();
         Collection<BindingOperationInfo> bindingOperationInfos = bindingInfo.getOperations();
@@ -382,7 +387,7 @@
             fout.flush();
             fout.close();
         }
-        setUpWSDL(IMPORT_WSDL_PATH);
+        setUpWSDL(IMPORT_WSDL_PATH, 0);
         TypeInfo types = serviceInfo.getTypeInfo();
         assertNotNull(types);
         assertNotNull(types.getSchemas());
@@ -392,4 +397,29 @@
         assertNotNull(schema);        
     }
 
+    
+    public void testDiffPortTypeNsImport() throws Exception {
+        setUpWSDL("/DiffPortTypeNs.wsdl", 0);        
+        doDiffPortTypeNsImport();
+        setUpWSDL("/DiffPortTypeNs.wsdl", 1);
+        doDiffPortTypeNsImport();
+    }
+    
+    private void doDiffPortTypeNsImport() {
+        if (serviceInfo.getName().getLocalPart().endsWith("Rpc")) {
+            String ns = serviceInfo.getInterface().getName().getNamespaceURI();
+            OperationInfo oi = serviceInfo.getInterface().getOperation(new QName(ns, "NewOperationRpc"));
+            assertNotNull(oi);
+            ns = oi.getInput().getName().getNamespaceURI();
+            MessagePartInfo mpi = oi.getInput().getMessagePart(new QName(ns, "NewOperationRequestRpc"));
+            assertNotNull(mpi);                    
+        } else {
+            String ns = serviceInfo.getInterface().getName().getNamespaceURI();
+            OperationInfo oi = serviceInfo.getInterface().getOperation(new QName(ns, "NewOperation"));
+            assertNotNull(oi);
+            ns = oi.getInput().getName().getNamespaceURI();
+            MessagePartInfo mpi = oi.getInput().getMessagePart(new QName(ns, "NewOperationRequest"));
+            assertNotNull(mpi);                    
+        }
+    }
 }

Added: incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs-Import.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs-Import.wsdl?view=auto&rev=483359
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs-Import.wsdl (added)
+++ incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs-Import.wsdl Wed Dec  6 22:48:23 2006
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:tns="http://cxf.apache.org/DiffPortTypeNs-Import/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="DiffPortTypeNs-Import"
+    targetNamespace="http://cxf.apache.org/DiffPortTypeNs-Import/">
+
+    <wsdl:message name="NewOperationResponse">
+        <wsdl:part name="NewOperationResponse" type="xsd:string" />
+    </wsdl:message>
+    <wsdl:message name="NewOperationRequest">
+        <wsdl:part name="NewOperationRequest" type="xsd:string" />
+    </wsdl:message>
+    <wsdl:portType name="DiffPortTypeNs">
+        <wsdl:operation name="NewOperation">
+            <wsdl:input message="tns:NewOperationRequest" />
+            <wsdl:output message="tns:NewOperationResponse" />
+        </wsdl:operation>
+    </wsdl:portType>
+
+    <wsdl:message name="NewOperationResponseRpc">
+        <wsdl:part name="NewOperationResponseRpc" type="xsd:string" />
+    </wsdl:message>
+    <wsdl:message name="NewOperationRequestRpc">
+        <wsdl:part name="NewOperationRequestRpc" type="xsd:string" />
+    </wsdl:message>
+    <wsdl:portType name="DiffPortTypeNsRpc">
+        <wsdl:operation name="NewOperationRpc">
+            <wsdl:input message="tns:NewOperationRequestRpc" />
+            <wsdl:output message="tns:NewOperationResponseRpc" />
+        </wsdl:operation>
+    </wsdl:portType>
+
+</wsdl:definitions>
\ No newline at end of file

Propchange: incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs-Import.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs-Import.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs-Import.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs.wsdl?view=auto&rev=483359
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs.wsdl (added)
+++ incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs.wsdl Wed Dec  6 22:48:23 2006
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:tns="http://cxf.apache.org/DiffPortTypeNs/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="DiffPortTypeNs"
+    xmlns:n1="http://cxf.apache.org/DiffPortTypeNs-Import/"
+    targetNamespace="http://cxf.apache.org/DiffPortTypeNs/">
+    <wsdl:import namespace="http://cxf.apache.org/DiffPortTypeNs-Import/"
+        location="DiffPortTypeNs-Import.wsdl" />
+
+    <wsdl:binding name="DiffPortTypeNsSOAP" type="n1:DiffPortTypeNs">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+        <wsdl:operation name="NewOperation">
+            <soap:operation soapAction="http://cxf.apache.org/DiffPortTypeNs/NewOperation" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="DiffPortTypeNs">
+        <wsdl:port binding="tns:DiffPortTypeNsSOAP" name="DiffPortTypeNsSOAP">
+            <soap:address location="http://cxf.apache.org/DiffPortTypeNs/" />
+        </wsdl:port>
+    </wsdl:service>
+
+    <wsdl:binding name="DiffPortTypeNsSOAPRpc" type="n1:DiffPortTypeNsRpc">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
+        <wsdl:operation name="NewOperationRpc">
+            <soap:operation soapAction="http://cxf.apache.org/DiffPortTypeNs/NewOperationRpc" />
+            <wsdl:input>
+                <soap:body namespace="http://cxf.apache.org/DiffPortTypeNs-Import/" use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body namespace="http://cxf.apache.org/DiffPortTypeNs-Import/" use="literal" />
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="DiffPortTypeNsRpc">
+        <wsdl:port binding="tns:DiffPortTypeNsSOAPRpc" name="DiffPortTypeNsSOAPRpc">
+            <soap:address location="http://cxf.apache.org/DiffPortTypeNsRpc/" />
+        </wsdl:port>
+    </wsdl:service>
+
+</wsdl:definitions>

Propchange: incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/core/src/test/resources/DiffPortTypeNs.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentUnmarshaller.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentUnmarshaller.java?view=diff&rev=483359&r1=483358&r2=483359
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentUnmarshaller.java (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/JAXBAttachmentUnmarshaller.java Wed Dec  6 22:48:23 2006
@@ -22,6 +22,8 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 import java.util.logging.Logger;
 
 import javax.activation.DataHandler;
@@ -65,13 +67,20 @@
 
     @Override
     public boolean isXOPPackage() {
-        return Boolean.TRUE.equals(message.getContextualProperty(
-            org.apache.cxf.message.Message.MTOM_ENABLED));
+        String contentType = (String) message.getContextualProperty(Message.CONTENT_TYPE);
+        if (contentType != null && contentType.contains("application/xop+xml")) {
+            return true;
+        }
+        return false;
     }
 
     private DataSource getAttachmentDataSource(String contentId) {
         if (contentId.startsWith("cid:")) {
-            contentId = contentId.substring(4);
+            try {
+                contentId = URLDecoder.decode(contentId.substring(4), "UTF-8");
+            } catch (UnsupportedEncodingException ue) {
+                contentId = contentId.substring(4);
+            }
         }
         return new LazyDataSource(contentId, message.getAttachments());
     }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?view=diff&rev=483359&r1=483358&r2=483359
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java Wed Dec  6 22:48:23 2006
@@ -231,7 +231,7 @@
         }
         boolean isIn = isInParam(method, i);
         boolean isOut = isOutParam(method, i);
-        
+
         if (isIn && !isOut) {
             QName name = getInPartName(o, method, i);
             MessagePartInfo part = o.getInput().getMessagePart(name);

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java?view=diff&rev=483359&r1=483358&r2=483359
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java Wed Dec  6 22:48:23 2006
@@ -35,72 +35,21 @@
 import org.apache.cxf.BusFactoryHelper;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.ClientImpl;
-import org.apache.cxf.endpoint.ServerImpl;
 import org.apache.cxf.jaxws.EndpointInvocationHandler;
-import org.apache.cxf.jaxws.JAXWSMethodInvoker;
 import org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl;
 import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
-import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.mime.TestMtom;
-import org.apache.cxf.mtom_xop.TestMtomImpl;
 import org.apache.cxf.service.Service;
-import org.apache.cxf.service.factory.AbstractServiceFactoryBean;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.systest.common.ClientServerSetupBase;
 import org.apache.cxf.systest.common.ClientServerTestBase;
-import org.apache.cxf.systest.common.TestServerBase;
-import org.apache.cxf.transport.ChainInitiationObserver;
-import org.apache.cxf.transport.MessageObserver;
 
 public class ClientMtomXopTest extends ClientServerTestBase {
 
     public static final QName MTOM_PORT = new QName("http://cxf.apache.org/mime", "TestMtomPort");
     public static final QName MTOM_SERVICE = new QName("http://cxf.apache.org/mime", "TestMtomService");
-
-    public static class Server extends TestServerBase {
-
-        protected void run() {
-            Object implementor = new TestMtomImpl();
-            String address = "http://localhost:9036/mime-test";
-            try {
-                Bus bus = BusFactoryHelper.newInstance().getDefaultBus();
-                JaxWsImplementorInfo implInfo = new JaxWsImplementorInfo(implementor.getClass());
-                AbstractServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean(implInfo);
-                serviceFactory.setBus(bus);
-                Service service = serviceFactory.create();
-                QName endpointName = implInfo.getEndpointName();
-                EndpointInfo ei = service.getServiceInfo().getEndpoint(endpointName);
-                service.setInvoker(new JAXWSMethodInvoker(implementor));
-                org.apache.cxf.endpoint.EndpointImpl endpoint = new JaxWsEndpointImpl(bus, service, ei);
-                SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding()); 
-                jaxWsSoapBinding.setMTOMEnabled(true);
-
-                endpoint.getInInterceptors().add(new TestMultipartMessageInterceptor());
-                endpoint.getOutInterceptors().add(new TestAttachmentOutInterceptor());
-                
-                endpoint.getEndpointInfo().setAddress(address);
-                MessageObserver observer = new ChainInitiationObserver(endpoint, bus);
-                ServerImpl server = new ServerImpl(bus, endpoint, observer);
-                server.start();
-            } catch (Exception e) {
-                Thread.currentThread().interrupt();
-            }            
-        }
-
-        public static void main(String args[]) {
-            try {
-                Server s = new Server();
-                s.start();
-            } catch (Exception ex) {
-                ex.printStackTrace();
-                System.exit(-1);
-            } finally {
-                System.out.println("done!");
-            }
-        }
-    }
 
     public static Test suite() throws Exception {
         TestSuite suite = new TestSuite(ClientMtomXopTest.class);

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/Server.java?view=auto&rev=483359
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/Server.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/Server.java Wed Dec  6 22:48:23 2006
@@ -0,0 +1,82 @@
+/**
+ * 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.
+ */
+
+package org.apache.cxf.systest.mtom;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactoryHelper;
+import org.apache.cxf.endpoint.ServerImpl;
+import org.apache.cxf.jaxws.JAXWSMethodInvoker;
+import org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl;
+import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
+import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
+import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
+import org.apache.cxf.mtom_xop.TestMtomImpl;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.factory.AbstractServiceFactoryBean;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.systest.common.TestServerBase;
+import org.apache.cxf.transport.ChainInitiationObserver;
+import org.apache.cxf.transport.MessageObserver;
+
+public class Server extends TestServerBase {
+
+    protected void run() {
+        Object implementor = new TestMtomImpl();
+        String address = "http://localhost:9036/mime-test";
+        try {
+            Bus bus = BusFactoryHelper.newInstance().getDefaultBus();
+            JaxWsImplementorInfo implInfo = new JaxWsImplementorInfo(implementor.getClass());
+            AbstractServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean(implInfo);
+            serviceFactory.setBus(bus);
+            Service service = serviceFactory.create();
+            QName endpointName = implInfo.getEndpointName();
+            EndpointInfo ei = service.getServiceInfo().getEndpoint(endpointName);
+            service.setInvoker(new JAXWSMethodInvoker(implementor));
+            org.apache.cxf.endpoint.EndpointImpl endpoint = new JaxWsEndpointImpl(bus, service, ei);
+            SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding()); 
+            jaxWsSoapBinding.setMTOMEnabled(true);
+
+            endpoint.getInInterceptors().add(new TestMultipartMessageInterceptor());
+            endpoint.getOutInterceptors().add(new TestAttachmentOutInterceptor());
+            
+            endpoint.getEndpointInfo().setAddress(address);
+            MessageObserver observer = new ChainInitiationObserver(endpoint, bus);
+            ServerImpl server = new ServerImpl(bus, endpoint, observer);
+            server.start();
+        } catch (Exception e) {
+            Thread.currentThread().interrupt();
+        }
+    }
+
+    public static void main(String args[]) {
+        try {
+            Server s = new Server();
+            s.start();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            System.exit(-1);
+        } finally {
+            System.out.println("done!");
+        }
+    }
+}

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/Server.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/Server.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message