GZIPPed  XMLEncoded HttpRequest post parameter!

Hi All,
I'm devolping a standalone java application that builds some kinds of objects and needs to send them to a servlet in xml fashion (via HttpUrlConnection with "post" method).
My problem is that now this objects are too big so i thought: no problem let's gzip them.....!
Hence I wrote a method for gzipping xml encoded objects but now, using the same method that until yesterday made http requests by replacing the old xml string whith the new gzipped string url encoded (UTF-8) , doesn't work and I can't guess why......#][#@!
Some one can help me please?
Many thanks in advance.

You're turning the output from GZIP into a String? That's not a good idea. If you really want to turn it into a String, I'd suggest that you use hex encoding. The servlet would in turn have to decode it into a byte array which you could then filter through GZIP again, probably with a ByteArrayOutputStream, to uncompress it. If you want to save some time, there is a Jakarta Commons project that has hex encoding capabilities. I think the project is actually called encoding, not 100% sure though :)

Similar Messages

  • How to retrieve Post Parameter

    Hi All,
    I am new to JSF..I need to retrieve Post parameters from plain HTML pages.
    Once i receive the post parameter in JSF then i need to validate one of the parameter and redirect user to diffrent pages based on the parameter value.
    What is the best way doing this scenario..
    The source of the parameters are from HTML pages comes from diffrent locations..
    Any help would be highly appriciated..

    Try the following code snippet to access request parameters:
    FacesContext facesContext = getFacesContext();
    ExternalContext externalContext = facesContext.getExternalContext();
    Map requestMap = externalContext.getRequestMap();Now that you have the request map, you can retrieve any of the request parameters using:
    <ObjectType> parameter = <ObjectType>requestMap.get(<ParameterName>);where <ObjectType> is the data type of the request parameter and <ParameterName> is the name of the request parameter.

  • Passing get or post parameter with getUrl()

    Hello I need to pass get or post parameter with getUrl, the
    help say that:
    firstName = "Gus";
    lastName = "Richardson";
    age = 92;
    getURL("
    http://www.macromedia.com",
    "_blank", "GET");
    but it dosen't work! I dont anderstan where I have to tell to
    getUrl wicht variavle it have to send in the get? Where can I tell
    to the getUrl function, the variables to send are firstName,
    lastName and age, per example?
    Thanks, can you

    I want to send the variables to an html page, but I don't
    know how to do this? Can you help me please?

  • Get all POST parameter

    Hi
    I want to log every call to my procedure which are coming from the web (over Apache and mod_plsql).
    To save all important data I want to save the procedure name and the HTTP parameter into a logfile.
    I must do this in the session validation procedure so I have no access to the parameters passed to the previously called procedure.
    If I would only use GET parameter then it would not be a problem, because I could get the whole query string from the environment variable QUERY_STRING.
    But how do I get the parameter passed with POST?
    Unfortunately I cannot change anything on the server (neither Apache nor mod_plsql).
    Is there any possibility to get the POST parameter with PL/SQL?
    Any hints are appreciated!
    Thanks!

    I'm sure the answer is in the Oracle mod_plsql manual:
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14337/toc.htm
    Cheers,
    Colin

  • Resume Plug POST Parameter

    Hi,
    Can we read the resumeURL before calling suspend ? If yes how ?
    On application resume, Can we read the POST parameter value immediately on resume, returned by external application and on which method we can read them ?
    Vinit

    Now i understud you.
    To get the post parameters from resume plug... you need to create in this plug a few parameters with the same name of the post parameters.
    regards,
    Angelo

  • Reading post parameter

    Hello,
    could anyone give me a hint how to populate a text field with the content of the post parameter? For get paramters it works very easy with the specifix syntax of the URL (www.apexwebpage/...:paramter_names:parameter_values:..), however there are some severe length limitations (it throws an exception if the url is longer than 1050 characters or so).
    Many thanks for your help
    Lukasz

    I'm not sure what you mean. Are you trying to send a huge text item from page to page? If you can't store it in the database via a page process, then you can look at Collections to store temporary data:
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/advnc_collections.htm#BABFFJJJ
    regards,
    Malcolm.

  • Set post parameter to request

    Hi,
    i want set a parameter to my request, e.g. a message.
    This paramter must be represented in the request as a post-paramter, e.g. like a simple form with post-methode would do it.
    Ho can i implement that in my Servlet?
    Thanks Daniel :-)

    Hi dniklas,
    Use request.setAttribute(java.lang.String name, java.lang.Object o)Stores an attribute in this request. Attributes are reset between requests. This method is most often used in conjunction with RequestDispatcher.
    Thanks,
    Sanath Kumar

  • Field Account Determination value in Posting Parameter tabpage

    Hi RE-Gurus,
    I have a specific requirement.
    In a given RE-FX Lease Out Contract, we enter Account Determination Value on the Posting parameters tab page which is responsible for determination of the G/L account which shall be posted at the time of carrying out Periodic Posting.
    The requirement is that i want to control the change authorization for the same for specific set of users.
    This means if i have 10 users who have Contract change authorization, only one of them shall have authorization to change the Account Determination Value on the Posting parameters tab page and rest 9 users shall not be allowed to change the Account Determination Value.
    I hope i m clear in stating my requirement.
    Plz revert back ASAP.
    Thanks,
    Pankaj

    Hi,
    please have a look at SAP note 1005831 which provides BAdI BADI_RECA_AUTH_CHECK for implementing customer specific authorization checks for real estate objects. The BADI provides also an example implementation for your reference.
    Regards,
    Franz

  • How can I execute a DOS console application in TS and how to post parameter to ti?

    Hi
    I have a DOS application which is used to program SN to product,
    When I run the application out of TS, 3 actions need to be done, first is to enter the SN then press "Enter", second is to enter the ComCode and then press "Enter",then the app will ask to confirm "Y" or "N".
    Now the SN and ComCode is kept in locals, how can I invoke such an app to implement the process and pass all parameter to it.
    *The best Chinese farmer*

    Hi Farmer
    Now I have no environment to implement your idea due to the running product line.
    I have got your mean that I shoule transfer parameters as C entry point, main ( argv, argc), am I right?
    In fact I do not validate the source code pass SN and ComCode as your mean, because it's the custom's, I do not have source code.
    In other words, source code may be use "scanf" to accept the parameter and implement actions, maybe other more method.
    Sorry for this is only my thought without no action.
    I will execute1 your advice ASAP.
    Thanks a lot.
    Farmer
    *The best Chinese farmer*

  • HttpRequest POST and PUT not working?

    Hello:
    To send data to server I am trying to use POST or PUT command but
    just can't get them to work.
    The GET command makes connection to server but not the POST and PUT.
    Tried using onOutput for method GET to send data but data is not transferred if method is GET
    Has anyone successfully using POST command or experiencing similar behavior? Thanks.

    Could you post a code example? POST should be working.

  • Post parameter persistence on tab navigation

    I've noticed that any parameters that are posted to the portal server remain persistent after the post if you click through the tab navigation at the top right. I understand that this is good for maintaining the state of portlets. However, this can lead to the same parameters being posted to a portlet multiple times, which may not be desireable in some cases.
    Is it possible to keep these parameters from persisting throughout the tab navigation? Otherwise, how does one insure that the same parameters don't get posted to their portlet a second time?
    Thanks!

    Can you please be more detailed on how to do this?
    thanx in advance..

  • ITS = posting parameter for transactions

    Hi,
    I have the problem that I want show an order via ITS. Therefore I am able to call transaction VA03 with the following link:
    http://sapdnsname:8080/sap/bc/gui/sap/its/webgui/!?~transaction=VA03
    But I am not able to pass also the order number (e.g.: 4711). I tried the following:
    http://sapdnsname:8080/sap/bc/gui/sap/its/webgui/!?~transaction=VA03&vbak-vbeln=4711
    but I did not work.
    Could you please help me?
    Many thanks in advance and best regards
    Dietmar

    Hi Dietmar try like this:
    http://sapdnsname:8080/sap/bc/gui/sap/its/webgui?~TRANSACTION=VA03%20VBAK-VBELN=12345
    BR Gerd

  • POST parameters HttpRequest

    Hello.
    I want to use HttpRequest to send a POST to a Servlet and print the response. I want to send a parameter called content.
    When I set the location like this it works ok.
    var mycontent = "hello";
    location:"http://localhost:8080/sign?content={mycontent}";
    But I want to set the location as:
    location:"http://localhost:8080/sign";
    and send the parameter in the onOutput function like this.
    onOutput: function(os: java.io.OutputStream) {
                    try {
                        os.write(contenido.getBytes());
                    } finally {
                        os.close();
                }but I dont know how to specify the parameter "content".
    This is my full code
    def request: HttpRequest = HttpRequest {
                location: "http://localhost:8080/sign?content={mycontent}";
                method: HttpRequest.POST
                headers: [
                    HttpHeader {
                        name: HttpHeader.CONTENT_TYPE;
                        value: "somecontent/type";
                    HttpHeader {
                        name: HttpHeader.CONTENT_LENGTH;
                        value: "{testContentSize}";
                onOutput: function(os: java.io.OutputStream) {
                    try {
                        println("----onOutput - about to write {testContentSize} bytes to output stream");
                        os.write(mycontent.getBytes());
                    } finally {
                        println("----onOutput - about to close output stream.");
                        os.close();
                onInput: function(is: java.io.InputStream) {
                    try {
                        println("Preparing to read....");
                        var br = new BufferedReader( new InputStreamReader(is) );
                        while (br.ready()) {
                            println( br.readLine() );
                    } catch (IOException){
                        println("An error ocurred while reading from the server.");
                    finally {
                        is.close();
                onException: function(ex: Exception) {
                    println("exception");
                onDoneRead: function() {
                onDone: function() {
                    println("################Done!!!!####################");
            request.start();Edited by: Virux on Sep 4, 2009 6:16 PM
    Edited by: Virux on Sep 4, 2009 6:17 PM

    Hello I have found the solution to this.
    I deleted the contenttype header. And change the onOutput function
    var mycontent = "content=hello";
    def request: HttpRequest = HttpRequest {
                location: "http://localhost:8080/sign";
                method: HttpRequest.POST
                HttpHeader {
                        name: HttpHeader.CONTENT_LENGTH;
                        value: "{testContentSize}";
                onOutput: function(os: java.io.OutputStream) {
                    try {
                        println("----onOutput - about to write {testContentSize} bytes to output stream");
                        os.write(mycontent.getBytes());
                    } finally {
                        println("----onOutput - about to close output stream.");
                        os.close();
                onInput: function(is: java.io.InputStream) {
                    try {
                        println("Preparing to read....");
                        var br = new BufferedReader( new InputStreamReader(is) );
                        while (br.ready()) {
                            println( br.readLine() );
                    } catch (IOException){
                        println("An error ocurred while reading from the server.");
                    finally {
                        is.close();
                onException: function(ex: Exception) {
                    println("exception");
                onDoneRead: function() {
                onDone: function() {
                    println("################Done!!!!####################");
            request.start();In this example Im not enconding the parameter and value. For this you should enconde mycontent var before sending it
    Edited by: Virux on Sep 5, 2009 1:46 PM

  • Reading POST-Request-Parameter-Values from WebDynPro now possible?

    Hello,
    in the past I always was disappointed that in WebDynPro there was no way to read POST-request-parameter-values directly after the call of a WebDynPro-Application.
    The only (documented) way to read / transfer request-data into an WebDynPro-application was via "URL query string parameters" in the request URL.
    The last week I forgot this restriction. I called my WebDynPro-application using a POST-Request-Parameter (cookie_guid) instead of an URL-parameter.
    After noticing my mistake, I was really surprised that the WebDynPro could read / shows the the POST-Request-Value.
    I didn't make any changes in the coding of my WebDynPro-Application (zvis_show_sso_cookie).
    After this cognition I built the following simple HTML-formular to analyse the behavior of the WebyDynPro by calling it with an URL-Parameter (cookie_guid=Url-GUID) together with the POST-Parameter (cookie_guid = Post-Value-GUID).
    After calling the WebyDynPro it reads / shows the "POST-Value" of the request !!!
    (Remark: If I made a simple refresh or type directly the URL "http://hg10762.vis-extranet.de:1080/sap/bc/webdynpro/sap/zvis_show_sso_cookie?sap-language=DE&cookie_guid=Url-GUID" in the browser, the same webdynpro reads / shows the URL-Parameter-Value).
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
           "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    </head>
    <body>
    <form method="post" action="http://hg10762.vis-extranet.de:1080/sap/bc/webdynpro/sap/zvis_show_sso_cookie?sap-language=DE&cookie_guid=Url-GUID">
      <table border="0" cellpadding="5" cellspacing="0" bgcolor="#E0E0E0">
        <tr>
          <td align="right">Cookie_GUID:</td>
          <td><input name="cookie_guid" type="text" size="30" maxlength="30" value="Post-Value-GUID"></td>
        </tr>
        <tr>
          <td>
            <input type="submit" value=" Absenden ">
            <input type="reset" value=" Abbrechen">
          </td>
        </tr>
      </table>
    </form>
    </body>
    </html>
    My questions:
    I there any documentation that describes the behavior of  WebDynPro after calling it by using POST-Parameter values?
    I believe in the past it wasn't possible to read POST-request-parameter-values in WD. Has SAP changed the functionality?
    Is the behavior I described in my example above mandatory?
    Regards
    Steffen

    As far as i know in general HTTP request  GET method is standard but in SAP POST is standard.  All the client request is passed as POST to the server in order to avoid the URL parameter length restriction in GET method.

  • How to pass parameters to servlet with POST with  Business Service OSB

    Hi all.
    I am newby in OSB. I am trying to send some values through a POST call to a servlet. I know how to call the servlet with Business Service of type "Messaging Service". I send the parameters of type Text.
    I have tried several ways, but I don`t find the proper way yo do it. I have tried to insert the param into the body and into the header.
    The problem is that I don`t know exactly where to put them, I don`t know if it must be done in the header or in the boy. I neither don`t know if there is a common way to do this.
    Please, could you give me a good example of an insert activity to isert a post parameter inside the call?
    For example: now I am using this one:
    Expression => "accountType=test"
    Location => as first child of"
    XPATH => empty.
    In variable => body.
    Where do I have to insert this, in the body or in the outbounds?
    I have followed this posts:
    https://blogs.oracle.com/jeffdavies/entry/enhanced_rest_support_in_oracl
    http://www.yenlo.nl/en/using-osb-with-rest/
    Thanks a lot.

    Hi,
    Please be carefull about passing values such as Strings or number that contains ',' .
    using the way described above.
    the best way is to pass an ID and then use a select Statement to get the other Values in the target page.
    regards
    MDK.

Maybe you are looking for