01: /*
02: * Copyright 2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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
23: AbstractSoap11MessageFactoryTestCase {
24:
25: protected WebServiceMessageFactory createMessageFactory()
26: throws Exception {
27: AxiomSoapMessageFactory factory = new AxiomSoapMessageFactory();
28: factory.afterPropertiesSet();
29: return factory;
30: }
31:
32: /*
33: public void testCreateMtom() throws Exception {
34: SOAP11Factory factory = new SOAP11Factory();
35: SOAPEnvelope envelope = factory.getDefaultEnvelope();
36:
37: OMNamespace namespace = factory.createOMNamespace("http://springframework.org/spring-ws/mtom", "sws");
38: OMElement element = factory.createOMElement("image", namespace);
39: envelope.getBody().addChild(element);
40: DataHandler dataHandler = new javax.activation.DataHandler(new FileDataSource("/Users/arjen/spring-ws/src/site/resources/images/spring-ws.png"));
41:
42: //create an OMText node with the above DataHandler and set optimized to true
43: OMText textData = factory.createOMText(dataHandler, true);
44:
45: element.addChild(textData);
46:
47: OMOutputFormat format = new OMOutputFormat();
48: format.setDoOptimize(true);
49: format.setSOAP11(true);
50: format.setCharSetEncoding("UTF-8");
51: assertTrue(format.isOptimized());
52: OutputStream os = new BufferedOutputStream(new FileOutputStream(
53: "/Users/arjen/Projects/Spring/spring-ws/core/src/test/resources/org/springframework/ws/soap/soap11/soap11-mtom.bin"));
54: try {
55: envelope.serialize(os, format);
56: } finally {
57: os.close();
58: */
59: }
|