Author: ngallardo Date: Thu Jan 3 11:24:30 2008 New Revision: 608602 URL: http://svn.apache.org/viewvc?rev=608602&view=rev Log: AXIS2-3402
Flag the client and server configuration when there are nested SwaRef attachments. Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.java webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/OperationDescription.java webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionUtils.java webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java?rev=608602&r1=608601&r2=608602&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java Thu Jan 3 11:24:30 2008 @@ -251,6 +251,11 @@ // Put values onto the message MethodMarshallerUtils.toMessage(pvList, m, packages); + + // Enable SWA for nested SwaRef attachments + if (operationDesc.hasResponseSwaRefAttachments()) { + m.setDoingSWA(true); + } return m; } catch (Exception e) { @@ -301,6 +306,11 @@ // Put values onto the message MethodMarshallerUtils.toMessage(pvList, m, packages); + + // Enable SWA for nested SwaRef attachments + if (operationDesc.hasRequestSwaRefAttachments()) { + m.setDoingSWA(true); + } return m; } catch (Exception e) { Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java?rev=608602&r1=608601&r2=608602&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java Thu Jan 3 11:24:30 2008 @@ -283,6 +283,11 @@ // Put values onto the message MethodMarshallerUtils.toMessage(pdeList, m, packages); + + // Enable SWA for nested SwaRef attachments + if (operationDesc.hasResponseSwaRefAttachments()) { + m.setDoingSWA(true); + } return m; } catch (Exception e) { @@ -343,6 +348,11 @@ // Put values onto the message...marshalling by type MethodMarshallerUtils.toMessage(pdeList, m, packages); + + // Enable SWA for nested SwaRef attachments + if (operationDesc.hasRequestSwaRefAttachments()) { + m.setDoingSWA(true); + } return m; } catch (Exception e) { Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java?rev=608602&r1=608601&r2=608602&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java Thu Jan 3 11:24:30 2008 @@ -364,6 +364,11 @@ if (!marshalDesc.getAnnotationDesc(cls).hasXmlRootElement()) { object = new JAXBElement(wrapperQName, cls, object); } + + // Enable SWA for nested SwaRef attachments + if (operationDesc.hasResponseSwaRefAttachments()) { + m.setDoingSWA(true); + } // Put the object into the message JAXBBlockFactory factory = @@ -453,6 +458,11 @@ // Make sure object can be rendered as an element if (!marshalDesc.getAnnotationDesc(cls).hasXmlRootElement()) { object = new JAXBElement(wrapperQName, cls, object); + } + + // Enable SWA for nested SwaRef attachments + if (operationDesc.hasRequestSwaRefAttachments()) { + m.setDoingSWA(true); } // Put the object into the message Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.java?rev=608602&r1=608601&r2=608602&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.java Thu Jan 3 11:24:30 2008 @@ -134,6 +134,11 @@ // Put values onto the message MethodMarshallerUtils.toMessage(pdeList, m, packages); + + // Enable SWA for nested SwaRef attachments + if (operationDesc.hasRequestSwaRefAttachments()) { + m.setDoingSWA(true); + } return m; } catch (Exception e) { @@ -328,6 +333,11 @@ // TODO Should we check for null output body values? Should we check for null output header values ? // Put values onto the message MethodMarshallerUtils.toMessage(pdeList, m, packages); + + // Enable SWA for nested SwaRef attachments + if (operationDesc.hasResponseSwaRefAttachments()) { + m.setDoingSWA(true); + } return m; } catch (Exception e) { Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java?rev=608602&r1=608601&r2=608602&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java Thu Jan 3 11:24:30 2008 @@ -557,6 +557,12 @@ } MethodMarshallerUtils.toMessage(headerPDEList, m, packages); } + + // Enable SWA for nested SwaRef attachments + if (operationDesc.hasResponseSwaRefAttachments()) { + m.setDoingSWA(true); + } + return m; } catch (Exception e) { throw ExceptionFactory.makeWebServiceException(e); @@ -674,6 +680,12 @@ MethodMarshallerUtils.toMessage(headerPDEList, m, packages); } + + // Enable SWA for nested SwaRef attachments + if (operationDesc.hasRequestSwaRefAttachments()) { + m.setDoingSWA(true); + } + return m; } catch (Exception e) { throw ExceptionFactory.makeWebServiceException(e); Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java?rev=608602&r1=608601&r2=608602&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java Thu Jan 3 11:24:30 2008 @@ -136,6 +136,11 @@ // Put values onto the message MethodMarshallerUtils.toMessage(pdeList, m, packages); + + // Enable SWA for nested SwaRef attachments + if (operationDesc.hasRequestSwaRefAttachments()) { + m.setDoingSWA(true); + } return m; } catch (Exception e) { @@ -347,6 +352,11 @@ // TODO Should we check for null output body values? Should we check for null output header values ? // Put values onto the message MethodMarshallerUtils.toMessage(pdeList, m, packages); + + // Enable SWA for nested SwaRef attachments + if (operationDesc.hasResponseSwaRefAttachments()) { + m.setDoingSWA(true); + } return m; } catch (Exception e) { Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/OperationDescription.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/OperationDescription.java?rev=608602&r1=608601&r2=608602&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/OperationDescription.java (original) +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/OperationDescription.java Thu Jan 3 11:24:30 2008 @@ -212,6 +212,11 @@ * @return OperationDescription corresponding to the sync operation, or null (see note above). */ public OperationDescription getSyncOperation(); + + /** + * @return Attachment Description for the return type or null + */ + public AttachmentDescription getResultAttachmentDescription(); /** * Returns the namespace of binding input message for the operation @@ -224,7 +229,23 @@ public String getBindingOutputNamespace(); /** - * @return Attachment Description for the return type or null - */ - public AttachmentDescription getResultAttachmentDescription(); + * @return a boolean indicator of nested swaRef attachments on the request. + */ + public boolean hasRequestSwaRefAttachments(); + + /** + * @param sets the indicator of nested request swaRef attachments. + */ + public void setHasRequestSwaRefAttachments(boolean b); + + /** + * @return a boolean indicator of nested swaRef attachments on the response. + */ + public boolean hasResponseSwaRefAttachments(); + + /** + * @param sets the indicator of nested response swaRef attachments. + */ + public void setHasResponseSwaRefAttachments(boolean b); + } Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionUtils.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionUtils.java?rev=608602&r1=608601&r2=608602&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionUtils.java (original) +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionUtils.java Thu Jan 3 11:24:30 2008 @@ -417,6 +417,22 @@ } return ((SOAP12Header) extObj).getNamespaceURI(); } + else if (extObj instanceof MIMEMultipartRelated) { + if (log.isDebugEnabled()) { + log.debug("Found a MIMEMultipartRelated element. Unwrapping to get SOAP binding."); + } + MIMEMultipartRelated mime = (MIMEMultipartRelated) extObj; + List mimeParts = mime.getMIMEParts(); + + Iterator itr = mimeParts.iterator(); + while (itr.hasNext()) { + MIMEPart mimePart = (MIMEPart) itr.next(); + List elements = mimePart.getExtensibilityElements(); + + String ns = getNamespaceFromSOAPElement(elements); + return ns; + } + } } return null; } @@ -433,21 +449,17 @@ if (bindingOp.getName().equals(opDesc.getName().getLocalPart())) { if (bindingOp.getBindingInput() != null) { if (log.isDebugEnabled()) { - log.debug("Processing binding input"); + log.debug("Processing binding opertion input"); } - processBindingForMIME(bindingOp.getBindingInput() - .getExtensibilityElements(), - opDesc, - bindingOp.getOperation()); + processBindingForMIME(bindingOp.getBindingInput().getExtensibilityElements(), + opDesc, bindingOp.getOperation(), true); } if (bindingOp.getBindingOutput() != null) { if (log.isDebugEnabled()) { log.debug("Processing binding output"); } - processBindingForMIME(bindingOp.getBindingOutput() - .getExtensibilityElements(), - opDesc, - bindingOp.getOperation()); + processBindingForMIME(bindingOp.getBindingOutput().getExtensibilityElements(), + opDesc, bindingOp.getOperation(), false); } } } @@ -460,16 +472,24 @@ * does it will build up the appropriate AttachmentDescription objects. */ private static void processBindingForMIME(List extensibilityElements, - OperationDescriptionImpl opDesc, Operation operation) { + OperationDescriptionImpl opDesc, + Operation operation, + boolean isRequest) { Iterator extensibilityIter = extensibilityElements.iterator(); while (extensibilityIter.hasNext()) { Object obj = extensibilityIter.next(); if (obj instanceof MIMEMultipartRelated) { + if (log.isDebugEnabled()) { + log.debug("Found a mime:multipartRelated extensiblity element."); + } // Found mime information now process it and determine if we need to // create an AttachmentDescription MIMEMultipartRelated mime = (MIMEMultipartRelated) obj; Iterator partIter = mime.getMIMEParts().iterator(); while (partIter.hasNext()) { + if (log.isDebugEnabled()) { + log.debug("Found a mime:part child element."); + } MIMEPart mimePart = (MIMEPart) partIter.next(); Iterator mExtIter = mimePart.getExtensibilityElements().iterator(); // Process each mime part to determine if there is mime content @@ -495,6 +515,19 @@ log.debug("Already created AttachmentDescription for part: " + part + " of type: " + type); } + } + } + else if (obj2 instanceof SOAPBody || obj2 instanceof SOAP12Body) { + if (log.isDebugEnabled()) { + log.debug("Found a body element with potential nested mime content"); + } + + // Flag whether there's a potential nested attachment. + if (isRequest) { + opDesc.setHasRequestSwaRefAttachments(true); + } + else { + opDesc.setHasResponseSwaRefAttachments(true); } } } Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java?rev=608602&r1=608601&r2=608602&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java (original) +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java Thu Jan 3 11:24:30 2008 @@ -182,6 +182,10 @@ private boolean _setAttachmentDesc = false; private AttachmentDescription attachmentDesc = null; + private boolean hasRequestSwaRefAttachments = false; + private boolean hasResponseSwaRefAttachments = false; + private Map<String, AttachmentDescription> partAttachmentMap; + private Method serviceImplMethod; private boolean serviceImplMethodFound = false; // For JAX-WS client async methods, this is the corresponding Sync method; for everything else, @@ -190,8 +194,7 @@ // RUNTIME INFORMATION Map<String, OperationRuntimeDescription> runtimeDescMap = Collections.synchronizedMap(new HashMap<String, OperationRuntimeDescription>()); - private Map<String, AttachmentDescription> partAttachmentMap; - + OperationDescriptionImpl(Method method, EndpointInterfaceDescription parent) { // TODO: Look for WebMethod anno; get name and action off of it parentEndpointInterfaceDescription = parent; @@ -1951,6 +1954,22 @@ public void addPartAttachmentDescription(String partName, AttachmentDescription attachmentDesc) { partAttachmentMap.put(partName, attachmentDesc); + } + + public boolean hasRequestSwaRefAttachments() { + return hasRequestSwaRefAttachments; + } + + public void setHasRequestSwaRefAttachments(boolean b) { + hasRequestSwaRefAttachments = b; + } + + public boolean hasResponseSwaRefAttachments() { + return hasResponseSwaRefAttachments; + } + + public void setHasResponseSwaRefAttachments(boolean b) { + hasResponseSwaRefAttachments = b; } public String toString() { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]