1 16 17 package org.apache.axis.transport.http; 18 19 import org.apache.axis.AxisEngine; 20 import org.apache.axis.AxisFault; 21 import org.apache.axis.MessageContext; 22 import org.apache.axis.client.Call; 23 import org.apache.axis.client.Transport; 24 25 35 public class HTTPTransport extends Transport 36 { 37 public static final String DEFAULT_TRANSPORT_NAME = "http"; 38 39 42 public static final String URL = MessageContext.TRANS_URL; 43 44 private Object cookie; 45 private Object cookie2; 46 private String action; 47 48 public HTTPTransport () { 49 transportName = DEFAULT_TRANSPORT_NAME; 50 } 51 52 55 public HTTPTransport (String url, String action) 56 { 57 transportName = DEFAULT_TRANSPORT_NAME; 58 this.url = url; 59 this.action = action; 60 } 61 62 69 public void setupMessageContextImpl(MessageContext mc, 70 Call call, 71 AxisEngine engine) 72 throws AxisFault 73 { 74 if (action != null) { 75 mc.setUseSOAPAction(true); 76 mc.setSOAPActionURI(action); 77 } 78 79 if (cookie != null) 81 mc.setProperty(HTTPConstants.HEADER_COOKIE, cookie); 82 if (cookie2 != null) 83 mc.setProperty(HTTPConstants.HEADER_COOKIE2, cookie2); 84 85 if (mc.getService() == null) { 89 mc.setTargetService( (String )mc.getSOAPActionURI() ); 90 } 91 } 92 93 public void processReturnedMessageContext(MessageContext context) { 94 cookie = context.getProperty(HTTPConstants.HEADER_COOKIE); 95 cookie2 = context.getProperty(HTTPConstants.HEADER_COOKIE2); 96 } 97 } 98 | Popular Tags |