cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r790638 - /cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
Date Thu, 02 Jul 2009 16:19:11 GMT
Author: dkulp
Date: Thu Jul  2 16:19:11 2009
New Revision: 790638

URL: http://svn.apache.org/viewvc?rev=790638&view=rev
Log:
[CXF-2327] Add some guards around local parts in QName constructions

Modified:
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?rev=790638&r1=790637&r2=790638&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
Thu Jul  2 16:19:11 2009
@@ -523,6 +523,11 @@
             if (StringUtils.isEmpty(partNameFilter)
                 || part.getName().equals(partNameFilter)) {
             
+                if (StringUtils.isEmpty(part.getName())) {
+                    throw new RuntimeException("Problem with WSDL: part element in message
"
+                                               + msg.getQName().getLocalPart() 
+                                               + " does not specify a name.");
+                }
                 QName pqname = new QName(minfo.getName().getNamespaceURI(), part.getName());
                 MessagePartInfo pi = minfo.getMessagePart(pqname);
                 if (pi != null
@@ -609,6 +614,11 @@
             for (SoapHeader header : headers) {
                 SoapHeaderInfo headerInfo = new SoapHeaderInfo();
                 headerInfo.setUse(header.getUse());
+                if (StringUtils.isEmpty(header.getPart())) {
+                    throw new RuntimeException("Problem with WSDL: soap:header element in
operation "
+                                               + boi.getName().getLocalPart() 
+                                               + " does not specify a part.");
+                }
                 MessagePartInfo part = msg.getMessagePart(new QName(msg.getName().getNamespaceURI(),

                                                                     header.getPart()));
                 if (part != null && header.getMessage() != null
@@ -689,6 +699,12 @@
                     attParts = new LinkedList<MessagePartInfo>();
                 }
 
+                if (StringUtils.isEmpty(partName)) {
+                    throw new RuntimeException("Problem with WSDL: mime content element in
operation "
+                                               + bmsg.getBindingOperation().getName().getLocalPart()

+                                               + " does not specify a part.");
+                }
+
                 MessagePartInfo mpi =
                     msg.getMessagePart(new QName(msg.getName().getNamespaceURI(),
                                                  partName));
@@ -711,9 +727,16 @@
 
                 SoapHeaderInfo headerInfo = new SoapHeaderInfo();
                 headerInfo.setUse(header.getUse());
+                
+                if (StringUtils.isEmpty(header.getPart())) {
+                    throw new RuntimeException("Problem with WSDL: soap:header element in
operation "
+                                               + bmsg.getBindingOperation().getName().getLocalPart()

+                                               + " does not specify a part.");
+                }
+                
                 MessagePartInfo mpi =
-                    msg.getMessagePart(new QName(msg.getName().getNamespaceURI(), header
-                                .getPart()));
+                    msg.getMessagePart(new QName(msg.getName().getNamespaceURI(), 
+                                                 header.getPart()));
                 
                 if (mpi != null && header.getMessage() != null
                     && !mpi.getMessageInfo().getName().equals(header.getMessage()))
{



Mime
View raw message