1 16 17 package org.apache.taglibs.io; 18 19 import java.io.BufferedReader ; 20 import java.io.IOException ; 21 import java.io.InputStream ; 22 import java.io.InputStreamReader ; 23 import java.io.OutputStream ; 24 import java.io.OutputStreamWriter ; 25 import java.net.HttpURLConnection ; 26 import java.net.MalformedURLException ; 27 import java.net.URL ; 28 import java.net.URLConnection ; 29 30 import javax.servlet.ServletContext ; 31 import javax.servlet.jsp.JspException ; 32 import javax.servlet.jsp.JspWriter ; 33 import javax.servlet.jsp.tagext.BodyContent ; 34 import javax.servlet.jsp.tagext.TagSupport ; 35 36 41 public class HttpSoapTag extends HttpTag { 42 43 44 private String soapAction; 45 46 47 private String contentType = "text/xml"; 48 49 50 public HttpSoapTag() { 51 setAction( "POST" ); 52 } 53 54 public void setSOAPAction(String soapAction) { 57 this.soapAction = soapAction; 58 } 59 60 protected void configureConnection( URLConnection connection ) throws IOException { 63 super.configureConnection( connection ); 64 connection.setRequestProperty( "Content-Type", "text/xml" ); 65 connection.setRequestProperty( "SOAPAction", soapAction ); 66 } 67 } 68 | Popular Tags |