01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2007 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the
09: * Free Software Foundation; either version 2 of the License, or (at your option)
10: * any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: *
17: * You should have received a copy of the GNU General Public License along with
18: * this program; if not, write to the Free Software Foundation, Inc.,
19: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: *
22: * $Id: ISoapProviderMarshaller.java 9708 2007-10-23 19:52:06Z mpreston $
23: */
24: package com.bostechcorp.cbesb.runtime.ccsl.lib;
25:
26: import javax.jbi.messaging.Fault;
27: import javax.jbi.messaging.MessageExchange;
28: import javax.jbi.messaging.MessagingException;
29: import javax.jbi.messaging.NormalizedMessage;
30:
31: import org.apache.axiom.soap.SOAPFactory;
32: import org.apache.axis2.AxisFault;
33: import org.apache.axis2.context.MessageContext;
34:
35: import com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.ServiceDescriptionHandler;
36:
37: /**
38: * ISoapProviderMarshaller performs the conversion between SOAP messages
39: * and Normalized Messages for provider endpoints.
40: */
41: public interface ISoapProviderMarshaller {
42:
43: /**
44: * Converts from a Normalized Message into the OMElement that
45: * will become the content of the SOAPBody of the SOAP request.
46: * @param message The "in" NormalizedMessage
47: * @param exchange The MessageExchange that was received
48: * @param options The Axis2 Options object for this request. This is pre-populated,
49: * with the values obtained from the endpoint settings, but can be modified.
50: * @param omFactory The Axiom OMFactory needed to create the OMElement output
51: * @return Resulting OMElement tree to use as Soap content.
52: * @throws MessagingException
53: */
54: // public OMElement NormalizedMessageToOMElement(NormalizedMessage message,
55: // MessageExchange exchange, Options options, OMFactory omFactory) throws MessagingException;
56: public void NormalizedMessageToSoap(NormalizedMessage message,
57: MessageContext soapMsgContext, MessageExchange msgExchange,
58: SOAPFactory soapFactory, boolean useMTOM, boolean useSwA)
59: throws MessagingException;
60:
61: /**
62: * Converts an OMElement into a NormalizedMessage.
63: * This is used to convert the result of a web service call into
64: * the "out" message of an In-Out message exchange.
65: * @param omElement The OMElement that is the content of the Soap Body
66: * response message.
67: * @param message the "out" NormalizedMessage to populate
68: * @param exchange the MessageExchange that contains message
69: * @param svcDescHandler The ServiceDescriptionHandler of the component.
70: * This can be used by the NormalizedMessageHandler class to populate the
71: * proper JBI wsdl 1.1 wrapper.
72: * @throws MessagingException
73: */
74: // public void OMElementToNormalizedMessage(OMElement omElement,
75: // NormalizedMessage message, MessageExchange exchange,
76: // ServiceDescriptionHandler svcDescHandler) throws MessagingException;
77: public void SoapToNormalizedMessage(MessageContext soapMsgContext,
78: NormalizedMessage message, MessageExchange msgExchange,
79: ServiceDescriptionHandler svcDescHandler, boolean useMTOM,
80: boolean useSwA) throws MessagingException;
81:
82: /**
83: * Converts an AxisFault caught while invoking a web service into a
84: * JBI Fault that will be returned in the MessageExchange.
85: * @param axisFault The AxisFault that was caught
86: * @param jbiFault A new JBI Fault to populate
87: * @param exchange The MessageExchange
88: * @param svcDescHandler The ServiceDescriptionHandler of the component.
89: * This can be used by the NormalizedMessageHandler class to populate the
90: * proper JBI wsdl 1.1 wrapper.
91: * @throws MessagingException
92: */
93: public void AxisFaultToNormalizedMessage(AxisFault axisFault,
94: Fault jbiFault, MessageExchange exchange,
95: ServiceDescriptionHandler svcDescHandler)
96: throws MessagingException;
97:
98: }
|