01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.axis2.jaxws.message.factory;
20:
21: import org.apache.axiom.om.OMElement;
22: import org.apache.axis2.jaxws.message.Block;
23: import org.apache.axis2.jaxws.message.Message;
24: import org.apache.axis2.jaxws.message.Protocol;
25:
26: import javax.xml.soap.SOAPMessage;
27: import javax.xml.stream.XMLStreamException;
28: import javax.xml.stream.XMLStreamReader;
29: import javax.xml.ws.WebServiceException;
30:
31: /**
32: * MessageFactory
33: * <p/>
34: * Creates a Message object. The common patterns are: - Create an empty message for a specific
35: * protocol - Create a message with the xml sourced from OM (XMLStreamReader) - Create a message
36: * (xml + attachments) from a SOAPMessage
37: * <p/>
38: * The FactoryRegistry should be used to get access to the Factory
39: *
40: * @see org.apache.axis2.jaxws.registry.FactoryRegistry
41: */
42: public interface MessageFactory {
43: /**
44: * create Message with the xml from the XMLStreamReader
45: *
46: * @param reader XMLStreamReader
47: * @param protocol (if null, the soap protocol is inferred from the namespace)
48: * @throws XMLStreamException
49: */
50: public Message createFrom(XMLStreamReader reader, Protocol protocol)
51: throws XMLStreamException, WebServiceException;
52:
53: /**
54: * create Message with the xml from the OMElement
55: *
56: * @param omElement OMElement
57: * @param protocol (if null, the soap protocol is inferred from the namespace)
58: * @throws XMLStreamException
59: */
60: public Message createFrom(OMElement omElement, Protocol protocol)
61: throws XMLStreamException, WebServiceException;
62:
63: /**
64: * create Message from a Block
65: *
66: * @param block
67: * @param context Associated Context or null
68: * @param protocol (if null, the soap protocol is inferred from the namespace)
69: * @throws XMLStreamException
70: */
71: public Message createFrom(Block other, Object context,
72: Protocol protocol) throws XMLStreamException,
73: WebServiceException;
74:
75: /**
76: * create Message from SOAPMessage The xml and attachments from the SOAPMessage are used to
77: * populate the new Message The protocol is inferred from the SOAPMessage
78: *
79: * @param SOAPMessage
80: * @throws XMLStreamException, WebServiceException
81: */
82: public Message createFrom(SOAPMessage message)
83: throws XMLStreamException, WebServiceException;
84:
85: /**
86: * create empty Message of the specified protocol
87: * @param protocol
88: * @throws XMLStreamException
89: */
90: public Message create(Protocol protocol) throws XMLStreamException,
91: WebServiceException;
92: }
|