pw); DOMUtils.printAttribute(Constants.ATTR_TYPE, mimeContent.getType(), pw);
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"; }
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"; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
MIMEContent mimeContent = (MIMEContent) obj2; String part = mimeContent.getPart(); String type = mimeContent.getType();
pw); DOMUtils.printAttribute(Constants.ATTR_TYPE, mimeContent.getType(), pw);
MIMEContent mimeContent = (MIMEContent) obj2; String part = mimeContent.getPart(); String type = mimeContent.getType();
msg.getMessagePart(new QName(msg.getName().getNamespaceURI(), partName)); mpi.setProperty(Message.CONTENT_TYPE, mc.getType()); attParts.add(mpi);
msg.getMessagePart(new QName(msg.getName().getNamespaceURI(), partName)); mpi.setProperty(Message.CONTENT_TYPE, mc.getType()); attParts.add(mpi);
if (description instanceof AxisBindingMessage) { MIMEContent mimeContent = (MIMEContent) wsdl4jExtensibilityElement; String messageSerialization = mimeContent.getType(); AxisBindingMessage bindingMessage = (AxisBindingMessage) description; setMessageSerialization(
if (description instanceof AxisBindingMessage) { MIMEContent mimeContent = (MIMEContent) wsdl4jExtensibilityElement; String messageSerialization = mimeContent.getType(); AxisBindingMessage bindingMessage = (AxisBindingMessage) description; setMessageSerialization(