cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r514594 - in /incubator/cxf/trunk/tools2: common/src/main/java/org/apache/cxf/tools/common/model/ javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/ wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/...
Date Mon, 05 Mar 2007 07:52:45 GMT
Author: ema
Date: Sun Mar  4 23:52:44 2007
New Revision: 514594

URL: http://svn.apache.org/viewvc?view=rev&rev=514594
Log:
Fixed issue CXF-413
Added MimeProcessor and enable tools2 to generate mime binding 

Added:
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/MIMEProcessor.java
  (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/soapheader_rpc.wsdl
  (with props)
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/swa-mime.wsdl
  (with props)
Modified:
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/TypesGenerator.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java
    incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java

Modified: incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java?view=diff&rev=514594&r1=514593&r2=514594
==============================================================================
--- incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
(original)
+++ incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
Sun Mar  4 23:52:44 2007
@@ -45,6 +45,7 @@
     private WSDLParameter requestParameter;
     private WSDLParameter responseParameter;
     private boolean wrapperStyle;
+    private boolean enableMime = true;
     private JavaInterface javaInterface;
     private final List<JavaParameter> parameters = new ArrayList<JavaParameter>();
     private final List<JavaException> exceptions = new ArrayList<JavaException>();
@@ -193,6 +194,15 @@
 
     public void setWrapperStyle(boolean w) {
         this.wrapperStyle = w;
+    }
+    
+    
+    public boolean enableMime() {
+        return this.enableMime;
+    }
+    
+    public void setMimeEnable(boolean arg) {
+        enableMime = arg;
     }
 
     public void setSoapStyle(SOAPBinding.Style sty) {

Modified: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/TypesGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/TypesGenerator.java?view=diff&rev=514594&r1=514593&r2=514594
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/TypesGenerator.java
(original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/generator/jaxws/TypesGenerator.java
Sun Mar  4 23:52:44 2007
@@ -115,7 +115,9 @@
         definition.addNamespace(WSDLConstants.TNS_PREFIX, wmodel.getTargetNameSpace());
         int i = 0;
         for (String s : wmodel.getJaxbContext().getKnownNamespaceURIs()) {
-            definition.addNamespace("ns" + (++i), s);
+            if (!"".equals(s)) {
+                definition.addNamespace("ns" + (++i), s);
+            }
         }
 
     }

Added: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/MIMEProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/MIMEProcessor.java?view=auto&rev=514594
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/MIMEProcessor.java
(added)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/MIMEProcessor.java
Sun Mar  4 23:52:44 2007
@@ -0,0 +1,107 @@
+/**
+ * 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.tools.wsdlto.frontend.jaxws.processor.internal;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.mime.MIMEContent;
+import javax.wsdl.extensions.mime.MIMEMultipartRelated;
+import javax.wsdl.extensions.mime.MIMEPart;
+
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.tools.common.ToolContext;
+import org.apache.cxf.tools.common.ToolException;
+import org.apache.cxf.tools.common.model.JavaMethod;
+import org.apache.cxf.tools.common.model.JavaParameter;
+import org.apache.cxf.tools.common.model.JavaType;
+
+
+
+public class MIMEProcessor extends AbstractProcessor {
+
+    public MIMEProcessor(ToolContext penv) {
+        super(penv);
+    }
+
+    private static String getJavaTypeForMimeType(MIMEPart mPart) {
+        if (mPart.getExtensibilityElements().size() > 1) {
+            return "javax.activation.DataHandler";
+        } else {
+            ExtensibilityElement extElement = (ExtensibilityElement)mPart.getExtensibilityElements().get(0);
+            if (extElement instanceof MIMEContent) {
+                MIMEContent mimeContent = (MIMEContent)extElement;
+                if ("image/jpeg".equals(mimeContent.getType()) || "image/gif".equals(mimeContent.getType()))
{
+                    return "java.awt.Image";
+                } else if ("text/xml".equals(mimeContent.getType())
+                           || "application/xml".equals(mimeContent.getType())) {
+                    return "javax.xml.transform.Source";
+                }  else {
+                    return "javax.activation.DataHandler";
+                }
+            }
+        }
+        return "javax.activation.DataHandler";
+    }
+
+    public void process(JavaMethod jm, MIMEMultipartRelated ext, JavaType.Style style) throws
ToolException {
+        List mimeParts = ext.getMIMEParts();
+        Iterator itParts = mimeParts.iterator();
+        while (itParts.hasNext()) {
+            MIMEPart mPart = (MIMEPart)itParts.next();
+            Iterator extns = mPart.getExtensibilityElements().iterator();
+            while (extns.hasNext()) {
+                ExtensibilityElement extElement = (ExtensibilityElement)extns.next();
+                if (extElement instanceof MIMEContent) {
+                    MIMEContent mimeContent = (MIMEContent)extElement;
+                    String mimeJavaType = getJavaTypeForMimeType(mPart);
+                    if (JavaType.Style.IN.equals(style)) {
+                        String paramName = ProcessorUtil.mangleNameToVariableName(mimeContent.getPart());
+                        JavaParameter jp = jm.getParameter(paramName);
+                        if (jp == null) {
+                            Message message = new Message("MIMEPART_CANNOT_MAP", LOG, mimeContent.getPart());
+                            throw new ToolException(message);
+                        }
+                        if (!jp.getClassName().equals(mimeJavaType)) {
+                            // jp.setType(mimeJavaType);
+                            jp.setClassName(mimeJavaType);
+                        }
+                    } else if (JavaType.Style.OUT.equals(style)) {
+                        if (jm.getReturn().getClassName().equals("void")) {
+                            // this is actually an in/out param...
+                            String paramName = ProcessorUtil.mangleNameToVariableName(mimeContent.getPart());
+                            JavaParameter jp = jm.getParameter(paramName);
+                            if (jp == null) {
+                                Message message = new Message("MIMEPART_CANNOT_MAP", LOG,
mimeContent
+                                    .getPart());
+                                throw new ToolException(message);
+                            } 
+                            jp.setClassName(mimeJavaType);
+                            jp.setHolderClass(mimeJavaType);
+                        } else if (!jm.getReturn().getClassName().equals(mimeJavaType)) {
+                            // jm.getReturn().setType(mimeJavaType);
+                            jm.getReturn().setClassName(mimeJavaType);
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/MIMEProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/MIMEProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java?view=diff&rev=514594&r1=514593&r2=514594
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
(original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
Sun Mar  4 23:52:44 2007
@@ -110,6 +110,12 @@
             addAsyncMethod(method);
         }
         
+        if (globalBinding != null && globalBinding.isEnableMime() 
+            || opBinding != null && opBinding.isEnableMime()) {
+            method.setMimeEnable(true);
+        }
+        
+        
        
     }
 

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java?view=diff&rev=514594&r1=514593&r2=514594
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
(original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
Sun Mar  4 23:52:44 2007
@@ -27,6 +27,7 @@
 
 import javax.wsdl.extensions.ExtensibilityElement;
 import javax.wsdl.extensions.http.HTTPBinding;
+import javax.wsdl.extensions.mime.MIMEMultipartRelated;
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.service.model.BindingInfo;
@@ -56,6 +57,7 @@
 import org.apache.cxf.tools.util.ClassCollector;
 import org.apache.cxf.tools.util.NameUtil;
 import org.apache.cxf.tools.util.SOAPBindingUtil;
+
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.customiztion.JAXWSBinding;
 
 public class ServiceProcessor extends AbstractProcessor {
@@ -218,7 +220,7 @@
         
         JAXWSBinding bopBinding = bop.getExtensor(JAXWSBinding.class);
         
-        if (bopBinding != null && bopBinding.isEnableMime()) {
+        if (bopBinding != null && !bopBinding.isEnableMime()) {
             jaxwsBinding.setEnableMime(false);
             if (bopBinding.getJaxwsPara() != null) {
                 jaxwsBinding.setJaxwsPara(bopBinding.getJaxwsPara());
@@ -315,6 +317,8 @@
     private void setParameterAsHeader(JavaParameter parameter) {
         parameter.setHeader(true);
         parameter.getAnnotation().addArgument("header", "true", "");
+        parameter.getAnnotation().addArgument("name", parameter.getQName().getLocalPart());
+        parameter.getAnnotation().addArgument("targetNamespace", parameter.getTargetNamespace());
     }
 
     private void processParameter(JavaMethod jm, BindingOperationInfo operation) throws ToolException
{
@@ -365,8 +369,12 @@
                     setParameterAsHeader(jp);
                 }
             }
+            if (ext instanceof MIMEMultipartRelated && jm.enableMime()) {
+                MIMEProcessor mimeProcessor = new MIMEProcessor(context);
+                mimeProcessor.process(jm, (MIMEMultipartRelated)ext, JavaType.Style.IN);
+            }            
         }
-
+        
         // process output
         if (operation.getOutput() != null) {
             List<ExtensibilityElement> outbindings =
@@ -400,7 +408,11 @@
                         setParameterAsHeader(jp);
                     }
                 }
-            }
+                if (ext instanceof MIMEMultipartRelated && jm.enableMime()) {
+                    MIMEProcessor mimeProcessor = new MIMEProcessor(context);
+                    mimeProcessor.process(jm, (MIMEMultipartRelated)ext, JavaType.Style.OUT);
+                }
+            }           
         }
 
         jm.setSoapUse(SOAPBindingUtil.getSoapUse(use));

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java?view=diff&rev=514594&r1=514593&r2=514594
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java
(original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WebParamAnnotator.java
Sun Mar  4 23:52:44 2007
@@ -29,7 +29,6 @@
 import org.apache.cxf.tools.common.model.JavaType;
 
 public class WebParamAnnotator implements Annotator {
-
     public void annotate(JavaAnnotatable ja) {
         JavaParameter parameter = null;
         if (ja instanceof JavaParameter) {
@@ -43,7 +42,8 @@
         String targetNamespace = method.getInterface().getNamespace();
         String partName = null;
 
-        if (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT) {
+        if (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT
+            || parameter.isHeader()) {
             targetNamespace = parameter.getTargetNamespace();
             if (parameter.getQName() != null) {
                 name = parameter.getQName().getLocalPart();
@@ -65,7 +65,7 @@
             webParamAnnotation.addArgument("mode", "Mode." + parameter.getStyle().toString(),
"");
         }
         webParamAnnotation.addArgument("name", name);
-        if (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT) {
+        if (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT || parameter.isHeader())
{
             webParamAnnotation.addArgument("targetNamespace", targetNamespace);
         }
 

Modified: incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java?view=diff&rev=514594&r1=514593&r2=514594
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
(original)
+++ incubator/cxf/trunk/tools2/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
Sun Mar  4 23:52:44 2007
@@ -19,8 +19,11 @@
 package org.apache.cxf.tools.wsdlto.jaxws;
 
 import java.io.File;
+import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
 
 import javax.jws.HandlerChain;
 import javax.jws.Oneway;
@@ -64,70 +67,7 @@
         env = null;
     }
     
-/*   
-    public void testRPCLit1() throws Exception {
-        env.put(ToolConstants.CFG_WSDLURL, getLocation("/type_test/type_test_rpclit_soap.wsdl"));
-        processor.setContext(env);
-        processor.execute();      
-
-    }
-    
-    
-    
-   
-    public void testLocator() throws Exception {
-        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world_xml_bare.wsdl"));
-        env.put(ToolConstants.CFG_VERBOSE, ToolConstants.CFG_VERBOSE);
-        processor.setContext(env);
-        processor.execute();      
-
-    }
-    
-   
-    public void testLocator2() throws Exception {
-        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/basic_callback_test.wsdl"));
-        env.put(ToolConstants.CFG_VERBOSE, ToolConstants.CFG_VERBOSE);
-        env.put(ToolConstants.CFG_SERVICENAME, "SOAPService");
-        processor.setContext(env);
-        processor.execute();      
-
-    }
-    
-    public void testLocator3() throws Exception {
-        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/basic_callback_test.wsdl"));
-        env.put(ToolConstants.CFG_VERBOSE, ToolConstants.CFG_VERBOSE);
-        env.put(ToolConstants.CFG_SERVICENAME, "CallbackService");
-        processor.setContext(env);
-        processor.execute();      
-
-    }
-    
-
-    
-    
- 
-    public void testLocator_4() throws Exception {
-        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world_multi_service.wsdl"));
-        env.put(ToolConstants.CFG_VERBOSE, ToolConstants.CFG_VERBOSE);
-        env.put(ToolConstants.CFG_SERVICENAME, "SOAPProviderService");
-        
-        
-        processor.setContext(env);
-        processor.execute();      
 
-    }
-
-    public void testLocator_3() throws Exception {
-        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/ordered_param_holder.wsdl"));
-        env.put(ToolConstants.CFG_VERBOSE, ToolConstants.CFG_VERBOSE);
-        processor.setContext(env);
-        processor.execute();      
-
-    }
-
-    */
-    
-    
     public void testRPCLit() throws Exception {
 
         env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world_rpc_lit.wsdl"));
@@ -762,6 +702,60 @@
         processor.execute();
         Class clz = classLoader.loadClass("org.apache.hello_world_soap_http.types.ActionType");
         assertNotNull("Enum class could not be found", clz);
+    }
+    
+    public void testSWAMime() throws Exception {
+
+        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/swa-mime.wsdl"));
+        processor.setContext(env);
+        processor.execute();
+        Class clz = classLoader.loadClass("org.apache.cxf.swa.SwAServiceInterface");
+
+        Method method1 = clz.getMethod("echoData", new Class[] {javax.xml.ws.Holder.class,
+                                                                javax.xml.ws.Holder.class});
+
+        assertNotNull("method echoData can not be found", method1);
+
+        Type[] types = method1.getGenericParameterTypes();
+        ParameterizedType paraType = (ParameterizedType)types[1];
+        Class typeClass = (Class)paraType.getActualTypeArguments()[0];
+        assertEquals("javax.activation.DataHandler", typeClass.getName());
+    }
+
+    public void testRPCHeader() throws Exception {
+        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/soapheader_rpc.wsdl"));
+        processor.setContext(env);
+        processor.execute();
+        Class cls = classLoader.loadClass("org.apache.header_test.rpc.TestRPCHeader");
+
+        Method meths[] = cls.getMethods();
+        for (Method m : meths) {
+            if ("testHeader1".equals(m.getName())) {
+                Annotation annotations[][] = m.getParameterAnnotations();
+                assertEquals(2, annotations.length);
+                assertEquals(1, annotations[1].length);
+                assertTrue(annotations[1][0] instanceof WebParam);
+                WebParam parm = (WebParam)annotations[1][0];
+                assertEquals("http://apache.org/header_test/rpc/types", parm.targetNamespace());
+                assertEquals("inHeader", parm.partName());
+                assertEquals("headerMessage", parm.name());
+                assertTrue(parm.header());
+            }
+        }
+
+        for (Method m : meths) {
+            if ("testInOutHeader".equals(m.getName())) {
+                Annotation annotations[][] = m.getParameterAnnotations();
+                assertEquals(2, annotations.length);
+                assertEquals(1, annotations[1].length);
+                assertTrue(annotations[1][0] instanceof WebParam);
+                WebParam parm = (WebParam)annotations[1][0];
+                assertEquals("http://apache.org/header_test/rpc/types", parm.targetNamespace());
+                assertEquals("inOutHeader", parm.partName());
+                assertEquals("headerMessage", parm.name());
+                assertTrue(parm.header());
+            }
+        }
     }
 
     private String getLocation(String wsdlFile) {

Added: incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/soapheader_rpc.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/soapheader_rpc.wsdl?view=auto&rev=514594
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/soapheader_rpc.wsdl
(added)
+++ incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/soapheader_rpc.wsdl
Sun Mar  4 23:52:44 2007
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://apache.org/header_test/rpc" xmlns:x1="http://apache.org/header_test/rpc/types"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://apache.org/header_test/rpc" name="TestHeaderWSDL">
+    <wsdl:types>
+        <schema targetNamespace="http://apache.org/header_test/rpc/types" xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:x1="http://apache.org/header_test/rpc/types" elementFormDefault="qualified">
+            <element name="headerMessage">
+                <complexType>
+		    <sequence>
+                        <element name="headerVal" type="string"/>
+		    </sequence>
+		</complexType>
+            </element>
+        </schema>
+    </wsdl:types>
+    <wsdl:message name="testHeader1Request">
+        <wsdl:part name="in" type="xsd:string"/>
+        <wsdl:part name="inHeader" element="x1:headerMessage"/>
+    </wsdl:message>
+    <wsdl:message name="testHeader1Response">
+        <wsdl:part name="out" type="xsd:string"/>
+    </wsdl:message>
+
+    <wsdl:message name="testInOutHeaderRequest">
+        <wsdl:part name="in" type="xsd:string"/>
+        <wsdl:part name="inOutHeader" element="x1:headerMessage"/>
+    </wsdl:message>
+    <wsdl:message name="testInOutHeaderResponse">
+        <wsdl:part name="out" type="xsd:string"/>
+        <wsdl:part name="inOutHeader" element="x1:headerMessage"/>
+    </wsdl:message>
+
+    <wsdl:portType name="TestRPCHeader">
+        <wsdl:operation name="testHeader1">
+            <wsdl:input name="testHeader1Request" message="tns:testHeader1Request"/>
+            <wsdl:output name="testHeader1Response" message="tns:testHeader1Response"/>
+        </wsdl:operation>
+        <wsdl:operation name="testInOutHeader">
+            <wsdl:input name="testInOutHeaderRequest" message="tns:testInOutHeaderRequest"/>
+            <wsdl:output name="testInOutHeaderResponse" message="tns:testInOutHeaderResponse"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="TestHeader_SOAPRPCBinding" type="tns:TestRPCHeader">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="testHeader1">
+            <soap:operation/>
+            <wsdl:input name="testHeader1Request">
+                <soap:body message="tns:testHeader1Request" parts="in" use="literal" namespace="http://apache.org/header_test"/>
+                <soap:header message="tns:testHeader1Request" part="inHeader" use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="testHeader1Response">
+                <soap:body message="tns:testHeader1Response" use="literal" namespace="http://apache.org/header_test"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="testInOutHeader">
+            <soap:operation/>
+            <wsdl:input>
+                <soap:body message="tns:testInOutHeaderRequest" parts="in" use="literal"
namespace="http://apache.org/header_test"/>
+                <soap:header message="tns:testInOutHeaderRequest" part="inOutHeader" use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body message="tns:testInOutHeaderResponse" parts="out" use="literal"
namespace="http://apache.org/header_test"/>
+                <soap:header message="tns:testInOutHeaderRequest" part="inOutHeader" use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="SOAPRPCHeaderService">
+        <wsdl:port name="SoapRPCHeaderPort" binding="tns:TestHeader_SOAPRPCBinding">
+            <soap:address location="http://localhost:9104/SoapHeaderRPCContext/SoapHeaderRPCPort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Propchange: incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/soapheader_rpc.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/soapheader_rpc.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/soapheader_rpc.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/swa-mime.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/swa-mime.wsdl?view=auto&rev=514594
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/swa-mime.wsdl
(added)
+++ incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/swa-mime.wsdl
Sun Mar  4 23:52:44 2007
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  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.
+-->
+<wsdl:definitions name="SwAService" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+  xmlns:tns="http://cxf.apache.org/swa" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+  xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd" xmlns:types="http://cxf.apache.org/swa/types"
+  xmlns:xmime="http://www.w3.org/2005/05/xmlmime" targetNamespace="http://cxf.apache.org/swa"
+  xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
+
+  <wsdl:types>
+    <xsd:schema xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
+      targetNamespace="http://cxf.apache.org/swa/types">
+      <xsd:import namespace="http://ws-i.org/profiles/basic/1.1/xsd"/>
+      <xsd:element name="DataStruct">
+        <xsd:complexType>
+          <xsd:sequence>
+            <xsd:element name="DataRef" type="wsi:swaRef"
+        xmime:expectedContentTypes="application/octet-stream" />
+          </xsd:sequence>
+        </xsd:complexType>
+      </xsd:element>
+      
+    </xsd:schema>
+
+    <xsd:schema targetNamespace="http://ws-i.org/profiles/basic/1.1/xsd"
+      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+      <xsd:simpleType name="swaRef">
+        <xsd:restriction base="xsd:anyURI" />
+      </xsd:simpleType>
+    </xsd:schema>
+  </wsdl:types>
+
+  <wsdl:message name="echoDataRequest">
+    <wsdl:part name="text" element="types:DataStruct" />
+    <wsdl:part name="data" type="xsd:base64Binary"/>
+  </wsdl:message>
+
+  <wsdl:message name="echoDataResponse">
+    <wsdl:part name="text" type="types:DataStruct" />
+    <wsdl:part name="data" element="xsd:base64Binary" />
+  </wsdl:message>
+
+  <wsdl:portType name="SwAServiceInterface">
+
+    <wsdl:operation name="echoData">
+      <wsdl:input message="tns:echoDataRequest" />
+      <wsdl:output message="tns:echoDataResponse" />
+    </wsdl:operation>
+
+  </wsdl:portType>
+
+  <wsdl:binding name="SwAServiceBinding" type="tns:SwAServiceInterface">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+
+    <wsdl:operation name="echoData">
+      <soap:operation soapAction="" style="literal" />
+      <wsdl:input>
+        <mime:multipartRelated>
+          <mime:part name="body">
+            <soap:body parts="text" use="literal" />
+          </mime:part>
+          <mime:part name="data">
+            <mime:content part="data" type="application/octet-stream" />
+          </mime:part>
+        </mime:multipartRelated>
+      </wsdl:input>
+      <wsdl:output>
+        <mime:multipartRelated>
+          <mime:part name="body">
+            <soap:body parts="text" use="literal" />
+          </mime:part>
+          <mime:part name="data">
+            <mime:content part="data" type="application/octet-stream" />
+          </mime:part>
+        </mime:multipartRelated>
+      </wsdl:output>
+    </wsdl:operation>
+
+  </wsdl:binding>
+
+  <wsdl:service name="SwAService">
+    <wsdl:port name="SwAServiceHttpPort" binding="tns:SwAServiceBinding">
+      <soap:address location="http://localhost:9036/swa" />
+    </wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>

Propchange: incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/swa-mime.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/swa-mime.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools2/wsdlto/test/src/test/resources/wsdl2java_wsdl/swa-mime.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message