1 /* 2 * Copyright 2005-2010 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; 18 19 import java.io.IOException; 20 import java.io.InputStream; 21 22 import org.springframework.ws.WebServiceMessageFactory; 23 24 /** 25 * Sub-interface of {@link WebServiceMessageFactory} which contains SOAP-specific properties and methods. 26 * <p/> 27 * The <code>soapVersion</code> property can be used to indicate the SOAP version of the factory. By default, the 28 * version is {@link SoapVersion#SOAP_11}. 29 * 30 * @author Arjen Poutsma 31 * @since 1.0.0 32 */ 33 public interface SoapMessageFactory extends WebServiceMessageFactory { 34 35 /** 36 * Sets the SOAP Version used by this factory. 37 * 38 * @param version the version constant 39 * @see SoapVersion#SOAP_11 40 * @see SoapVersion#SOAP_12 41 */ 42 void setSoapVersion(SoapVersion version); 43 44 /** 45 * Creates a new, empty <code>SoapMessage</code>. 46 * 47 * @return the empty message 48 */ 49 SoapMessage createWebServiceMessage(); 50 51 /** 52 * Reads a {@link SoapMessage} from the given input stream. 53 * <p/> 54 * If the given stream is an instance of {@link org.springframework.ws.transport.TransportInputStream 55 * TransportInputStream}, the headers will be read from the request. 56 * 57 * @param inputStream the input stream to read the message from 58 * @return the created message 59 * @throws java.io.IOException if an I/O exception occurs 60 */ 61 SoapMessage createWebServiceMessage(InputStream inputStream) throws IOException; 62 63 }