Understanding the Http headers

I am having only the header information.
Please can any one suggest what does it mean.
Authorization: Basic aZMnDb6dcYQ5adRzD9eCcmD=
Content-Length: 313
Host: 197.132.1.55
User-Agent: ApplicationEmulator/1.0
Content-Type: text/xml
<?xml version="1.0" encoding="US-ASCII"?>
<message><sms type="mt"><destination messageid="PS0"><address><number
type="international">12123164564</number></address></destination><source><address>
<number type="unknown"/></address></source><rsr type="success_failure"/><ud
type="text">Hello World</ud></sms></message>
Please Suggest how to send http request using
java class.
Thanks in advance.

Without more context it's difficult to suggest what it means. After some formatting, it might be a SOAP message with some kind of personal info:
<?xml version="1.0" encoding="US-ASCII"?>
<message>
    <sms type="mt">
        <destination messageid="PS0">
            <address>
                <number type="international">12123164564</number>
            </address>
        </destination>
        <source>
            <address>
                <number type="unknown"/>
            </address>
        </source>
    <rsr type="success_failure"/>
    <ud type="text">Hello World</ud>
    </sms>
</message>

Similar Messages

  • How to set the HTTP headers in HTTP Binding to call RESTful service

    I'm calling a RESTful service from the SOA Composite through a BPEL process. The RESTful service need few values to be set in the HTTP header to authorize the request. I tried several different options like setting the headers in the invoke service etc., but in vain. Apparently, the web service call fails for not having header information.
    I have burnt several days on this. Can somebody help me to get through this please?
    I'm using SOA composite 11.1.1.4 on WLS 10.3.4.
    Thanks in advance.
    The exception -
    <Oct 19, 2011 1:01:59 PM CDT> <Error> <oracle.webservices.service> <OWS-04086> <javax.xml.rpc.soap.SOAPFaultException: oracle.fabric.common.FabricInvocationException: Unable to access the following endpoint(s): https://txganguat.txd
    ps.state.tx.us/TxGang
    at oracle.integration.platform.blocks.soap.WebServiceEntryBindingComponent.generateSoapFaultException(WebServiceEntryBindingComponent.java:1053)
    at oracle.integration.platform.blocks.soap.WebServiceEntryBindingComponent.processIncomingMessage(WebServiceEntryBindingComponent.java:890)
    at oracle.integration.platform.blocks.soap.FabricProvider.processMessage(FabricProvider.java:113)
    at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:1187)
    at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:1081)
    at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:581)
    at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:232)
    at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:192)
    at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:459)
    at oracle.integration.platform.blocks.soap.FabricProviderServlet.doPost(FabricProviderServlet.java:507)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)

    any updates on this? Running into the same issue!
    Thanks

  • How to set and retrieve the http headers

    I am adding one custom header "edmsversion" in my first page, it is visible in it but when the response is redirected to another jsp, my header is lost. In second page, it's not getting. I have copied my code below. Please help me.
    My first Page
         System.out.println("Jsp called successfully");
         response.addHeader("edmsversion","1.2");
         boolean isheader = response.containsHeader("edmsversion");
         System.out.println("contains edmsversion header ..."+isheader);
         response.sendRedirect("/TestHeaderResponse.jsp");
    TestHeaderResponse.jsp
         System.out.println("Test header response page called successfully");
         String stringversion = request.getHeader("edmsversion");
         out.println("edms version header : "+stringversion);
         Enumeration headernames = request.getHeaderNames();
         System.out.println("Headers---------");
         while (headernames.hasMoreElements()){
              String headername = (String)headernames.nextElement();
              String headervalue = request.getHeader(headername);
              System.out.println(headername+"----"+headervalue);
         out.println("over");     

    You are setting a response header, then telling the browser to make a new request to a different page. All headers sent from "My First Page" are discarded and only the new response headers from "TestHeaderResponse.jsp" are available to the browser.
    Try using
    getServletContext().getRequestDispatcher("/TestHeaderResponse.jsp").include();That should work I would think. You cannot use the forward() method of the requestDispatcher because you cannot have sent any output from the calling servlet when using forward(). If forwarding from a jsp, all data in the output buffer is cleared before the forward takes place I believe, so you would get the same problem. Hope that helps.

  • HTTP Headers - enabling caching and compression with the portal?

    Has anyone configured their web server (IIS or Apache) or use a commercial product to flawlessly cache and compress all content generated by the portal?
    Compression and caching is critical for making our portal based applictions work for overseas users. It should be doable, just taking advantage of standard HTTP protocols, but implementing this a complex system like the portal is tricky, we seem to be generating different values in the HTTP Headers for the same types of files (such as CSS).
    We are running Apache so can't take advantage of the built in compression capabilities of the .net portal. We are running the java vervion. 6.1 mp1, sql server 2000 (portal, search, collab, publisher, studio, analytics, custom .net and java portlets on remote server).
    Basically our strategy is to compress all outgoing static and dynamic text content (html, CSS, javascript), and to cache all static files (CSS, javascript, images) for 6 months to a year depending on file type.
    Here are some links on the subjects of caching and compression that I have compiled:
    Caching & Compression info and tools
    http://www.webreference.com/internet/software/servers/http/compression/
    http://www.ibm.com/developerworks/web/library/wa-httpcomp/
    http://www.mnot.net/cache_docs/
    http://www.codeproject.com/aspnet/HttpCompressionQnD.asp?df=100&forumid=322472&exp=0&select=1722189#xx1722189xx
    http://en.wikipedia.org/wiki/Http_compression
    http://perl.apache.org/docs/tutorials/client/compression/compression.html
    https://secure.xcache.com/Page.aspx?c=60&p=590
    http://www.codinghorror.com/blog/archives/000807.html
    http://www.howtoforge.com/apache2_mod_deflate
    http://www.ircache.net/cgi-bin/cacheability.py
    http://betterexplained.com/articles/how-to-optimize-your-site-with-http-caching/
    http://betterexplained.com/articles/speed-up-your-javascript-load-time/
    http://betterexplained.com/articles/speed-up-your-javascript-load-time/
    http://www.rubyrobot.org/article/5-tips-for-faster-loading-web-sites
    http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/
    http://www.gidnetwork.com/tools/gzip-test.php
    http://www.pipeboost.com/
    http://www.schroepl.net/cgi-bin/http_trace.pl
    http://leknor.com/code/gziped.php?url=http%3A%2F%2Fwww.google.com
    http://www.port80software.com/surveys/top1000compression/
    http://www.rexswain.com/httpview.html
    http://www.15seconds.com/issue/020314.htm
    http://www.devwebpro.com/devwebpro-39-20041117DevelopingYourSiteforPerformanceCompressionandOtherServerSideEnhancements.html
    http://www.webpronews.com/topnews/2004/11/17/developing-your-site-for-performance-optimal-cache-control
    http://www.sitepoint.com/print/effective-website-acceleration
    http://nazish.blog.com/1007523/
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/IETechCol/dnwebgen/IE_Fiddler2.asp?frame=true
    http://www.fiddlertool.com/fiddler/version.asp
    http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html
    http://www.web-caching.com/cacheability.html
    http://www.edginet.org/techie/website/http.html
    http://www.cmlenz.net/blog/2005/05/on_http_lastmod.html
    http://www.websiteoptimization.com/speed/tweak/cache/
    http://www.webperformance.org/caching//caching_for_performance.html
    http://betterexplained.com/articles/how-to-debug-web-applications-with-firefox/
    Edited by tkoenings at 06/18/2007 6:26 AM

    Hi Scott,
    Does Weblogic platform 8.1 supports netscape? We have developed a portal which
    works perfectly on IE but it dies in netscape. Is netUI tags not supported in
    Netscape?
    Pls reply
    manju
    Scott Dunbar <[email protected]> wrote:
    From a pure HTML perspective Portal does it's rendering with nested
    tables.
    Netscape 4.x and below have terrible performance with nested tables.
    The
    problem is not the Portal server but rather Netscape on the client machine.
    If IE and/or a recent version of Netscape/Mozilla is not possible then
    there are
    really only two options:
    1) Faster client hardware - not likely to be an acceptable solution.
    2) Minimize the number of portlets and the complexity within the portlets.
    Neither of these solutions are a great answer, but the 4.7 series of
    Netscape is
    getting pretty old. Having said that, we've got customers who want to
    continue
    to use IE 4 :)
    Again, though, this problem is, I'm afraid out of our hands. It is the
    client
    rendering time that is the issue.
    cg wrote:
    Does anyone know of any known reasons why the 7.0 (did it also with4.0) portal
    pages can take up to almost 30 seconds to load in Netscape 4.7? I knowit is a
    very generic question but our customer still uses 4.7 and will notuse the portal
    b/c it takes so long to load some of the webapps. What the pages willdo when
    loading is that the headers will come up and when it gets to the bodyof the page
    it seems to stall and then comes up all of a sudden. For some of thepages it
    takes 6 seconds and for others it takes about 24-27 seconds.
    We have suggested using IE only but that is not an option with allof the customers
    and getting a newer version of Netscape is also out of the question.
    Any suggestions would be greatly appreciated.--
    scott dunbar
    bea systems, inc.
    boulder, co, usa

  • Generate PDF using Managed Bean with custom HTTP headers

    Background
    Generate a report in various formats (e.g., PDF, delimited, Excel, HTML, etc.) using JDeveloper 11g Release 2 (11.1.2.3.0) upon clicking an af:commandButton. See also the StackOverflow version of this question:
    http://stackoverflow.com/q/13654625/59087
    Problem
    HTTP headers are being sent twice: once by the framework and once by a bean.
    Source Code
    The source code includes:
    - Button Action
    - Managed Bean
    - Task Flow
    Button Action
    The button action:
    <af:commandButton text="Report" id="submitReport" action="Execute" />
    Managed Bean
    The Managed Bean is fairly complex. The code to `responseComplete` is getting called, however it does not seem to be called sufficiently early to prevent the application framework from writing the HTTP headers.
    HTTP Response Header Override
    * Sets the HTTP headers required to indicate to the browser that the
    * report is to be downloaded (rather than displayed in the current
    * window).
    protected void setDownloadHeaders() {
    HttpServletResponse response = getServletResponse();
    response.setHeader( "Content-Description", getContentDescription() );
    response.setHeader( "Content-Disposition", "attachment, filename="
    + getFilename() );
    response.setHeader( "Content-Type", getContentType() );
    response.setHeader( "Content-Transfer-Encoding",
    getContentTransferEncoding() );
    Issue Response Complete
    The bean indirectly tells the framework that the response is handled (by the bean):
    getFacesContext().responseComplete();
    Bean Run and Configure
    public void run() {
    try {
    Report report = getReport();
    configure(report.getParameters());
    report.run();
    } catch (Exception e) {
    e.printStackTrace();
    private void configure(Parameters p) {
    p.put(ReportImpl.SYSTEM_REPORT_PROTOCOL, "http");
    p.put(ReportImpl.SYSTEM_REPORT_HOST, "localhost");
    p.put(ReportImpl.SYSTEM_REPORT_PORT, "7002");
    p.put(ReportImpl.SYSTEM_REPORT_PATH, "/reports/rwservlet");
    p.put(Parameters.PARAM_REPORT_FORMAT, "pdf");
    p.put("report_cmdkey", getReportName());
    p.put("report_ORACLE_1", getReportDestinationType());
    p.put("report_ORACLE_2", getReportDestinationFormat());
    Task Flow
    The Task Flow calls Execute, which refers to the bean's `run()` method:
    entry -> main -> Execute -> ReportBeanRun
    Where:
    <method-call id="ReportBeanRun">
    <description>Executes a report</description>
    <display-name>Execute Report</display-name>
    <method>#{reportBean.run}</method>
    <outcome>
    <fixed-outcome>success</fixed-outcome>
    </outcome>
    </method-call>
    The bean is assigned to the `request` scope, with a few managed properties:
    <control-flow-rule id="__3">
    <from-activity-id>main</from-activity-id>
    <control-flow-case id="ExecuteReport">
    <from-outcome>Execute</from-outcome>
    <to-activity-id>ReportBeanRun</to-activity-id>
    </control-flow-case>
    </control-flow-rule>
    <managed-bean id="ReportBean">
    <description>Executes a report</description>
    <display-name>ReportBean</display-name>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    The `<fixed-outcome>success</fixed-outcome>` strikes me as incorrect -- I don't want the method call to return to another task.
    Restrictions
    The report server receives requests from the web server exclusively. The report server URL cannot be used by browsers to download directly, for security reasons.
    Error Messages
    The error message that is generated:
    Duplicate headers received from server
    Error 349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION): Multiple distinct Content-Disposition headers received. This is disallowed to protect against HTTP response splitting attacks.Nevertheless, the report is being generated. Preventing the framework from writing the HTTP headers would resolve this issue.
    Question
    How can you set the HTTP headers in ADF while using a Task Flow to generate a PDF by calling a managed bean?
    Ideas
    Some additional ideas:
    - Override the Page Lifecycle Phase Listener (`ADFPhaseListener` + `PageLifecycle`)
    - Develop a custom Servlet on the web server
    Related Links
    - http://www.oracle.com/technetwork/middleware/bi-publisher/adf-bip-ucm-integration-179699.pdf
    - http://www.slideshare.net/lucbors/reports-no-notes#btnNext
    - http://www.techartifact.com/blogs/2012/03/calling-oracle-report-from-adf-applications.html?goback=%2Egde_4212375_member_102062735
    - http://docs.oracle.com/cd/E29049_01/web.1112/e16182/adf_lifecycle.htm#CIABEJFB
    Thank you!

    The problem was that the HTTP headers were in fact being written twice:
    1. The report server was returning HTTP response headers.
    2. The bean was including its own HTTP response headers (as shown in the question).
    3. The bean was copying the entire contents of the report server response, including the headers, into the output stream.
    Firefox ignored the duplicate header errors, but Google Chrome did not.

  • How do I see http headers in new web inspector resource tab?

    In Safari 4.x there was a simple tab to see the http headers, but in the new fancy resource tab I can't find them anywhere.   Where did they go?

    Perhaps you need to take some tutorials.
    LabVIEW Introduction Course - Three Hours
    LabVIEW Introduction Course - Six Hours
    Attachments:
    Example_VI_BD.png ‏11 KB

  • Setting HTTP Headers

    Hi,
    How do I set/add the HTTP headers in the webservice soap client(Call object)?
    Any pointers/code samples will be of good help.
    Regards
    Kumza

    Hi,
    I have the same problem and I have tried your solution but the problem persists.
    The point is that, in my case, getMessage() returns NULL so I cannot set the header.
    Any idea or suggestion?
    Thank you very much in advance.
    Juan

  • Parsing HTTP Headers

    How can I parse only the HTTP Headers from an InputStream? I just want to parse up to the end of the headers, I want to preserve the body of the message in the stream to be read later by a content decoder or something along those lines.

    Right I already know all of this. First the HTTPURLConnection doesn't have all the features that I want. Second I have already tried creating a parsing routine and for some reason I just can't come up with one that works every time, right now I have...
    sb is a StringBuilder
    in is a DataInputReader
                while ((rdata = in.readLine()) != null && !doneReadingHeader) {
                    sb.append(rdata);
                    sb.append("\n");
                    //If there is a newline?
                    if(rdata.length() < 1) {
                        doneReadingHeader = true;
                }

  • HTTP headers vs HTTP URLs

    Could someone please explain the very subtle difference between HTTP headers vs HTTP URLs?
    Thanks.

    Hi,
    The URL is the resource location with or without additional parameters that will be requested - e.g. www.cisco.com or http://forum.cisco.com/eforum/servlet/NetProf?page=netprof&needs_authentication=yes&forum=Data%20Center&
    The HTTP headers on the other hand are additional parameters that are part of the HTTP protocol. They define things like Cookies, the referrer etc. A list of headers can be seen at http://en.wikipedia.org/wiki/List_of_HTTP_headers.
    It is also possible to add your own headers - usually prefixed with X-.
    If you look at the dissection of an HTTP conversation captured by Wireshark you'll see how the headers are used.
    HTH
    Cathy

  • OSB http headers management

    I have a scenario where my osb messages are rejected by the target server, while the same messages are accepted when sent by wget. The only difference between the two requests is represented by the http headers.
    The first thing to notice was that most of the http headers are not showing neither in the outbound, nor in the business server traces.
    The outbound http headers:
    <tran:headers xsi:type="http:HttpRequestHeaders" xmlns:tran="http://www.bea.com/wli/sb/transports">
    <http:Content-Type>text/xml; charset=utf-8</http:Content-Type>
    <http:SOAPAction>"urn:Services#DeleteUser"</http:SOAPAction>
    </tran:headers>
    The http headers received by the server:
    Host
    localhost:7021
    Content-Length
    448
    SOAPAction
    "urn:Services#DeleteUser"
    User-Agent
    Java1.6.0_29
    Content-Type
    text/xml; charset=utf-8
    Accept
    text/html, image/gif, image/jpeg, */*; q=.2
    Connection
    Keep-Alive
    Why is OSB not showing all the headers? How about removing any of the headers currently received by the server, before sending the message? Can it be done in OSB?

    Would this work ?
    $inbound/ctx:transport/ctx:request/tp:headers/tp:user-header[lower-case(@name)="x-ab-normal"][1]/@value

  • [WLS 10.3]:Weblogic.cache.filter does not cache all http headers

    When using Weblogic CacheFilter servlet filter to speed our request. However, cached pages miss
    some HTTP Headers ie: Content-Encoding.
    As a result, if we setup a GZIP filter on most popular static text oriented document like css, html, js, the GZIP filter add a Content-Encoding http header set to gzip. But as CacheFilter forget that header, client receives the correct content-type but not anymore the Content-encoding.
    Steps to Reproduce
    Ask a static file like a .js library and sniff the HTTP headers. Switch the servlet filter order between gzip and CacheFilter, the HTTP header is correctly set but not when putting cache filter first.

    When using Weblogic CacheFilter servlet filter to speed our request. However, cached pages miss
    some HTTP Headers ie: Content-Encoding.
    As a result, if we setup a GZIP filter on most popular static text oriented document like css, html, js, the GZIP filter add a Content-Encoding http header set to gzip. But as CacheFilter forget that header, client receives the correct content-type but not anymore the Content-encoding.
    Steps to Reproduce
    Ask a static file like a .js library and sniff the HTTP headers. Switch the servlet filter order between gzip and CacheFilter, the HTTP header is correctly set but not when putting cache filter first.

  • Parsing out HTTP headers

    I'm writing a simple HTTP client and server. I'm looking for an efficent way to parse out the HTTP headers that the server sends. The code below is working for me at the moment but i don't think it's the correct way of going about it.
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public final class RequestTEST {
        public static void main(String args[]) throws Exception
               final String CRLF ="\r\n";
               try {
                   Socket mySocket = new Socket ("127.0.0.1", 5306 );
                   DataOutputStream out = new DataOutputStream(mySocket.getOutputStream());
                   InputStream in = mySocket.getInputStream();
                   System.out.println("Enter a file name to request");
                   String filename = Console.readString();
                   String request = "GET /"+filename;
                   System.out.println("Sending "+request);
                   out.writeUTF( request );
                   int bytes = 0;
                   boolean header = true;
                   while((bytes = in.read()) != -1 && header)
                        if(bytes==10) //Line Feed LF
                             bytes = in.read();
                             if (bytes==13) //Carriage return CR
                             header=false;
                   System.out.println(bytes);
                   in = mySocket.getInputStream();
                   byte[] buffer = new byte[1024];
                   FileOutputStream oStream = new FileOutputStream(filename);
                   while((bytes = in.read(buffer)) != -1 )
                   System.out.println(bytes);
                oStream.write(buffer, 0, bytes);
                oStream.close();
                   mySocket.close ();
               catch (Exception exp ){
                   exp.printStackTrace();
    }I know the code is a little rough but i'm just developing the idea. Only started it today.
    Any suggestions or tips on the overall approach to this would be much appreciated.

    Maybe use the HttpURLConnection and then getHeaderFields().
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.HttpURLConnection;
    public class URLTester
         private final static String PROTOCOL = "http://";
         public static void main(String args[])
              if ( args.length != 1 )
                   System.out.println("Usage: java URLTester <url>");
                   System.exit(-1);
              String urlString = args[0];
              try
                   //  Create URL object from the URL string
                   URL url = new URL(PROTOCOL + urlString);
                   //  The connection object has information that may be
                   //  retrieved without parsing the data returned
                   HttpURLConnection conn = (HttpURLConnection)url.openConnection();
                   conn.connect();
                   //  Get an input stream from the URLConnection object
                   InputStreamReader isr = new InputStreamReader( conn.getInputStream() );
                   BufferedReader in = new BufferedReader( isr );
                   System.out.println( conn.getHeaderField(0) );
                   int headers = conn.getHeaderFields().size();
                   for (int i = 1; i < headers; i++)
                        System.out.println(conn.getHeaderFieldKey(i)
                             + " : " + conn.getHeaderField(i));
                   String line;
                   while ( (line = in.readLine() ) != null )
                        System.out.println( line );
                   in.close();
              catch(IOException e)
                   System.out.println( e );
    }

  • Get http headers through GenericServlet

    hi ,
    Is it possible to get the http headers through the GenericServlet. I know i can get it through the HttpServlet. Considering that GenericServlet is parent class of HttpServlet I would think that is possible when I get the InputStream - request.getInputStream I should be able to print the headers too. But that does not seem to be happening ? Any information will be appreciated . thanks -sudhir

    Greetings,
    hi ,
    Is it possible to get the http headers through the GenericServlet. I know i can get it through theTechnically, no. Message headers are intended to provide information to the container/encapsulating server relevant to its part in handling the request. Indeed, most headers are not even relevant to the servlet which provides only an "extension" of the server proper. The headers are available in an HttpServlet[Request] primarily because HttpServlets are intended to operate in place of their CGI counterparts (the CGI spec. converts nearly all headers into environment variables...) though not all headers are converted into accessor-enabled object members.
    A GenericServlet, however, is, well, exactly that, "generic". It forms the basis of other protocol-specific implementations (which currently, to my knowledge, includes only HTTP...), and so making those "protocol specific" headers available to an implementation class is the responsibility of the "protocol specific" servlet container.
    However, since you're (presumably) running your "generic servlet" in an HTTP-specific container environment, you can always try casting the ServletRequest object to an HttpServletRequest reference and call getHeader on it. ;)
    HttpServlet. Considering that GenericServlet is parent class of HttpServlet I would think that is
    possibleRefer again to the above.
    when I get the InputStream - request.getInputStream I should be able to print the headers too. But
    that does not seem to be happening ? Any information will be appreciated.Er, no. Input/output streams relate to the body (i.e. the content...) of the message. Headers relate to the meta-data of the message (i.e. its "envelope") - which, again, contains information relevant to the container. That information could be, for example, "routing instructions" - e.g. "Host" or "Referer" headers - or it could be, for example, "handling instructions" - e.g. "Accept-Encoding" or "Cookie" headers.
    In the former case, the headers are mostly of relevance only to the container, though a servlet may also base some part of its processing on them and so they are made accessible through the getHeader method.
    In the latter case, they are not necessarily relevant to either (the container or the servlet) though, when relevant, they are most likely relevant to the servlet - whether implicitly ("Accept-Encoding") or explicitly ("Cookie") - and so are made available either in the same "implicit" fashion (getHeader), or through a more "explicit" API call (getCookies).
    thanks -sudhirRegards,
    Tony "Vee Schade" Cook

  • Print HTTP headers in jsp

    Hi,
    I am completely new to access management.
    I am trying to print the http headers.
    I tried putting jsp page under htdocs folder and tried to access it through OAM HTTP Server.
    Post authentication it only prints the jsp and doesn't print the header information.
    Please tell me where am I wrong.

    Got this working by redirecting to weblogic from OHS. Deployed a jsp application over wls and it printed everything.
    Thanks.

  • Changing http headers using handlers

    Is there anyway to access and set http headers using handlers? I took a look at the documentation and wasn't able to find a way to modify the http headers. Only SOAP related stuff. Need to go more low level.

    Access the header by getting the HttpServletRequest object as follows:
    handleRequest(MessageContext mc)
    Object obj = mc.getProperty("weblogic.webservice.transport.http.request");
    if(obj != null && obj instanceof javax.servlet.ServletRequest) {
                   request = (HttpServletRequest) obj;
    request.getHeader("Name of Header");
    That'll get you the request header.
    I'd imagine you could do the same in a handleResponse method if what your trying to do is set a response header.

Maybe you are looking for