1 55 56 package org.jboss.axis.transport.http; 57 58 import org.jboss.axis.AxisEngine; 59 import org.jboss.axis.AxisFault; 60 import org.jboss.axis.MessageContext; 61 import org.jboss.axis.client.Call; 62 import org.jboss.axis.client.Transport; 63 64 74 public class HTTPTransport extends Transport 75 { 76 public static final String DEFAULT_TRANSPORT_NAME = "http"; 77 78 81 public static final String URL = MessageContext.TRANS_URL; 82 83 private String cookie; 84 private String cookie2; 85 private String action; 86 87 public HTTPTransport() 88 { 89 transportName = DEFAULT_TRANSPORT_NAME; 90 } 91 92 95 public HTTPTransport(String url, String action) 96 { 97 transportName = DEFAULT_TRANSPORT_NAME; 98 this.url = url; 99 this.action = action; 100 } 101 102 110 public void setupMessageContextImpl(MessageContext mc, 111 Call call, 112 AxisEngine engine) 113 throws AxisFault 114 { 115 if (action != null) 116 { 117 mc.setUseSOAPAction(true); 118 mc.setSOAPActionURI(action); 119 } 120 121 if (cookie != null) 123 mc.setProperty(HTTPConstants.HEADER_COOKIE, cookie); 124 if (cookie2 != null) 125 mc.setProperty(HTTPConstants.HEADER_COOKIE2, cookie2); 126 127 if (mc.getService() == null) 131 { 132 mc.setTargetService((String )mc.getSOAPActionURI()); 133 } 134 } 135 136 public void processReturnedMessageContext(MessageContext context) 137 { 138 cookie = context.getStrProp(HTTPConstants.HEADER_COOKIE); 139 cookie2 = context.getStrProp(HTTPConstants.HEADER_COOKIE2); 140 } 141 } 142 | Popular Tags |