Parsing a http request

i got to parse every http request from the browser in the client machine as a part of my project. i had already posted this query in the forum and got the reply as follows......
*"First you need to put your code between the browser and the network.*
*So your code needs to open a socket on port 80 (the standard http port) and a server socket at the proxy port - you can choose any post but proxies often use 8080.*
*Configure your browser to connect via a proxt using localhost:8080.*
*Then you code has to listen for requests on the server socket and pass them on to port 80, and route the responses back.*
*Once you have that going, you will be able to start to parse the requests."*
But im already connected in a LAN which passes each request through a proxy...... so what should i do now to catch the http requests.......

There can be multiple proxies. Setup your new proxy server to use the existing proxy server, then reconfigure your browser to use the new proxy server.
Also, rather than writing your own proxy server, you should look at downloading an existing one. I believe Apache can be set up as a proxy server. Also I'll bet there are plenty of lightweight proxy servers written in a variety of languages on sourceforge.net. I think there may be one in the Python standard library.

Similar Messages

  • How to send a http request to a non java appln

    I have one legacy web application running which can handle only http request . So I need to connect (using http request) and send my request and get the response, without opening that application in browser.
    Any idea
    1) How to connect to non - java appln from a java appln ?
    2) How to use the Httprequest without displaying the page using browser?

    You can try one of three routes:
    Open a socket and write the HTTP request and parse the HTTP response yourself
    Use java.net.URLConnection
    Use Jakarta Common's HttpClient at jakarta.apache.org- Saish

  • How to Implement HTTP Request Status Code Processing

    I actually have two questions. First, I wondering how to add multiple status code processing to an http request. Secondly, I was wondering how to go about using alternate http requests to different servers in case the primary server is down. What kind of parameter would the program use to determine that the server is unavailable and switch to another server??
    Currently, the program I've written calls an rdf server (http://www.rdfabout.com/sparql) using a sparql query,
    the server returns an xml string, the program parses it, and calculates numbers
    from the string. The program works, but the problem is that the server is down occasionally.
    When the server is down, we need to add calls to another server to
    increase reliability. So, the next task is to call this server:
    http://www.melissadata.com/lookups/ZipDemo2000.asp
    I need to do exactly the same things I did with the rdf server. The
    difference will be constructing a request and a bit different parsing of
    the response.
    current SPARQL query is defined as follows:
    PREFIX dc:  <http://purl.org/dc/elements/1.1/>
    PREFIX census: <http://www.rdfabout.com/rdf/schema/census/>
    PREFIX census1: <tag:govshare.info,2005:rdf/census/details/100pct/>
    DESCRIBE ?table WHERE {
    <http://www.rdfabout.com/rdf/usgov/geo/census/zcta/90292> census:details
    ?details .
    ?details census1:totalPopulation ?table .
    ?table dc:title "SEX BY AGE (P012001)" .
    }current HTTP Request is defined as follows:
    import java.net.*;
    import java.net.URL;
    import java.net.URLConnection;
    import java.io.*;
    import java.io.DataOutputStream;
    import java.io.BufferedReader;
    import java.io.StringReader;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.util.Scanner;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import java.util.Arrays; 
    public class MyConnection
         static Scanner sc = new Scanner(System.in);//allows user to input zipcode
        public static void main(String[] args) throws Exception
             int zip;//zipcode is declared as integer format
            //User defines zip through input
            //proceed to put SPARQL query into string, which is then used to call the server
            String requestPart1 =
            "query=PREFIX+dc%3A++%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E+%0D%0APREFIX+census%3A+%3Chttp%3A%2F%2Fwww.rdfabout.com%2Frdf%2Fschema%2Fcensus%2F%3E+%0D%0APREFIX+census1%3A+%3Ctag%3Agovshare.info%2C2005%3Ardf%2Fcensus%2Fdetails%2F100pct%2F%3E+%0D%0A%0D%0ADESCRIBE+%3Ftable+WHERE+%7B+%0D%0A+%3Chttp%3A%2F%2Fwww.rdfabout.com%2Frdf%2Fusgov%2Fgeo%2Fcensus%2Fzcta%2F";
            String requestPart2 = "" + zip; // zipcode is transformed from int to string format and plugged into SPARQL query here
            String requestPart3 =
            "%3E+census%3Adetails+%3Fdetails+.+%0D%0A+%3Fdetails+census1%3AtotalPopulation+%3Ftable+.+%0D%0A+%3Ftable+dc%3Atitle+%22SEX+BY+AGE+%28P012001%29%22+.+%0D%0A%7D%0D%0A&outputMimeType=text%2Fxml";
            String response = "";
            URL url = new URL("http://www.rdfabout.com/sparql");//designates server to connect to
            URLConnection conn = url.openConnection();//opens connection to server
            // Set connection parameters.
            conn.setDoInput (true);
            conn.setDoOutput (true);
            conn.setUseCaches (false);
            // Make server believe we are form data…
            conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
            DataOutputStream out = new DataOutputStream (conn.getOutputStream ());
            // Write out the bytes of the content string to the stream.
            out.writeBytes(requestPart1 + requestPart2 + requestPart3);
            out.flush ();
            out.close ();
            // Read response from the input stream.
            BufferedReader in = new BufferedReader (new InputStreamReader(conn.getInputStream ()));
            String temp;
            while ((temp = in.readLine()) != null)
                 response += temp + "\n";
            temp = null;
            in.close ();
            //parsing stuff is taken care of after here
    }What remains now is to:
    1) add status code processing: notify if the server is not available, ect.
    2) add ability to connect to additional server if primary server is down.
    I'm thinking an if/else statement, which I've tried a few different ways,
    but I don't quite know how to implement that...Also trying to add the
    status code processing/error handling, but I'm not sure how to do that
    for multiple/different errors, such as 404, 503, 504, ect.. try/catch statements?
    So yeah, just been scratching my head on this trying to figure out how to work it..
    If you can help me out on this, I've been going nuts trying to figure this out...

    I think your issue comes form the fact that you are not casting URLConnection to HttpURLConnection.
    Doing the cast would allow you to use getResponseCode() - among other methods - and test for a response different than 200.
    Read: [http://mindprod.com/jgloss/urlconnection.html|http://mindprod.com/jgloss/urlconnection.html]

  • Apex_web_service.make_request throws ORA-29273: HTTP request failed. How to get the soap fault XML?

    I am trying to call a web service using apex_web_service.make_request function.
    It works fine when all the parameters are correct. However, when something is wrong in the request XML, it throws an exception instead of returning the soap:fault message:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1369
    ORA-29269: HTTP server error 500 - Internal Server Error
    ORA-06512: at "APEX_040200.WWV_FLOW_WEBSERVICES_API", line 130
    ORA-06512: at line 37
    I need to get back the soap:fault and parse it to display a proper error message to the users (e.g. what was wrong with the input), yet the call throws an exception instead of returning it.
    I am trying the exact same request from soapUI and it returns me the soap:fault below:
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
       <soap:Body>
          <soap:Fault>
             <soap:Code>
                <soap:Value>soap:Receiver</soap:Value>
             </soap:Code>
             <soap:Reason>
                <soap:Text xml:lang="en">Fault occurred while processing.</soap:Text>
             </soap:Reason>
             <soap:Detail>
                <ns1:RegisterFault xmlns:ns1="http://www.exchangenetwork.net/wsdl/register/1">
                   <description xmlns:ns2="http://www.exchangenetwork.net/wsdl/register/1">The security token has expired.</description>
                   <errorCode xsi:type="ns2:RegisterErrorCode" xmlns:ns2="http://www.exchangenetwork.net/wsdl/register/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">E_TokenExpired</errorCode>
                </ns1:RegisterFault>
             </soap:Detail>
          </soap:Fault>
       </soap:Body>
    </soap:Envelope>
    How do I get this back from APEX?
    Thanks!

    Hi,
       I've just run into this.
       If the webservice returns a fault, such as:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>INVALID_REQUESTER_INFO</faultstring></soap:Fault></soap:Body></soap:Envelope>
       then the user gets presented with an unfriendly error message and there's no chance to output a more friendly one.
       The response above is seen when testing the webservice, when run from the Form/Report page, we get something like:
    soap:ServerINVALID_REQUESTER_INFO
    Contact your application administrator.
    OK
       When OK button is clicked everything is rolled back and we don't even get the fault XML.
       It would be good if Apex could be optionally set to not give the unfriendly messages, so that we could code such a message ourselves.
       Unless anybody has a workaround for this, I guess that I'll have to see if I can code this in PLSQL.
    Regards,
    Chris

  • Most Http Requests going into endless loop

    Hello,
    We are currently using JSF 1.1 with Oracle ADF Faces and running on a JBoss 4.0.3 application server running Java 1.5. We have been developing a large application for months with the usual various small problems. This week we've had a large number of continuous users on the system and have experienced a phenomenon where our Http Request threads will one-by-one fall into endless loops consuming alot of resources. This has happened with up to 30 threads before we were forced to restart the server.
    All the threads are stuck in the same piece of JSF code. And looking at the thread dump stack traces, some are in the ApplyRequestValues Phase while others are in the RenderResponse Phase.
    Here are two dumps from two threads, each one stuck in a different phase but you can see they are hung at the same spot in the code, apparently in an endless loop because the CPU times for these threads just keep increasing. Like they are continuously reading from the map, endlessly.
    Thread: http-0.0.0.0-8080-1 : priority:5, demon:true, threadId:79, threadState:RUNNABLE, threadLockName:null
        java.util.HashMap.get(HashMap.java:329)
        com.sun.faces.el.impl.JsfParser.parse(JsfParser.java:15)
        com.sun.faces.el.ValueBindingImpl.getNode(ValueBindingImpl.java:66)
        com.sun.faces.el.ValueBindingImpl.isReadOnly(ValueBindingImpl.java:145)
        oracle.adfinternal.view.faces.renderkit.core.xhtml.EditableValueRenderer.getReadOnly(EditableValueRenderer.java:211)
        oracle.adfinternal.view.faces.renderkit.core.xhtml.EditableValueRenderer.wasSubmitted(EditableValueRenderer.java:109)
        oracle.adfinternal.view.faces.renderkit.core.xhtml.EditableValueRenderer.decode(EditableValueRenderer.java:48)
        oracle.adfinternal.view.faces.renderkit.core.xhtml.InputLabelAndMessageRenderer.decode(InputLabelAndMessageRenderer.java:34)
        oracle.adf.view.faces.component.UIXComponentBase.__rendererDecode(UIXComponentBase.java:937)
        oracle.adf.view.faces.component.UIXComponentBase.decode(UIXComponentBase.java:577)
        oracle.adf.view.faces.component.UIXComponentBase.processDecodes(UIXComponentBase.java:676)
        oracle.adf.view.faces.component.UIXEditableValue.processDecodes(UIXEditableValue.java:269)
        oracle.adf.view.faces.component.UIXComponentBase.decodeChildrenImpl(UIXComponentBase.java:818)
        oracle.adf.view.faces.component.UIXComponentBase.decodeChildren(UIXComponentBase.java:803)
        oracle.adf.view.faces.component.UIXForm.processDecodes(UIXForm.java:53)
        javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:880)
        javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:306)
        com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:79)
        com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
        com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
        javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        com.paetec.paonline.web.PAStatisticsFilter.doFilter(PAStatisticsFilter.java:68)
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        com.paetec.paonline.web.PATransactionFilter.doFilter(PATransactionFilter.java:353)
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        com.paetec.paonline.web.PALoggingFilter.doFilter(PALoggingFilter.java:102)
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
        oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
        oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
        oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
        org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
        org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
        org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:481)
        org.apache.catalina.valves.RequestDumperValve.invoke(RequestDumperValve.java:150)
        org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
        org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
        org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
        java.lang.Thread.run(Thread.java:595)
    Thread: http-0.0.0.0-8080-2 : priority:5, demon:true, threadId:85, threadState:RUNNABLE, threadLockName:null
        java.util.HashMap.get(HashMap.java:329)
        com.sun.faces.el.impl.JsfParser.parse(JsfParser.java:15)
        com.sun.faces.el.ValueBindingFactory.createValueBinding(ValueBindingFactory.java:44)
        com.sun.faces.application.ApplicationImpl.createValueBinding(ApplicationImpl.java:263)
        oracle.adf.view.faces.webapp.UIXComponentTag.createValueBinding(UIXComponentTag.java:357)
        oracle.adf.view.faces.webapp.UIXComponentTag.setProperty(UIXComponentTag.java:139)
        oracle.adfinternal.view.faces.taglib.UIXSelectItemTag.setProperties(UIXSelectItemTag.java:41)
        oracle.adfinternal.view.faces.taglib.core.input.CoreSelectItemTag.setProperties(CoreSelectItemTag.java:68)
        oracle.adf.view.faces.webapp.UIXComponentTag.setProperties(UIXComponentTag.java:126)
        javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1008)
        javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1027)
        javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:740)
        javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:429)
        oracle.adf.view.faces.webapp.UIXComponentTag.doStartTag(UIXComponentTag.java:85)
        org.apache.jsp.main.financial_jsp._jspx_meth_af_selectItem_1(org.apache.jsp.main.financial_jsp:2221)
        org.apache.jsp.main.financial_jsp._jspx_meth_af_forEach_7(org.apache.jsp.main.financial_jsp:2197)
        org.apache.jsp.main.financial_jsp._jspx_meth_af_selectOneChoice_1(org.apache.jsp.main.financial_jsp:2171)
        org.apache.jsp.main.financial_jsp._jspService(org.apache.jsp.main.financial_jsp:859)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
        org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
        org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
        org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
        com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
        com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
        oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157)
        com.paetec.paonline.web.app.PAOViewHandler.renderView(PAOViewHandler.java:114)
        com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
        com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
        com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
        javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        com.paetec.paonline.web.PAStatisticsFilter.doFilter(PAStatisticsFilter.java:68)
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        com.paetec.paonline.web.PATransactionFilter.doFilter(PATransactionFilter.java:353)
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        com.paetec.paonline.web.PALoggingFilter.doFilter(PALoggingFilter.java:102)
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
        oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
        oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
        oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
        org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
        org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
        org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:481)
        org.apache.catalina.valves.RequestDumperValve.invoke(RequestDumperValve.java:150)
        org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
        org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
        org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
        java.lang.Thread.run(Thread.java:595)

    I wanted to mention, when it occurs while rendering the page (as can be seen from the stack traces) that its occurring when rendering a tag. Here is one of the tags in my JSP page, specifically one where I think it could be hanging. Does anyone see anything fishy? This tag is an Oracle ADF tag and the "param" variable is a local loop variable. I jus recently added the " || !financialBean.profitAssistant.paDataEditable" part but I don't know if thats the cause of the problem. This does not occur everytime, it just seems like when there is a good amount of load on the system.
    <af:inputText simple="true"
         id=         "tlInputTextParam"
         value=      "#{param.textValue}"
         rendered=   "#{param.rendered}"
         disabled=   "#{param.disabled  || !financialBean.profitAssistant.paDataEditable}"
         styleClass= "#{param.styleClass}"
         inlineStyle="#{param.style}"
         columns=    "#{param.componentSize}"
         onchange=   "#{param.onChangeJS}"
         onclick=    "#{param.onClickJS}"
         onkeydown=  "#{param.onKeyDownJS}"
         onfocus=    "#{param.onFocusJS}"
         onblur=     "#{param.onBlurJS}"
         onmouseover="try{this.title='#{param.description}';#{param.onMouseOverValueJS}}catch(e){}"
         />

  • Doing an http request in servlet

    What's the code to do an http request in a servlet? I mean I have my servlet printing out links, but if I want it to use those links instead and print out what is contained on the following pages, I would need to do some kind of request and parse the response myself correct?

    What's the code to do an http request in a servlet?
    I mean I have my servlet printing out links, but if I
    want it to use those links instead and print out what
    is contained on the following pages, I would need to
    do some kind of request and parse the response myself
    correct?Correct. Thought about something like this:
    URL servletUrl = new URL("http://www.google.com/search?q=how+to+call+a+servlet+from+a+servlet");
    InputStream in = servletUrl.getInputStream();Actual coding may vary.

  • Http.request containing file.

    If I have a web page with a file upload form.
    And then server side reads the core HTTP-Request data, how can i then take out the file from that.
    Ofcause i can see it a little bit my self, my problem is if the file contains the 0D 0A how can I then know when the file ends.
    e.g. If i upload a file containing the following 6 bytes: 22 22 0D 0A 22 22 called "22Linjeskift22.dat". The http request will look as follows:
    000000000 : 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D  ; ----------------
    000000016 : 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 37 64 35  ; -------------7d5
    000000032 : 31 37 37 33 32 30 31 36 30 0D 0A 43 6F 6E 74 65  ; 177320160XXConte
    000000048 : 6E 74 2D 44 69 73 70 6F 73 69 74 69 6F 6E 3A 20  ; nt-Disposition:
    000000064 : 66 6F 72 6D 2D 64 61 74 61 3B 20 6E 61 6D 65 3D  ; form-data; name=
    000000080 : 22 5F 5F 56 49 45 57 53 54 41 54 45 22 0D 0A 0D  ; "__VIEWSTATE"XXX
    000000096 : 0A 64 44 77 74 4E 6A 55 30 4D 7A 63 79 4D 54 6B  ; XdDwtNjU0MzcyMTk
    000000112 : 31 4F 7A 73 2B 58 54 32 54 44 71 78 4C 2F 4E 52  ; 1Ozs+XT2TDqxL/NR
    000000128 : 6A 67 48 4A 39 75 55 42 4C 38 57 69 35 36 71 59  ; jgHJ9uUBL8Wi56qY
    000000144 : 3D 0D 0A 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D  ; =XX-------------
    000000160 : 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D  ; ----------------
    000000176 : 37 64 35 31 37 37 33 32 30 31 36 30 0D 0A 43 6F  ; 7d5177320160XXCo
    000000192 : 6E 74 65 6E 74 2D 44 69 73 70 6F 73 69 74 69 6F  ; ntent-Dispositio
    000000208 : 6E 3A 20 66 6F 72 6D 2D 64 61 74 61 3B 20 6E 61  ; n: form-data; na
    000000224 : 6D 65 3D 22 4D 41 58 5F 46 49 4C 45 5F 53 49 5A  ; me="MAX_FILE_SIZ
    000000240 : 45 22 0D 0A 0D 0A 31 30 30 30 0D 0A 2D 2D 2D 2D  ; E"XXXX1000XX----
    000000256 : 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D  ; ----------------
    000000272 : 2D 2D 2D 2D 2D 2D 2D 2D 2D 37 64 35 31 37 37 33  ; ---------7d51773
    000000288 : 32 30 31 36 30 0D 0A 43 6F 6E 74 65 6E 74 2D 44  ; 20160XXContent-D
    000000304 : 69 73 70 6F 73 69 74 69 6F 6E 3A 20 66 6F 72 6D  ; isposition: form
    000000320 : 2D 64 61 74 61 3B 20 6E 61 6D 65 3D 22 75 73 65  ; -data; name="use
    000000336 : 72 66 69 6C 65 22 3B 20 66 69 6C 65 6E 61 6D 65  ; rfile"; filename
    000000352 : 3D 22 43 3A 5C 44 6F 63 75 6D 65 6E 74 73 20 61  ; ="C:\Documents a
    000000368 : 6E 64 20 53 65 74 74 69 6E 67 73 5C 65 73 6B 65  ; nd Settings\eske
    000000384 : 5C 4D 79 20 44 6F 63 75 6D 65 6E 74 73 5C 4D 79  ; \My Documents\My
    000000400 : 20 50 69 63 74 75 72 65 73 5C 75 70 6C 6F 61 64  ;  Pictures\upload
    000000416 : 54 65 73 74 5C 32 32 4C 69 6E 6A 65 73 6B 69 66  ; Test\22Linjeskif
    000000432 : 74 32 32 2E 64 61 74 22 0D 0A 43 6F 6E 74 65 6E  ; t22.dat"XXConten
    000000448 : 74 2D 54 79 70 65 3A 20 74 65 78 74 2F 70 6C 61  ; t-Type: text/pla
    000000464 : 69 6E 0D 0A 0D 0A 22 22 0D 0A 22 22 0D 0A 2D 2D  ; inXXXX""XX""XX--
    000000480 : 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D  ; ----------------
    000000496 : 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 37 64 35 31 37  ; -----------7d517
    000000512 : 37 33 32 30 31 36 30 2D 2D 0D 0A  ; 7320160--XXIf then i want to extract the file from this data, then i don�t know how to handle this situation where the file itself contains the 0D 0A, data.
    What can i Do,
    Best Regards, and thx if someone can help.

    I would encourage you to not re-invent the wheel but rather use something like Apache Commons FileUpload (http://jakarta.apache.org/commons/fileupload/) to parse the HTTP stream.

  • SBL-ODU-01008 The HTTP request did not contain well-formed XML.

    I am trying to invoke the activity webservice using Msxml2.XMLHTTP.4.0 through PowerBuilder...
    I receive the following error when executing the code below: SBL-ODU-01008 The HTTP request did not contain well-formed XML.
    ls_post_url = "https://secure-ausomxxxx.crmondemand.com/Services/Integration/Activity;"
    ls_response_text = "jsessionid=" + sesId + ";"
    ls_post_url = ls_post_url + ls_response_text
         loo_xmlhttp.open ("POST",ls_post_url, false)
    // loo_xmlhttp.setRequestHeader("Content-Length", 200 )      
    // loo_xmlhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8" )      
    // loo_xmlhttp.setRequestHeader("Accept", "text/xml" )           
    // loo_xmlhttp.setRequestHeader("COOKIE", left(cookie,pos(cookie,";",1)-1) )
    //     loo_xmlhttp.setRequestHeader("COOKIE", left(cookie,pos(cookie,";",1)-1) )
         ls_post_url2 = "document/urn:crmondemand/ws/ecbs/activity/10/2004:ActivityQueryPage"
         loo_xmlhttp.setRequestHeader("SOAPAction", ls_post_url2)     
         loo_xmlhttp.send()
    If I uncomment the setRequestHeader info, then I get a different error:
    ls_post_url = "https://secure-ausomxxxx.crmondemand.com/Services/Integration/Activity;"
    ls_response_text = "jsessionid=" + sesId + ";"
    ls_post_url = ls_post_url + ls_response_text
         loo_xmlhttp.open ("POST",ls_post_url, false)
    loo_xmlhttp.setRequestHeader("Content-Length", 200 )      
    loo_xmlhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8" )      
    loo_xmlhttp.setRequestHeader("Accept", "text/xml" )           
    loo_xmlhttp.setRequestHeader("COOKIE", left(cookie,pos(cookie,";",1)-1) )
         loo_xmlhttp.setRequestHeader("COOKIE", left(cookie,pos(cookie,";",1)-1) )
         ls_post_url2 = "document/urn:crmondemand/ws/ecbs/activity/10/2004:ActivityQueryPage"
         loo_xmlhttp.setRequestHeader("SOAPAction", ls_post_url2)     
         loo_xmlhttp.send()
    SBL-ODU-01007 The HTTP request did not contain a valid SOAPAction header. The value of the header was
    I am unsure what I am missing in order to invoke the web service. If anyone can help I would truly appreciate it.
    Thanks

    Hi,
    I tried the SOAP request you provided and got a different error response:
    <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Client</faultstring><detail><ErrorCode>SBL-ODU-01008</ErrorCode><ErrorMessage>The HTTP request did not contain well-formed XML. An attempt to parse it produced the following error: Unsupported wsse:Password Type. Valid Value: http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText</ErrorMessage></detail></soap:Fault></soap:Body></soap:Envelope>
    After changing the Password Type from:
    Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wssusername-token-profile-1.0#PasswordText">hijklmno</wsse:Password>
    to:
    Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">hijklmno</wsse:Password>
    The request was successful.
    Please let me know if this resolves your issue.
    Thanks,
    Sean
    <?xml version='1.0' encoding='ISO-8859-1'?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header>
    <wsse:Security
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
    soapenv:mustUnderstand="1">
    <wsse:UsernameToken>
    <wsse:Username>abcdefg</wsse:Username>
    <wsse:Password
    Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">hijklmno</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soapenv:Header>
    <soapenv:Body>
    <q0:ContactWS_ContactQueryPage_Input
    xmlns:q0="urn:crmondemand/ws/contact/">
    <q1:ListOfContact xmlns:q1="urn:crmondemand/xml/Contact/Query">
    <Contact>
    <ContactType>='Customer'</ContactType>
    <ContactFirstName>='Fred'</ContactFirstName>
    <IntegrationId />
    </Contact>
    </q1:ListOfContact>
    </q0:ContactWS_ContactQueryPage_Input>
    </soapenv:Body>
    </soapenv:Envelope>
    Edited by: Sean Duffy on Jun 4, 2010 9:38 AM

  • Parsing WBXML POSt Request Data

    Hi!
    I want to read WBXML formatted SyncML data sent by a Mobile Device
    There is a servlets at server side which receives the http request of the
    device and tries to read the contents of the POST request data by using .
    Request.getInputStream(); method....
    I then Pass this data to a method "wbxmlToXml(req.getInputStream().toString().getBytes()) "
    I am using kxml as XML parsing the Initial Lines of the method are as following
    public static String wbxmlToXml(byte[] wbxml) throws IOException {
    String xml = null;
    try {
    // Construct an InputStream on byte[] to be used by WbxmlParser
    ByteArrayInputStream in = new ByteArrayInputStream(wbxml);
    AbstractXmlParser parser; //org.kxml.parser.AbstractXmlParser
    parser = new WbxmlParser(in);
    // Construct a DOM Document to parse WBXML
    Document document = new Document();
    document.parse(parser);------------------> Error :java.io.IOException: id 54 undef.
    I get "java.io.IOException: id 54 undef." error as mentioned above.
    Please somebody guide regarding this problem
    Regards,
    Maneesha

    The problem is solved! The error was in the post request. At the end of the query parameter was . For spa504,
    spa303,spa508 it was not important, but for spa525 important. Once I removed this parameter from the request, the phone immediately began to dial.
    Thanks for the help!
    That's a valid request for spa525G2:
    http://192.168.2.113/CGI/Execute
    POST / CGI / Execute HTTP/1.1
    Host: 192.168.2.113
    Accept: * / *
    Content-Type: text / xml; charset = "UTF-8"
    Content-Length: 92
    XML =

  • Save HTML page of HTTP request in table

    Hello,
    I use Oracle 11.2.0.3. I want to Save HTML page of HTTP request in table. I used this:
    DECLARE
      l_http_request   UTL_HTTP.req;
      l_http_response  UTL_HTTP.resp;
    BEGIN
      l_http_request  := UTL_HTTP.begin_request('http://www.google.com');
      l_http_response := UTL_HTTP.get_response(l_http_request);
    insert into sms_response
    (STATUS_CODE , REASON_PHRASE, HTTP_VERSION  )
    values
    (l_http_response.status_code,l_http_response.reason_phrase, l_http_response.http_version );
      UTL_HTTP.end_response(l_http_response);
    END;
    This is the table definition:
    CREATE TABLE "SMS_RESPONSE"
      ( "STATUS_CODE" NUMBER,
    "REASON_PHRASE" VARCHAR2(256),
    "HTTP_VERSION" VARCHAR2(64),
    "MSG_BODY" VARCHAR2(300)
    So, I need to save the HTML response in the column MSG_BODY. How can I do it ?
    Regards,

    You can retrieve any http document on the Internet. For example you could retrieve "http://www.ni.com/images/legal/us/nilogo1.gif" which is LabVIEW image from the NI Website. When you download a web page with this tool, you only get the html document, because that is what you asked for. This document embeds images, which most web browsers will download automatically and place within the formatted page. What you will need to do is retrieve the html document, parse it for all embedded image files and then download them one at a time. This is sort of what a "web spider"/"web crawler"/"web bot" does, except they mostly just parse out other pages and then visit those sites collecting information of interest.
    Best of Luck - Jim

  • Null values in Weblogic 7 HTTP Request Parameters

    It appears weblogic 7 handles nulls passed from the request object
              differently than the previous versions. In my jsp's, if a parameter
              was not passed, I used to get a java null value:
              String s = request.getParameter("something_not_passed");
              if(s == null) {
              //do stuff
              Now, weblogic seems to return the string literal "null" so I would
              have to use:
              if(s.equals("null")) {
              //do stuff
              Is this a bug or am I missing something?
              Thanks,
              Paul
              

    HI, Thanks for the reply. I am using getString() to fetch values.
    DO u think its due to driver incompatibility?? Because, BEA claims WL7.0 supports
    Oracle 8.1.7 onwards!
    Thanks,
    Yogesh
    Joseph Weinstein <[email protected]> wrote:
    >
    >
    Yogesh wrote:
    Hi, I have ported my web application from weblogic 5.1 to weblogic 7.Set up is weblogic
    7 with database Oracle 8.1.6 and i am using OCI driver for DB connectionpool. I
    am facing some problems like, the values that were retrieved as blanksin weblogic
    5.1 are being retrieved as null(string literal value) in 7. The same thinghappens
    when parameters were passed through HTTP request object. Any idea aboutthis?
    Thanks,
    YogeshHi. This sounds like a driver bug. Let's isolate it to a simple standalone
    program
    that uses our driver to select null data. How are you asking for the object?
    GetString(),
    GetObject()?
    Joe

  • Problem in sending HTTP request to the server.

    Hi,
    i dveloped an ant script for sar deployment.
    i deployed a sar to my local soa server with ant script. it got deployed succesfully..
    but when i try to deploy to a remote server, getting the below error..
    "Problem in sending HTTP request to the server. Please make sure the server is up and/or check standard HTTP response code for 404"
    but the server is up and runnig and i am able to ping it from my machine and also access the console...
    below is my script
    build.properties
    wn.bea.home=C:/Oracle/Middleware
    all.needed.jars.path=D:/SourceCode/neededJAR
    oracle.soa.home=C:/Oracle/Middleware/Oracle_SOA1
    java.passed.home=C:/Oracle/Middleware/jdk160_24
    #Deployment environment
    deployment.plan.environment=DEV
    #Deploy Action
    deployAction =redeploy
    #credentials
    user=weblogic
    password=welcome1
    #For Composite deployment
    serverURL=http://10.177.154.6:7001
    forceDefault=true
    server=10.177.154.6
    port=7001
    sarLocation=D:/SourceCode/JAR
    build.xml
    <?xml version="1.0" encoding="iso-8859-1"?>
    <project name="soaDeployAll" default="deployAll">
         <echo>basedir ${basedir}</echo>
         <property environment="env"/>
    <echo>current folder ${basedir}</echo>
         <property file="${basedir}/build.properties"/>
         <taskdef resource="net/sf/antcontrib/antlib.xml">
         <classpath>
              <pathelement location="${all.needed.jars.path}/ant-contrib.jar"/>           
         </classpath>
         </taskdef>
         <target name="init">
              <tstamp>
                   <format property="timestamp" pattern="yyyy-MM-dd_HH-mm-ss"/>
              </tstamp>
              <property name="build.log.dir" location="${basedir}/buildlogs"/>
              <mkdir dir="${build.log.dir}"/> <property name="build.log.filename" value="build_${timestamp}.log"/>
              <record name="${build.log.dir}/${build.log.filename}" loglevel="verbose" append="false"/>
              <echo message="Build logged to ${build.log.filename}"/>
         </target>
         <target name="deployAll" depends="init">
         <echo>Deploy for environment ${deployment.plan.environment}</echo>
         <antcall target="deployAllComposites"/>
    </target>
    <!-- Following Actions are performed for Composite files in Managed Server - Deploy,Redeploy -->
         <target name="deployAllComposites" depends="init">
         <foreach target="deployComposites" param="Files">
              <fileset dir="${sarLocation}" casesensitive="no" includes="*.jar"/>
         </foreach>
         </target>
         <target name="deployComposites" depends="init">
         <basename file="${Files}" property="basename"/>
    <echo>Deploy Project ${basename} for environment ${deployment.plan.environment}</echo>
              <if>
                   <equals arg1="${deployAction}" arg2="deploy" />
                   <then>
                        <echo message="Deploying composites in Managed server........." />
                        <ant antfile="${oracle.soa.home}/bin/ant-sca-deploy.xml" inheritAll="true" target="deploy">
                             <property name="serverURL" value="${serverURL}"/>
                             <property name="user" value="${user}"/>
                             <property name="password" value="${password}"/>
                             <property name="overwrite" value="false"/>
                             <property name="forceDefault" value="${forceDefault}"/>
                             <property name="sarLocation" value="${sarLocation}/${basename}"/>
                        </ant>
                   </then>
                   <else>
                        <echo message="ReDeploying composites in Managed server........." />
                        <ant antfile="${oracle.soa.home}/bin/ant-sca-deploy.xml" inheritAll="true" target="deploy">
                             <property name="serverURL" value="${serverURL}"/>
                             <property name="user" value="${user}"/>
                             <property name="password" value="${password}"/>
                             <property name="overwrite" value="true"/>
                             <property name="forceDefault" value="${forceDefault}"/>
                             <property name="sarLocation" value="${sarLocation}/${basename}"/>                         
                        </ant>
                   </else>
              </if>
    </target>
    </project>
    please help....

    Hi,
    Give the serverURL as http://<host>:<managed.server.port>/soa-infra/deployer and try.
    e.g . http://10.177.154.6:8001/soa-infra/deployer
    Regards,
    Neeraj Sehgal

  • How to send a http-request from abap?

    I want to send a xml file through a http-request ,what should i do?

    Welcome to SDN
    you can use cl_http_client class to do that. search the abap general forum with key word cl_http_client and you will find lot of examples.
    Regards
    Raja

  • How to construct a faces request from a http request?

    I wonder how FacesServlet.service determines whether it should be calling LifecycleImpl.execute in oppose to calling LifecycleImpl.render?
    Basically, I'm trying to construct a http request that would go through the decode method of my UIComponent. However, it seems that my request has always been treated as a non-faces request, where it goes to the render face directly.
    Does anyone know how do I need to construct my http request so that it'll be recgonized as a faces request?
    Anyone knows where i can download the source code for FacesServlet?
    thanks!

    Sorry, are you saying that FacesServlet ALWAYS call execute before render even if it's the first request?
    What I experienced is that for the first request, execute isn't called, and it goes directly to render.
    And if I use the html form submit on the 2nd request, it does go to execute, then render.
    However, if i construct another http request, it'll act like a first request, where it doesn't go through the execute, but striaght to render.
    This is what I set in web.xml:
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup> 1 </load-on-startup>
    </servlet>
    <!-- Faces Servlet Mapping -->
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    I call my jsp using http://server:8080/faces/my.jsp, and I'm using tomcat 5. Any help would be appreciated.

  • How to pass a HTTP request from a simple java class

    Is it possible to pass an HTTP request from a simple java class.if yes how?

    Is it possible to pass an HTTP request from a simple
    java class.if yes how?If you're talking about creating a HttpRequest object and passing it to a servlet, that would be a red flag to me that your design is flawed. You shouldn't have to do that - the application server (Tomcat, Weblogic, etc) should be the only thing that has to worry about creating that kind of object and passing it to you.

Maybe you are looking for

  • Hard drive filling up, can I use external hard drive for my library?

    Hello all! My hard drive on my Sony laptop only has 30G harddrive, and as I am downloading my Cd collection and buy it tunes videos etc., into my ipod, my computer is slowing down and overloading because of all the other programs I have in there. So

  • Warning page on Cisco Wireless Lan Controller for guest access

    Hi, We have an Cisco wireless LAN controller 4400 in our organization, and lots of guest using our Wi-Fi network. I would like to configure a warning and terms and condition page when guest using first time our network. Can you please let me know is

  • How to get the restriction pass code for my iPad

    How to get restriction pas score for my ipad

  • Unable to connect to a specific database

    Hi, I have Oracle Client 9IR2 installed on my machine and I'm unable to connect to a specific Oracle9IR2 database on the network. I can connect to the same database if i log into another machine on the network with the same tnsnames.ora file. I can a

  • Cannot connect to 127.0.0.1 on port 7101.

    Hello Everyone, I'm using JDeveloper 11.1.2.3. I created a mobile application by which i do simple search in the database. I successfully created a web service and run it on the integrated server. Everything is great! I'm even able to start the servi