1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.sandesha;
19
20 import org.apache.axis.AxisEngine;
21 import org.apache.axis.AxisFault;
22 import org.apache.axis.MessageContext;
23 import org.apache.axis.client.Call;
24 import org.apache.axis.client.Transport;
25 import org.apache.axis.transport.http.HTTPConstants;
26
27 /***
28 * A File Transport class.
29 *
30 * @author Rob Jellinghaus (robj@unrealities.com)
31 * @author Doug Davis (dug@us.ibm.com)
32 * @author Glen Daniels (gdaniels@allaire.com)
33 */
34 public class RMTransport extends Transport {
35
36 private String action;
37
38 private String cookie;
39
40 private String cookie2;
41
42 public RMTransport() {
43 transportName = "RMTransport";
44 }
45
46 public RMTransport(String url, String action) {
47 transportName = "RMTransport";
48 this.url = url;
49 this.action = action;
50
51 }
52
53 public void setupMessageContextImpl(MessageContext mc, Call call, AxisEngine engine)
54 throws AxisFault {
55 if (action != null) {
56 mc.setUseSOAPAction(true);
57 mc.setSOAPActionURI(action);
58 }
59
60
61 if (cookie != null)
62 mc.setProperty(HTTPConstants.HEADER_COOKIE, cookie);
63 if (cookie2 != null)
64 mc.setProperty(HTTPConstants.HEADER_COOKIE2, cookie2);
65
66
67
68
69 if (mc.getService() == null) {
70 mc.setTargetService((String) mc.getSOAPActionURI());
71 }
72 }
73
74 public void processReturnedMessageContext(MessageContext context) {
75 cookie = context.getStrProp(HTTPConstants.HEADER_COOKIE);
76 cookie2 = context.getStrProp(HTTPConstants.HEADER_COOKIE2);
77 }
78
79 }