/** * Validates mime:content elements. * @param mimeContents a list of mime:content elements. * @return true if any mime:content does not include the part attribute, * false otherwise */ private boolean hasInvalidMimeContent(List mimeContents) { // Going through a list of mime:content elements for (int i = 0; i < mimeContents.size(); i++) { // If a mime:content does not include the part attribute, return true if (((MIMEContent) mimeContents.get(i)).getPart() == null) return true; } // There are no invalid mime:contentS, return false return false; } }
mimeContent.getPart(), pw); DOMUtils.printAttribute(Constants.ATTR_TYPE, mimeContent.getType(), pw); Boolean required = mimeContent.getRequired();
mimeContent.setPart(part); mimeContent.setType(type); mimeContent.setRequired(new Boolean(requiredStr));
/** * Checks whether any mime:content element binds wsdl:part that is defined * with the element attribute and uses the content type "text/xml". * @param mimeContents a list of mime:content elements of binding operation. * @param message the corresponding wsdl:message element. * @return a mime:content element that uses a content type other than * "text/xml", null if no one such element is found. */ private MIMEContent getInvalidMimeContent(List mimeContents, Message message) { // Going through a list of mime:content elements for (int i = 0; i < mimeContents.size(); i++) { MIMEContent mimeContent = (MIMEContent) mimeContents.get(i); // Getting the corresponding wsdl:part Part part = message.getPart(mimeContent.getPart()); // If the part is defined with the element attribute if (part != null && part.getElementName() != null) { mimeContentFound = true; // If the type attribute value is other than "text/xml" if (!WSIConstants.CONTENT_TYPE_TEXT_XML.equals(mimeContent.getType())) { // return the invalid element return mimeContent; } } } return null; }
private static String getJavaTypeForMimeType(MIMEPart mPart) { if (mPart.getExtensibilityElements().size() > 1) { return "javax.activation.DataHandler"; } 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"; }
/** * Checks whether any mime:content element binds wsdl:part that is defined * with the element attribute and uses the content type "text/xml". * @param mimeContents a list of mime:content elements of binding operation. * @param message the corresponding wsdl:message element. * @return a mime:content element that uses a content type other than * "text/xml", null if no one such element is found. */ private MIMEContent getInvalidMimeContent(List mimeContents, Message message) { // Going through a list of mime:content elements for (int i = 0; i < mimeContents.size(); i++) { MIMEContent mimeContent = (MIMEContent) mimeContents.get(i); // Getting the corresponding wsdl:part Part part = message.getPart(mimeContent.getPart()); // If the part is defined with the element attribute if (part != null && part.getElementName() != null) { mimeContentFound = true; // If the type attribute value is other than "text/xml" if (!WSIConstants.CONTENT_TYPE_TEXT_XML.equals(mimeContent.getType())) { // return the invalid element return mimeContent; } } } return null; }
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"; } } } return "javax.activation.DataHandler"; }
/** * Validates mime:content elements. * @param mimeContents a list of mime:content elements. * @return true if any mime:content does not include the part attribute, * false otherwise */ private boolean hasInvalidMimeContent(List mimeContents) { // Going through a list of mime:content elements for (int i = 0; i < mimeContents.size(); i++) { // If a mime:content does not include the part attribute, return true if (((MIMEContent) mimeContents.get(i)).getPart() == null) return true; } // There are no invalid mime:contentS, return false return false; } }
mimeContent.getPart(), pw); DOMUtils.printAttribute(Constants.ATTR_TYPE, mimeContent.getType(), pw); Boolean required = mimeContent.getRequired();
/** * Returns the content-type of a provided {@link BindingInput} if it is available * * @param bindingInput Binding Input object * @return The content-type of the {@link BindingInput} */ private String getContentType(BindingInput bindingInput) { List extensibilityElements = bindingInput.getExtensibilityElements(); if (extensibilityElements != null) { for (Object ex : extensibilityElements) { if (ex instanceof MIMEContent) { MIMEContent mimeContentElement = (MIMEContent) ex; return mimeContentElement.getType(); } } } return null; }
mimeContent.setPart(part); mimeContent.setType(type); mimeContent.setRequired(new Boolean(requiredStr));
/** * Returns the part value from MIMEContent element * @param part MIMEPart element * @return the part value from MIMEContent element */ private String getMIMEContentPart(MIMEPart part) { List list = part.getExtensibilityElements(); if(list.size() == 0) return null; return ((MIMEContent) list.get(0)).getPart(); }
/** * Returns the content-type of a provided {@link BindingInput} if it is available * * @param bindingInput Binding Input object * @return The content-type of the {@link BindingInput} */ private String getContentType(BindingInput bindingInput) { List extensibilityElements = bindingInput.getExtensibilityElements(); if (extensibilityElements != null) { for (Object ex : extensibilityElements) { if (ex instanceof MIMEContent) { MIMEContent mimeContentElement = (MIMEContent) ex; return mimeContentElement.getType(); } } } return null; }
TypeEntry typeEntry = findPart(op, content.getPart()); if (typeEntry == null) { throw new RuntimeException(Messages.getMessage("cannotFindPartForOperation00", content.getPart(), op.getName(), content.getType())); String type = content.getType(); bEntry.setMIMEInfo(op.getName(), content.getPart(), type, dims); } else if (obj instanceof SOAPBody) {
/** * Returns the part value from MIMEContent element * @param part MIMEPart element * @return the part value from MIMEContent element */ private String getMIMEContentPart(MIMEPart part) { List list = part.getExtensibilityElements(); if(list.size() == 0) return null; return ((MIMEContent) list.get(0)).getPart(); }
if (description instanceof AxisBindingMessage) { MIMEContent mimeContent = (MIMEContent) wsdl4jExtensibilityElement; String messageSerialization = mimeContent.getType(); AxisBindingMessage bindingMessage = (AxisBindingMessage) description; setMessageSerialization(
TypeEntry typeEntry = findPart(op, content.getPart()); if (typeEntry == null) { throw new RuntimeException(Messages.getMessage("cannotFindPartForOperation00", content.getPart(), op.getName(), content.getType())); String type = content.getType(); bEntry.setMIMEInfo(op.getName(), content.getPart(), type, dims); } else if (obj instanceof SOAPBody) {
/** * Returns the part value from MIMEContent element * @param part MIMEPart element * @return the part value from MIMEContent element */ private String getMIMEContentPart(MIMEPart part) { List list = part.getExtensibilityElements(); if(list.size() == 0) return null; return ((MIMEContent) list.get(0)).getPart(); }