Author: ema
Date: Sun May 27 19:59:39 2007
New Revision: 542089

URL: http://svn.apache.org/viewvc?view=rev&rev=542089
Log:
Fixe issue CXF-677
Set the default enableMimeContent value is false

Added:
    incubator/cxf/trunk/testutils/src/main/resources/wsdl/swa-mime-binding.xml
    
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/expected/
    
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/expected/expected_hello_mime
    
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello-mime-binding.xml
    
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello-mime.wsdl
Modified:
    incubator/cxf/trunk/testutils/pom.xml
    
incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
    
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBinding.java
    
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
    
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
    
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
    
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java

Modified: incubator/cxf/trunk/testutils/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/pom.xml?view=diff&rev=542089&r1=542088&r2=542089
==============================================================================
--- incubator/cxf/trunk/testutils/pom.xml (original)
+++ incubator/cxf/trunk/testutils/pom.xml Sun May 27 19:59:39 2007
@@ -180,6 +180,13 @@
                                 </wsdlOption>
                                 <wsdlOption>
                                     
<wsdl>${basedir}/src/main/resources/wsdl/swa-mime.wsdl</wsdl>
+                                    <extraargs>
+                                        <extraarg>-b</extraarg>
+                                        <extraarg>
+                                            
${basedir}/src/main/resources/wsdl/swa-mime-binding.xml
+                                        </extraarg>
+                                    </extraargs>                               
     
+                                    
                                 </wsdlOption>
                                 <wsdlOption>
                                     
<wsdl>${basedir}/src/main/resources/wsdl/hello_world_xml_mixed.wsdl</wsdl>

Added: 
incubator/cxf/trunk/testutils/src/main/resources/wsdl/swa-mime-binding.xml
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/resources/wsdl/swa-mime-binding.xml?view=auto&rev=542089
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/resources/wsdl/swa-mime-binding.xml 
(added)
+++ incubator/cxf/trunk/testutils/src/main/resources/wsdl/swa-mime-binding.xml 
Sun May 27 19:59:39 2007
@@ -0,0 +1,27 @@
+<!--
+  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.
+-->
+<bindings
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
+    wsdlLocation="swa-mime.wsdl"
+    xmlns="http://java.sun.com/xml/ns/jaxws";>
+    <bindings node="wsdl:definitions">
+       <enableMIMEContent>true</enableMIMEContent>
+    </bindings>
+</bindings>
\ No newline at end of file

Modified: 
incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java?view=diff&rev=542089&r1=542088&r2=542089
==============================================================================
--- 
incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
 (original)
+++ 
incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaMethod.java
 Sun May 27 19:59:39 2007
@@ -43,7 +43,7 @@
     private SOAPBinding.Style soapStyle;
     private SOAPBinding.Use soapUse;
     private boolean wrapperStyle;
-    private boolean enableMime = true;
+    private boolean enableMime;
     private JavaInterface javaInterface;
     private final List<JavaParameter> parameters = new 
ArrayList<JavaParameter>();
     private final List<JavaException> exceptions = new 
ArrayList<JavaException>();

Modified: 
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBinding.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBinding.java?view=diff&rev=542089&r1=542088&r2=542089
==============================================================================
--- 
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBinding.java
 (original)
+++ 
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customiztion/JAXWSBinding.java
 Sun May 27 19:59:39 2007
@@ -30,7 +30,7 @@
 
     private boolean enableAsyncMapping;
 
-    private boolean enableMime = true;
+    private boolean enableMime;
 
     private Element element;
     private boolean required;

Modified: 
incubator/cxf/trunk/tools/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/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java?view=diff&rev=542089&r1=542088&r2=542089
==============================================================================
--- 
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
 (original)
+++ 
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/OperationProcessor.java
 Sun May 27 19:59:39 2007
@@ -44,9 +44,9 @@
 import 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.mapper.MethodMapper;
 
 public class OperationProcessor  extends AbstractProcessor {
-   
+
     private JavaParameter wrapperRequest;
-    private JavaParameter wrapperResponse;   
+    private JavaParameter wrapperResponse;
     public OperationProcessor(ToolContext c) {
         super(c);
     }
@@ -54,7 +54,7 @@
     @SuppressWarnings("unchecked")
     public void process(JavaInterface intf, OperationInfo operation) throws 
ToolException {
         JavaMethod method = new MethodMapper().map(operation);
-        method.setInterface(intf);             
+        method.setInterface(intf);
         processMethod(method, operation, null);
         Collection<FaultInfo> faults = operation.getFaults();
         FaultProcessor faultProcessor = new FaultProcessor(context);
@@ -63,7 +63,7 @@
     }
 
     @SuppressWarnings("unchecked")
-    void processMethod(JavaMethod method, OperationInfo operation, 
+    void processMethod(JavaMethod method, OperationInfo operation,
                               JAXWSBinding globalBinding) throws ToolException 
{
         if (isAsynCMethod(method)) {
             return;
@@ -73,7 +73,7 @@
 
         if (inputMessage == null) {
             LOG.log(Level.WARNING, "NO_INPUT_MESSAGE", new Object[] 
{operation.getName()});
-            org.apache.cxf.common.i18n.Message msg 
+            org.apache.cxf.common.i18n.Message msg
                 = new org.apache.cxf.common.i18n.Message("INVALID_MEP", LOG,
                                                                new Object[] 
{operation.getName()});
             throw new ToolException(msg);
@@ -87,7 +87,7 @@
                                operation.getParameterOrdering());
 
         method.annotate(new WebMethodAnnotator());
-        
+
         if (method.isWrapperStyle()) {
             setWrapper(operation);
             method.annotate(new WrapperAnnotator(wrapperRequest, 
wrapperResponse));
@@ -95,7 +95,7 @@
 
         method.annotate(new WebResultAnnotator());
         method.annotate(new SoapBindingAnnotator());
-        
+
         JAXWSBinding opBinding = 
(JAXWSBinding)operation.getExtensor(JAXWSBinding.class);
         
         boolean enableAsync = false;
@@ -126,14 +126,14 @@
         if (operation.getOutput() != null && 
operation.getOutput().getMessageParts() != null) {
             outputPart = 
operation.getOutput().getMessageParts().iterator().next();
         }
-        
+
         if (inputPart != null) {
             wrapperRequest = new JavaParameter();
             wrapperRequest.setName(ProcessorUtil.resolvePartName(inputPart));
             wrapperRequest.setType(ProcessorUtil.getPartType(inputPart));
             
wrapperRequest.setTargetNamespace(ProcessorUtil.resolvePartNamespace(inputPart));
 
-            
wrapperRequest.setClassName(ProcessorUtil.getFullClzName(inputPart, 
+            wrapperRequest.setClassName(ProcessorUtil.getFullClzName(inputPart,
                                                                      context, 
false));
 
         }
@@ -155,7 +155,7 @@
         }
         return false;
     }
-    
+
     private void addAsyncMethod(JavaMethod method) throws ToolException {
         addPollingMethod(method);
         addCallbackMethod(method);
@@ -206,7 +206,7 @@
         callbackMethod.setWrapperStyle(method.isWrapperStyle());
         callbackMethod.setSoapAction(method.getSoapAction());
         callbackMethod.setOperationName(method.getOperationName());
-        
+
         JavaReturn response = new JavaReturn();
         response.setClassName(getAsyncClassName(method, "Response"));
         callbackMethod.setReturn(response);
@@ -239,14 +239,14 @@
         sb.append(">");
         return sb.toString();
     }
-    
+
     private boolean isAddedAsyMethod(JavaMethod method) {
         List<JavaMethod> jmethods = method.getInterface().getMethods();
         for (JavaMethod jm : jmethods) {
-            if 
(!jm.getName().toLowerCase().equals(method.getOperationName().toLowerCase()) 
+            if 
(!jm.getName().toLowerCase().equals(method.getOperationName().toLowerCase())
                 && 
jm.getOperationName().toLowerCase().equals(method.getOperationName().toLowerCase()))
 {
                 return  true;
-                
+
             }
         }
         return false;

Modified: 
incubator/cxf/trunk/tools/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/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java?view=diff&rev=542089&r1=542088&r2=542089
==============================================================================
--- 
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
 (original)
+++ 
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
 Sun May 27 19:59:39 2007
@@ -266,17 +266,17 @@
 
     private void processOperation(JavaModel model, BindingOperationInfo bop, 
BindingInfo binding)
         throws ToolException {
-        
+        boolean enableOpMime = false;
         JAXWSBinding bind = binding.getExtensor(JAXWSBinding.class);
  
-        if (bind != null && !bind.isEnableMime()) {
-            jaxwsBinding.setEnableMime(false);
+        if (bind != null && bind.isEnableMime()) {
+            enableOpMime = true;
         }
         
         JAXWSBinding bopBinding = bop.getExtensor(JAXWSBinding.class);
         
-        if (bopBinding != null && !bopBinding.isEnableMime()) {
-            jaxwsBinding.setEnableMime(false);
+        if (bopBinding != null && bopBinding.isEnableMime()) {
+            enableOpMime = true;
             if (bopBinding.getJaxwsPara() != null) {
                 jaxwsBinding.setJaxwsPara(bopBinding.getJaxwsPara());
             }
@@ -349,10 +349,18 @@
                             jaxwsBinding.setEnableAsyncMapping(false);
                         }
                     }
+                    
+                    if (opBinding.isEnableMime()) {
+                        enableOpMime = true;
+                    }
+                }
+                if (jaxwsBinding.isEnableMime() || enableOpMime) {
+                    jm.setMimeEnable(true);
                 }
-                                
+                
                 if (jm.isWrapperStyle() && headerType > this.noHEADER 
-                    || !jaxwsBinding.isEnableWrapperStyle()) {
+                    || !jaxwsBinding.isEnableWrapperStyle() 
+                    || jm.enableMime() && jm.isWrapperStyle()) {
                     // changed wrapper style
 
                     jm.setWrapperStyle(false);
@@ -537,22 +545,33 @@
                             jp.setClassName(mimeJavaType);
                         }
                     } else if (JavaType.Style.OUT.equals(style)) {
-                        String paramName = 
ProcessorUtil.mangleNameToVariableName(mimeContent.getPart());
-                        JavaType jp = jm.getParameter(paramName);
+                        JavaType jp = null;
+                        if (!"void".equals(jm.getReturn().getType())
+                            && 
mimeContent.getPart().equals(jm.getReturn().getName())) {
+                            jp = jm.getReturn();
+                            jp.setClassName(mimeJavaType);
+                        }
+                            
+                         
+                        
                         if (jp == null) {
-                            //check return
-                            if (paramName.equals(jm.getReturn().getName())) {
-                                jp = jm.getReturn();
+                            for (JavaParameter para : jm.getParameters()) {
+                                if 
(mimeContent.getPart().equals(para.getPartName())) {
+                                    jp = para;
+                                }
+                            }
+                            if (jp != null) {
+                                
((JavaParameter)jp).setHolderClass(mimeJavaType);
                             }
-                        } else {
-                            ((JavaParameter)jp).setHolderClass(mimeJavaType);
+
                         }
+
+
                         if (jp == null) {
                             Message message = new 
Message("MIMEPART_CANNOT_MAP", LOG, mimeContent
                                 .getPart());
                             throw new ToolException(message);
-                        } 
-                        jp.setClassName(mimeJavaType);
+                        }
                     }
                 } else if (extElement instanceof SOAPHeader) {
                     processSoapHeader(jm, operation, extElement);

Modified: 
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java?view=diff&rev=542089&r1=542088&r2=542089
==============================================================================
--- 
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
 (original)
+++ 
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
 Sun May 27 19:59:39 2007
@@ -491,6 +491,23 @@
 
     }
     
+    @Test
+    public void testCXF677() throws Exception {
+        
+       
+        String[] args = new String[] {"-d", output.getCanonicalPath(), 
"-verbose", 
+                                      "-b", 
+                                      
getLocation("/wsdl2java_wsdl/hello-mime-binding.xml"),
+                                      
getLocation("/wsdl2java_wsdl/hello-mime.wsdl")};
+
+        WSDLToJava.main(args); 
+        
assertFileEquals(getClass().getResource("expected/expected_hello_mime").getFile(),
 
+                         output.getCanonicalPath() + 
"/org/apache/hello_world_mime/Hello.java");
+
+
+
+    }
+    
     
     
 

Modified: 
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java?view=diff&rev=542089&r1=542088&r2=542089
==============================================================================
--- 
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
 (original)
+++ 
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
 Sun May 27 19:59:39 2007
@@ -756,6 +756,7 @@
     public void testSWAMime() throws Exception {
 
         env.put(ToolConstants.CFG_WSDLURL, 
getLocation("/wsdl2java_wsdl/swa-mime.wsdl"));
+        env.put(ToolConstants.CFG_BINDING, 
getLocation("/wsdl2java_wsdl/swa-mime-binding.xml"));
         processor.setContext(env);
         processor.execute();
         Class clz = 
classLoader.loadClass("org.apache.cxf.swa.SwAServiceInterface");

Added: 
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/expected/expected_hello_mime
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/expected/expected_hello_mime?view=auto&rev=542089
==============================================================================
--- 
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/expected/expected_hello_mime
 (added)
+++ 
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/expected/expected_hello_mime
 Sun May 27 19:59:39 2007
@@ -0,0 +1,63 @@
+/**
+ * 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.hello_world_mime;
+
+import javax.jws.WebParam.Mode;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding.Style;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.WebMethod;
+import javax.jws.WebResult;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+
+
[EMAIL PROTECTED](targetNamespace = "http://apache.org/hello_world_mime";, name 
= "Hello")
[EMAIL PROTECTED](parameterStyle = SOAPBinding.ParameterStyle.BARE)
+
+public interface Hello {
+
+    @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+    @WebResult(targetNamespace = "http://apache.org/hello_world_mime/types";, 
partName = "mime", name = "addressRes")
+    @WebMethod
+    public javax.xml.transform.Source address(
+        @WebParam(targetNamespace = 
"http://apache.org/hello_world_mime/types";, partName = "mime", name = "address")
+        org.apache.cxf.mime.Address mime
+    );
+
+    @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+    @WebMethod
+    public void helloMime(
+        @WebParam(targetNamespace = 
"http://apache.org/hello_world_mime/types";, partName = "body", name = "body")
+        java.lang.String body,
+        @WebParam(mode = Mode.INOUT, partName = "mime", name = "mime")
+        javax.xml.ws.Holder<java.awt.Image> mime
+    );
+
+    @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+    @WebMethod
+    public void hello(
+        @WebParam(targetNamespace = 
"http://apache.org/hello_world_mime/types";, partName = "body", name = "body")
+        java.lang.String body,
+        @WebParam(mode = Mode.INOUT, partName = "mime", name = "mime")
+        javax.xml.ws.Holder<byte[]> mime
+    );
+}

Added: 
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello-mime-binding.xml
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello-mime-binding.xml?view=auto&rev=542089
==============================================================================
--- 
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello-mime-binding.xml
 (added)
+++ 
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello-mime-binding.xml
 Sun May 27 19:59:39 2007
@@ -0,0 +1,40 @@
+<?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.
+-->
+
+<bindings wsdlLocation="hello-mime.wsdl"
+    xmlns="http://java.sun.com/xml/ns/jaxws";
+    xmlns:xs="http://www.w3.org/2001/XMLSchema";
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
+
+    <bindings node="wsdl:definitions/wsdl:types/xs:[EMAIL 
PROTECTED]'http://apache.org/hello_world_mime/types']">
+        <ns:schemaBindings xmlns:ns="http://java.sun.com/xml/ns/jaxb";>
+            <ns:package name="org.apache.cxf.mime"/>
+        </ns:schemaBindings>
+    </bindings>
+
+    <bindings node="wsdl:definitions/wsdl:[EMAIL 
PROTECTED]'HelloBinding']/wsdl:[EMAIL PROTECTED]'helloMime']">
+        <enableMIMEContent>true</enableMIMEContent>
+    </bindings>
+
+    <bindings node="wsdl:definitions/wsdl:[EMAIL 
PROTECTED]'HelloBinding']/wsdl:[EMAIL PROTECTED]'address']">
+        <enableMIMEContent>true</enableMIMEContent>
+    </bindings>
+</bindings>
+

Added: 
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello-mime.wsdl
URL: 
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello-mime.wsdl?view=auto&rev=542089
==============================================================================
--- 
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello-mime.wsdl
 (added)
+++ 
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello-mime.wsdl
 Sun May 27 19:59:39 2007
@@ -0,0 +1,178 @@
+<?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/hello_world_mime";
+       xmlns:x1="http://apache.org/hello_world_mime/types";
+       xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
+       xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+       xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
+       targetNamespace="http://apache.org/hello_world_mime";
+       name="HelloMime">
+       <wsdl:types>
+               <schema xmlns="http://www.w3.org/2001/XMLSchema";
+                       
targetNamespace="http://apache.org/hello_world_mime/types";>
+
+                       <element name="address">
+                               <complexType>
+                                       <sequence>
+                                               <element name="postcode" 
type="string" />
+                                               <element name="address" 
type="string" />
+                                       </sequence>
+                               </complexType>
+                       </element>
+                       <element name="addressRes">
+                               <complexType>
+                                       <sequence>
+                                               <element name="postcode" 
type="string" />
+                                               <element name="address" 
type="string" />
+                                       </sequence>
+                               </complexType>
+                       </element>
+                       <element name="body" type="string" />
+               </schema>
+
+       </wsdl:types>
+
+       <wsdl:message name="helloIn">
+               <wsdl:part name="body" element="x1:body" />
+               <wsdl:part name="mime" type="xsd:base64Binary" />
+       </wsdl:message>
+
+       <wsdl:message name="helloOut">
+               <wsdl:part name="mime" type="xsd:base64Binary" />
+       </wsdl:message>
+
+       <wsdl:message name="helloMimeIn">
+               <wsdl:part name="body" element="x1:body" />
+               <wsdl:part name="mime" type="xsd:base64Binary" />
+       </wsdl:message>
+
+       <wsdl:message name="helloMimeOut">
+               <wsdl:part name="mime" type="xsd:base64Binary" />
+       </wsdl:message>
+
+       <wsdl:message name="addressIn">
+               <wsdl:part name="mime" element="x1:address" />
+       </wsdl:message>
+
+       <wsdl:message name="addressOut">
+               <wsdl:part name="mime" element="x1:addressRes" />
+       </wsdl:message>
+
+       <wsdl:portType name="Hello">
+               <wsdl:operation name="hello">
+                       <wsdl:input message="tns:helloIn" />
+                       <wsdl:output message="tns:helloOut" />
+               </wsdl:operation>
+
+
+               <wsdl:operation name="helloMime">
+                       <wsdl:input message="tns:helloMimeIn" />
+                       <wsdl:output message="tns:helloMimeOut" />
+               </wsdl:operation>
+
+               <wsdl:operation name="address">
+                       <wsdl:input message="tns:addressIn" />
+                       <wsdl:output message="tns:addressOut" />
+               </wsdl:operation>
+
+
+       </wsdl:portType>
+
+       <wsdl:binding name="HelloBinding" type="tns:Hello">
+               <soap:binding style="document"
+                       transport="http://schemas.xmlsoap.org/soap/http"; />
+
+               <wsdl:operation name="hello">
+                       <soap:operation soapAction="" />
+                       <wsdl:input>
+                               <mime:multipartRelated>
+                                       <mime:part>
+                                               <soap:body parts="body" 
use="literal" />
+                                       </mime:part>
+                                       <mime:part>
+                                               <mime:content part="mime" 
type="image/jpeg" />
+                                       </mime:part>
+                               </mime:multipartRelated>
+                       </wsdl:input>
+                       <wsdl:output>
+                               <mime:multipartRelated>
+                                       <mime:part>
+                                               <soap:body parts="" 
use="literal" />
+                                       </mime:part>
+                                       <mime:part>
+                                               <mime:content part="mime" 
type="image/jpeg" />
+                                       </mime:part>
+                               </mime:multipartRelated>
+                       </wsdl:output>
+               </wsdl:operation>
+
+               <wsdl:operation name="helloMime">
+                       <soap:operation soapAction="" />
+                       <wsdl:input>
+                               <mime:multipartRelated>
+                                       <mime:part>
+                                               <soap:body parts="body" 
use="literal" />
+                                       </mime:part>
+                                       <mime:part>
+                                               <mime:content part="mime" 
type="image/jpeg" />
+                                       </mime:part>
+                               </mime:multipartRelated>
+                       </wsdl:input>
+                       <wsdl:output>
+                               <mime:multipartRelated>
+                                       <mime:part>
+                                               <soap:body parts="" 
use="literal" />
+                                       </mime:part>
+                                       <mime:part>
+                                               <mime:content part="mime" 
type="image/jpeg" />
+                                       </mime:part>
+                               </mime:multipartRelated>
+                       </wsdl:output>
+               </wsdl:operation>
+
+               <wsdl:operation name="address">
+                       <soap:operation soapAction="" />
+                       <wsdl:input>
+                               <soap:body use="literal" />
+                       </wsdl:input>
+                       <wsdl:output>
+                               <mime:multipartRelated>
+                                       <mime:part>
+                                               <soap:body parts="" 
use="literal" />
+                                       </mime:part>
+                                       <mime:part>
+                                               <mime:content part="mime" 
type="text/xml" />
+                                       </mime:part>
+                               </mime:multipartRelated>
+                       </wsdl:output>
+               </wsdl:operation>
+
+
+       </wsdl:binding>
+
+       <wsdl:service name="HelloService">
+               <wsdl:port name="soapPort" binding="tns:HelloBinding">
+                       <soap:address location="http://localhost:8080/mime"; />
+               </wsdl:port>
+       </wsdl:service>
+
+</wsdl:definitions>
\ No newline at end of file


Reply via email to