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.util;
20:
21: import org.apache.axiom.om.OMElement;
22:
23: import javax.xml.soap.MessageFactory;
24: import javax.xml.soap.SOAPElement;
25: import javax.xml.soap.SOAPEnvelope;
26: import javax.xml.soap.SOAPException;
27: import javax.xml.soap.SOAPFactory;
28: import javax.xml.ws.WebServiceException;
29:
30: /** SAAJConverter Provides Conversion between SAAJ and OM Constructed via the SAAJConverterFactory */
31: public interface SAAJConverter {
32: /**
33: * Convert OM SOAPEnvleope to SAAJ SOAPEnvelope
34: *
35: * @param omElement
36: * @return SOAPEnvelope
37: * @throws WebServiceException
38: */
39: public SOAPEnvelope toSAAJ(
40: org.apache.axiom.soap.SOAPEnvelope omElement)
41: throws WebServiceException;
42:
43: /**
44: * Convert SAAJ SOAPEnvelope to OM SOAPEnvelope
45: *
46: * @param saajEnvelope
47: * @return OM Envelope
48: * @throws WebServiceException
49: */
50: public org.apache.axiom.soap.SOAPEnvelope toOM(
51: SOAPEnvelope saajEnvelope) throws WebServiceException;
52:
53: /**
54: * Convert SOAPElement into an OMElement
55: *
56: * @param soapElement
57: * @return OMElement
58: * @throws WebServiceException
59: */
60: public OMElement toOM(SOAPElement soapElement)
61: throws WebServiceException;
62:
63: /**
64: * Convert omElement into a SOAPElement and add it to the parent SOAPElement. This method requires
65: * that the parent element have an ancestor that is a SOAPEnvelope. If this is not the case use the
66: * toSAAJ(OMElement, SOAPElement, SOAPFactory) method
67: *
68: * @param omElement
69: * @param parent SOAPElement
70: * @return SOAPElement that was added to the parent.
71: * @throws WebServiceException
72: * @see toSAAJ(OMElement, SOAPElement, SOAPFactory)
73: */
74: public SOAPElement toSAAJ(OMElement omElement, SOAPElement parent)
75: throws WebServiceException;
76:
77: /**
78: * Convert omElement into a SOAPElement and add it to the parent SOAPElement.
79: *
80: * @param omElement
81: * @param parent SOAPElement
82: * @param sf SOAPFactory that is used to create Name objects
83: * @return SOAPElement that was added to the parent.
84: * @throws WebServiceException * @see toSAAJ(OMElement, SOAPElement)
85: */
86: public SOAPElement toSAAJ(OMElement omElement, SOAPElement parent,
87: SOAPFactory sf) throws WebServiceException;
88:
89: /**
90: * Creates a MessageFactory that can support the SOAP version identified
91: * by the specified envelope namespace.
92: * @param namespace
93: * @return
94: * @throws WebServiceException if the namespace is SOAP 1.2 and the SAAJ does not support
95: * SOAP 1.2 or the namespace is unknown.
96: */
97: public MessageFactory createMessageFactory(String namespace)
98: throws SOAPException, WebServiceException;
99: }
|