001: package org.objectweb.celtix.bus.ws.rm;
002:
003: import java.io.IOException;
004:
005: import javax.wsdl.WSDLException;
006:
007: import org.objectweb.celtix.Bus;
008: import org.objectweb.celtix.bindings.DataBindingCallback;
009: import org.objectweb.celtix.bindings.Request;
010: import org.objectweb.celtix.bus.bindings.TestClientTransport;
011: import org.objectweb.celtix.bus.bindings.soap.SOAPClientBinding;
012: import org.objectweb.celtix.transports.ClientTransport;
013: import org.objectweb.celtix.transports.Transport;
014: import org.objectweb.celtix.ws.addressing.EndpointReferenceType;
015:
016: public class TestSoapClientBinding extends SOAPClientBinding {
017: boolean sent;
018:
019: public TestSoapClientBinding(Bus b, EndpointReferenceType ref)
020: throws WSDLException, IOException {
021: super (b, ref);
022: }
023:
024: protected ClientTransport createTransport(EndpointReferenceType ref)
025: throws WSDLException, IOException {
026: return new TestClientTransport(bus, ref);
027: }
028:
029: public TestClientTransport getClientTransport() throws IOException {
030: return (TestClientTransport) getTransport();
031: }
032:
033: public Transport retrieveTransport() {
034: try {
035: return getTransport();
036: } catch (IOException ioe) {
037: return null;
038: }
039: }
040:
041: public void send(Request request, DataBindingCallback callback)
042: throws IOException {
043: sent = true;
044: }
045:
046: boolean isSent() {
047: return sent;
048: }
049:
050: /*
051: class TestClientTransport implements ClientTransport {
052:
053: private InputStreamMessageContext istreamCtx;
054:
055: public TestClientTransport(Bus b, EndpointReferenceType ref) {
056: }
057:
058: public EndpointReferenceType getTargetEndpoint() {
059: return null;
060: }
061:
062: public EndpointReferenceType getDecoupledEndpoint() throws IOException {
063: return null;
064: }
065:
066: public Port getPort() {
067: return null;
068: }
069:
070: public OutputStreamMessageContext createOutputStreamContext(MessageContext context)
071: throws IOException {
072: return new TestOutputStreamContext(null, context);
073: }
074:
075: public void finalPrepareOutputStreamContext(OutputStreamMessageContext context) throws IOException {
076: }
077:
078: public void invokeOneway(OutputStreamMessageContext context) throws IOException {
079: //nothing to do
080: }
081:
082: public InputStreamMessageContext invoke(OutputStreamMessageContext context) throws IOException {
083: return istreamCtx;
084: }
085:
086: public Future<InputStreamMessageContext> invokeAsync(OutputStreamMessageContext context, Executor ex)
087: throws IOException {
088: return null;
089: }
090:
091: public void shutdown() {
092: //nothing to do
093: }
094:
095: public void setInputStreamMessageContext(InputStreamMessageContext i) {
096: istreamCtx = i;
097: }
098: }
099: */
100: }
|