1 /* 2 * Copyright 2006 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.springframework.ws.soap.axiom; 18 19 import org.springframework.ws.WebServiceMessageFactory; 20 import org.springframework.ws.soap.soap11.AbstractSoap11MessageFactoryTestCase; 21 22 public class AxiomSoap11MessageFactoryTest extends AbstractSoap11MessageFactoryTestCase { 23 24 protected WebServiceMessageFactory createMessageFactory() throws Exception { 25 AxiomSoapMessageFactory factory = new AxiomSoapMessageFactory(); 26 factory.afterPropertiesSet(); 27 return factory; 28 } 29 30 /* 31 public void testCreateMtom() throws Exception { 32 SOAP11Factory factory = new SOAP11Factory(); 33 SOAPEnvelope envelope = factory.getDefaultEnvelope(); 34 35 OMNamespace namespace = factory.createOMNamespace("http://springframework.org/spring-ws/mtom", "sws"); 36 OMElement element = factory.createOMElement("image", namespace); 37 envelope.getBody().addChild(element); 38 DataHandler dataHandler = new javax.activation.DataHandler(new FileDataSource("/Users/arjen/spring-ws/src/site/resources/images/spring-ws.png")); 39 40 //create an OMText node with the above DataHandler and set optimized to true 41 OMText textData = factory.createOMText(dataHandler, true); 42 43 element.addChild(textData); 44 45 OMOutputFormat format = new OMOutputFormat(); 46 format.setDoOptimize(true); 47 format.setSOAP11(true); 48 format.setCharSetEncoding("UTF-8"); 49 assertTrue(format.isOptimized()); 50 OutputStream os = new BufferedOutputStream(new FileOutputStream( 51 "/Users/arjen/Projects/Spring/spring-ws/core/src/test/resources/org/springframework/ws/soap/soap11/soap11-mtom.bin")); 52 try { 53 envelope.serialize(os, format); 54 } finally { 55 os.close(); 56 */ 57 }