cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r595208 - in /incubator/cxf/trunk/tools/wsdlto: frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator...
Date Thu, 15 Nov 2007 05:21:45 GMT
Author: ema
Date: Wed Nov 14 21:21:35 2007
New Revision: 595208

URL: http://svn.apache.org/viewvc?rev=595208&view=rev
Log:
[CXF-1209]Fix NPE issue in WSActionAnnotator

Added:
    incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1209/
    incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1209/hello_world_fault.wsdl
Modified:
    incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java
    incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WSActionAnnotator.java
    incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java

Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.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/FaultProcessor.java?rev=595208&r1=595207&r2=595208&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/FaultProcessor.java
Wed Nov 14 21:21:35 2007
@@ -94,7 +94,8 @@
         collector.addExceptionClassName(packageName, name, fullClassName);
 
         boolean samePackage = method.getInterface().getPackageName().equals(packageName);
-        method.addException(new JavaException(name, samePackage ? name : fullClassName, namespace));
+        method.addException(new JavaException(faultMessage.getName().getLocalPart(), 
+                                              samePackage ? name : fullClassName, namespace));
 
         List<MessagePartInfo> faultParts = faultMessage.getMessageParts();
 

Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WSActionAnnotator.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/annotator/WSActionAnnotator.java?rev=595208&r1=595207&r2=595208&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WSActionAnnotator.java
(original)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WSActionAnnotator.java
Wed Nov 14 21:21:35 2007
@@ -110,7 +110,7 @@
 
     private JavaException getExceptionClass(JavaMethod method, FaultInfo faultInfo) {
         for (JavaException exception : method.getExceptions()) {
-            QName faultName = faultInfo.getFaultName();
+            QName faultName = faultInfo.getName();
             if (exception.getTargetNamespace().equals(faultName.getNamespaceURI()) 
                 && exception.getName().toLowerCase().startsWith(faultName.getLocalPart().toLowerCase()))
{
                 return exception;

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?rev=595208&r1=595207&r2=595208&view=diff
==============================================================================
--- 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
Wed Nov 14 21:21:35 2007
@@ -890,5 +890,13 @@
         assertNotNull("Customized SEI class is not found", clz);
         Method customizedMethod = clz.getMethod("myGreetMe", new Class[] {String.class});
         assertNotNull("Customized method 'myGreetMe' in MyGreeter.class is not found", customizedMethod);
-    }  
+    }
+    
+    @Test
+    public void testWSAActionAnno() throws Exception {
+        env.put(ToolConstants.CFG_WSDLURL, 
+                getLocation("/wsdl2java_wsdl/cxf1209/hello_world_fault.wsdl"));        
+        processor.setContext(env);
+        processor.execute();
+    }    
 }

Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1209/hello_world_fault.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1209/hello_world_fault.wsdl?rev=595208&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1209/hello_world_fault.wsdl
(added)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1209/hello_world_fault.wsdl
Wed Nov 14 21:21:35 2007
@@ -0,0 +1,92 @@
+<?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_soap_http"
+    xmlns:x1="http://apache.org/hello_world_soap_http/types"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:wswa="http://www.w3.org/2006/05/addressing/wsdl"
+    targetNamespace="http://apache.org/hello_world_soap_http" name="HelloWorldFault">
+    <wsdl:types>
+        <schema targetNamespace="http://apache.org/hello_world_soap_http/types" xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:x1="http://apache.org/hello_world_soap_http/types" elementFormDefault="qualified">
+            <element name="BareDocument" type="string"/>
+            <element name="BareDocumentResponse">
+                <complexType>
+                    <sequence>
+                        <element name="company" type="string"/>
+                    </sequence>
+                    <attribute name="id" type="int"/>
+                </complexType>
+            </element> 
+
+            <element name="BadRecordLit" type="string"/>
+            <complexType name="BadRecord">
+                <sequence>
+                    <element name="reason" type="string"/>
+                    <element name="code" type="short"/>
+                </sequence>
+            </complexType>      
+        </schema>
+    </wsdl:types>
+
+    <wsdl:message name="Bad_RecordLit_Fault">
+        <wsdl:part name="BadRecordLit" element="x1:BadRecordLit"/>
+    </wsdl:message>
+    <wsdl:message name="testDocLitBareRequest">
+        <wsdl:part name="in" element="x1:BareDocument"/>
+    </wsdl:message>
+    <wsdl:message name="testDocLitBareResponse">
+        <wsdl:part name="out" element="x1:BareDocumentResponse"/>
+    </wsdl:message> 
+    
+    <wsdl:portType name="Greeter">
+        <wsdl:operation name="testDocLitFault">
+            <wsdl:input message="tns:testDocLitBareRequest" wswa:Action="http://apache.org/hello_world_soap_http/Fault"/>
+            <wsdl:output message="tns:testDocLitBareResponse" wswa:Action="http://apache.org/hello_world_soap_http/Fault"/>
+            <wsdl:fault name="myfault" message="tns:Bad_RecordLit_Fault" wswa:Action="http://apache.org/hello_world_soap_http/Fault"/>
+        </wsdl:operation>       
+    </wsdl:portType>
+    
+    <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+        <wsdl:operation name="testDocLitFault">
+            <soap:operation style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="myfault">
+                <soap:fault name="myfault" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+
+    </wsdl:binding>
+    <wsdl:service name="SOAPService">
+        <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+            <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+            <wswa:UsingAddressing/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
+



Mime
View raw message