KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > bus > ws > rm > TestSoapClientBinding


1 package org.objectweb.celtix.bus.ws.rm;
2
3 import java.io.IOException JavaDoc;
4
5 import javax.wsdl.WSDLException;
6
7 import org.objectweb.celtix.Bus;
8 import org.objectweb.celtix.bindings.DataBindingCallback;
9 import org.objectweb.celtix.bindings.Request;
10 import org.objectweb.celtix.bus.bindings.TestClientTransport;
11 import org.objectweb.celtix.bus.bindings.soap.SOAPClientBinding;
12 import org.objectweb.celtix.transports.ClientTransport;
13 import org.objectweb.celtix.transports.Transport;
14 import org.objectweb.celtix.ws.addressing.EndpointReferenceType;
15
16 public class TestSoapClientBinding extends SOAPClientBinding {
17     boolean sent;
18     
19     public TestSoapClientBinding(Bus b, EndpointReferenceType ref) throws WSDLException, IOException JavaDoc {
20         super(b, ref);
21     }
22
23     protected ClientTransport createTransport(EndpointReferenceType ref)
24         throws WSDLException, IOException JavaDoc {
25         return new TestClientTransport(bus, ref);
26     }
27     
28     public TestClientTransport getClientTransport() throws IOException JavaDoc {
29         return (TestClientTransport)getTransport();
30     }
31     
32     public Transport retrieveTransport() {
33         try {
34             return getTransport();
35         } catch (IOException JavaDoc ioe) {
36             return null;
37         }
38     }
39     
40     public void send(Request request, DataBindingCallback callback)
41         throws IOException JavaDoc {
42         sent = true;
43     }
44
45     boolean isSent() {
46         return sent;
47     }
48     
49     /*
50     class TestClientTransport implements ClientTransport {
51         
52         private InputStreamMessageContext istreamCtx;
53         
54         public TestClientTransport(Bus b, EndpointReferenceType ref) {
55         }
56
57         public EndpointReferenceType getTargetEndpoint() {
58             return null;
59         }
60         
61         public EndpointReferenceType getDecoupledEndpoint() throws IOException {
62             return null;
63         }
64         
65         public Port getPort() {
66             return null;
67         }
68
69         public OutputStreamMessageContext createOutputStreamContext(MessageContext context)
70             throws IOException {
71             return new TestOutputStreamContext(null, context);
72         }
73
74         public void finalPrepareOutputStreamContext(OutputStreamMessageContext context) throws IOException {
75         }
76
77         public void invokeOneway(OutputStreamMessageContext context) throws IOException {
78             //nothing to do
79         }
80
81         public InputStreamMessageContext invoke(OutputStreamMessageContext context) throws IOException {
82             return istreamCtx;
83         }
84
85         public Future<InputStreamMessageContext> invokeAsync(OutputStreamMessageContext context, Executor ex)
86             throws IOException {
87             return null;
88         }
89
90         public void shutdown() {
91             //nothing to do
92         }
93         
94         public void setInputStreamMessageContext(InputStreamMessageContext i) {
95             istreamCtx = i;
96         }
97     }
98     */

99 }
100
Popular Tags