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.Protocol;
23: import org.apache.axis2.jaxws.message.XMLPart;
24:
25: import javax.xml.soap.SOAPEnvelope;
26: import javax.xml.stream.XMLStreamException;
27: import javax.xml.stream.XMLStreamReader;
28: import javax.xml.ws.WebServiceException;
29:
30: /**
31: * XMLPartFactory
32: * <p/>
33: * Creates an XMLPart object. The two common patterns are: - Create an empty message for a specific
34: * protocol - Create a xmlPart sourced from OM (XMLStreamReader)
35: * <p/>
36: * The FactoryRegistry should be used to get access to the Factory
37: *
38: * @see org.apache.axis2.jaxws.registry.FactoryRegistry
39: */
40: public interface XMLPartFactory {
41: /**
42: * create XMLPart from XMLStreamReader
43: *
44: * @param reader XMLStreamReader
45: * @param protocol (if null, the soap protocol is inferred from the namespace)
46: * @throws MessageStreamException
47: */
48: public XMLPart createFrom(XMLStreamReader reader, Protocol protocol)
49: throws XMLStreamException, WebServiceException;
50:
51: /**
52: * create XMLPart from OMElement
53: *
54: * @param omElement OMElement
55: * @param protocol (if null, the soap protocol is inferred from the namespace)
56: * @throws WebServiceException
57: */
58: public XMLPart createFrom(OMElement omElement, Protocol protocol)
59: throws XMLStreamException, WebServiceException;
60:
61: /**
62: * create XMLPart from SOAPEnvelope
63: *
64: * @param soapEnvelope SOAPEnvelope
65: * @throws WebServiceException
66: */
67: public XMLPart createFrom(SOAPEnvelope soapEnvelope)
68: throws XMLStreamException, WebServiceException;
69:
70: /**
71: * create empty XMLPart of the specified protocol
72: * @param protocol
73: * @throws WebServiceException
74: */
75: public XMLPart create(Protocol protocol) throws XMLStreamException,
76: WebServiceException;
77:
78: }
|