NET.http.Request in a document-level script

Is - it really not possible as indicated in the documentation?

Seems to work with a GET verb in a certified document, which is trust on the customer running Pro...

With the help of a certified document where the user has added the signatory certificate to their list of trusted certificates is another way to allow JavaScript to run, it is simply not always explicitly mentioned in the documentation.

Tags: Acrobat

Similar Questions

  • How to get AFExecuteThisScript to return the value of Net.HTTP.request (asynchronous)?

    I have an Acrobat only plugin, developed in 2005 VS.  Originally with Acrobat 7 SDK, now updated to use Acrobat 9 SDK.  The ultimate goal of this feature is to open a PDF file from a web server Agile: If a user string, a URL is created, a request sent to the URL, then pay back the answer.  The answer can be either the PDF itself or a string path to the PDF file.  I thought it would be easier to use the version of PDF path to simply open the new PDF of the http:// address.

    I created a folder level javascript with a call to Net.HTTP.request confidence.  I have a script that works when invoked from a menu item added by the folder level javascript file.  But when you use this same command in my C++ with AFExecuteThisScript code, I can't get the HTTP response to finish pending in the code for the result.

    The Net.HTTP.request and the asynchronous callbacks confuse me, so maybe that's my big problem.  I could not Net.HTTP.request to return a value in a service simple javascript right now, I'm trying to use a "global" variable in the JavaScript folder level and two calls.  The first call "sets" the global variable, the other "becomes" it.  But this seems to be the issue.  When I have my code debugging or stop execution, the part of the response of the Net.HTTP.request is never called.  But when I left to go beyond this step with error recovery, the answer appears later.

    So how kick off of the Net.HTTP.request and be notified when it's over?  either in JavaScript or VC ++?

    Any help is appreciated.  Even if the best option is to stream the file from the web server to a local file and then open the (this is the option that I take in another tool that runs outside of Acrobat).

    Here's the code.

    Javascript controls at the level of the files (urls truncated for the post)

    var THE_PATH = '';
    
    function setTHE_PATH ( gURL ) {
        console.println('setTHE_PATH Begin');
        var params =
        {
            cVerb: 'GET',
            cURL: gURL,
            oHandler: 
                {
                    response: function( msg, uri, e)
                    {
                        console.println('response method: Setting Path');
                        THE_PATH = SOAP.stringFromStream( msg );
                        console.println('<<' + THE_PATH + '>>');
                    }
                }
        };
        console.println('URL: ' + params.cURL + '\n  oHandler: ' + params.oHandler );
        console.println('Path: ' + THE_PATH );
        var netResult = trustedNetHTTPrequest(params);
        console.println('setTHE_PATH End');
        return THE_PATH;
    };
    
    trustedNetHTTPrequest = app.trustedFunction( 
        function ( params ) {
            console.println('trustedNetHTTPrequest begin');
            app.beginPriv();
            var netResult = Net.HTTP.request( params );
            app.endPriv();
            console.println('trustedNetHTTPrequest end');
            return netResult;
        }
    );
    

    Added MenuItems with JavaScript at the folder level

    app.addMenuItem( { 
        cName: "mysetTHE_PATH", 
        cUser: "set THE_PATH", cParent: "Tools", 
        cExec: "setTHE_PATH('http://......&getURL=true');",
        nPos: 0 
    } );    
    
    app.addMenuItem( { 
        cName: "mygetTHE_PATH", 
        cUser: "get THE_PATH", cParent: "Tools", 
        cExec: "console.println( THE_PATH );",
        nPos: 0 
    } );   
    

    Here's the JavaScript Console output when you run these two commands:

    setTHE_PATH Begin
    URL: http://......&getURL=true
      oHandler: [object Object]
    Path: 
    trustedNetHTTPrequest begin
    trustedNetHTTPrequest end
    setTHE_PATH End
    response method: Setting Path
    <<https://......DesiredFilename.pdf>>
    

    Here is the function in the plugin C++, with additional measures to prove AFExecuteThisScript works here

    sprintf(jsScript, "testVal='%s';event.value = testVal;", strURL.c_str() );
    AFExecuteThisScript( aPdDoc, jsScript, &pReturnValue );
    // After this, pReturnValue is the passed-in URL, as expected.
    sprintf(jsScript, "setTHE_PATH('%s');event.value = 'Step 1 Worked!!';", strURL.c_str() );
    AFExecuteThisScript( aPdDoc, jsScript, &pReturnValue );
    // After this, pReturnValue is 'Step 1 Worked!!', as expected.
    sprintf(jsScript, "event.value = THE_PATH;", strURL.c_str() );
    AFExecuteThisScript( aPdDoc, jsScript, &pReturnValue );
    // After this, pReturnValue is NULL
    

    This is the JavaScript Console output when you run the commands using the plugin (mode debugger, to wait after step 1)

    setTHE_PATH Begin
    URL: http://......&getURL=true
      oHandler: [object Object]
    Path: 
    trustedNetHTTPrequest begin
    trustedNetHTTPrequest end
    setTHE_PATH End
    

    Note that he never gets to the part of the "method of response.

    Thank you!

    Tim James

    You need not limit yourself to the plugin API. The requests HTTP from C/C++ is a fairly common condition, just observe the restrictions in my answer.

  • LiveCycle Design apply 'Rights form', Net.HTTP.request

    Hi all

    It seems that I can't use Net.HTTP.request (I use ping on our network to see if it is available or not) in my form which is read by the reader because he needs 'Form rights' applied by another piece of software, Adobe LiveCycle. https://forums.Adobe.com/thread/550113?TSTART=0

    So my question is, would I just open my existing form in LiveCycle, applicable 'rights form' and save it from here in pdf format or I have to rebuild my whole form in LiveCycle? I'm not at all familiar with the tool and try to get a trial version of it.

    I might add, while the JavaScript API Adobe mentions this method Net.HTTP.request rights to form, it of course does not explain we have LiveCycle to achieve... kind of annoying.

    Please specify.

    John

    LiveCycle Reader Extensions is part of the LiveCycle; You should contact the Sales Department of company Adobe. Install you it on a server and to do a proper API. The price is by negotiation, but wait at least 5 digits. Allow SUFFICIENT time for the approval process.

  • Document-level Script question

    I try to call a script to leave the Document in an If Stamen and it does not work.

    It's not the document level script that I tested it in a button to see if it worked must be the way I am the appellant

    If get.thisField ('Combo1") .value == 'yes '.

    DocScript1 ();

    otherwise if get.thisField ('Combo1') .value is 'no '.

    DocScript2 ();

    also tried

    If get.thisField ('Combo1") .value == 'yes '.

    DocScript1 ();

    If get.thisField ('Combo1") .value == 'no '.

    DocScript2 ();

    If I run the script in the Console

    SyntaxError: syntax error

    1:Console:exec

    undefined

    also can anyone recommend a free JS editor that works with Acrobat

    using Acrobat Pro X win 10 64 bit 16 GB ram i5 3.3Ghz and 1 TB of storage

    Not sure what you mean...

  • Header of document level scripts

    Hello-

    I am looking for any help you may have.  I'm working on a project in Acrobat Professional 7.0 which requires me to add the user name of the computer to the header of a pdf file.  I have found and put in place in Excel files using an onopen event.  I need to do the same thing but in a pdf file.  I have absolutely no experience, basic script over your best explanation.

    After reading on the internet, I think I need a script to document level?  I found an example that is:

    This.addwatermarkfromtext ({}

    CTEXT: "confidential."

    ntextalign: 2.

    nhorizalign: 2.

    nvertalign: 0,

    nhorizvalue:-72,

    nvertvalue:-72,

    });

    I walked under Javascript Advanced Document, Javascript, but I have an error message that says: typeerror: this.addwatermarkfromtext is not a function.  Again, I would need to change to get the user name (I guess I can do that with a variable?).  I appreciate all help.

    Thanks in advance for your time.

    Yes, it must be installed on each user's computer.

    And no, they do not have to have Pro. It will work as well with the drive.

  • How to send a document in net. HTTP.request as a POST variable?

    I have read and reread the doc on the net. HTTP.request and he says I can pass an argument to oRequest, but I failed to pass in the current document, which is what I want to do.

    I tried app.activeDocs [0], or the encoding of a string, but if he makes the call with no error, nothing is sent.

    ORequest must be a single document, or a variable consisting of name-value pairs? How to send multiple parameters to a POSITION otherwise?

    I did very well with the call using GET, but when I tried to send the document as a GET variable, I did nothing either.

    I send to an end point of LiveCycle REST so either POST or GET is fine.

    Thank you!

    Validating the document current is simple * provided * your script runs outside the context of the document (i.e. in the console or a script to the folder level). There is no access to scripts of doc-level for obvious reasons.

    For example, put this in the console JS OCCURS the current file to a URL:

    Net.HTTP.request ({}

    cVerb: 'POST',

    cURL: "http://localhost/submit.php."

    oRequest: Collab.documentToStream (this);

    oHandler: {}

    answer: function (msg, uri, err) {}

    If (err! = undefined) app.alert (msg);

    }

    }

    });

    Your problem talking to a vanilla Web service, is that you can send the RFC1867 delimiters (i.e. the form apply for "multipart/form-data") that the ReadStream object is not a method of concatenation in the JSAPI Acrobat. It's also how you would usually precede other fields in the form, but if you are careful with your codes side server that you can send to save them as GET parameters in cURL. Normally, you'd be polite and passed a context of Type in the table of aHeaders header - it won't matter for the transmission process, but will allow your webservice predict what that heck he was sent.

    Your webservice will then read the raw data. PHP for example, you will get nothing in the $_FILES global, but you can grab the PDF by reading all of the input buffer, with the line:

    $pdf = file_get_contents() ("php://input");

    If this line was in the server script which was the JS code above, the variable $pdf will contain an exact binary copy of the currently opened document.

  • PDF http request

    Hello

    I'm working on Acrobat Pro

    My goal is to Send a HTTP request by my PDF file

    I took a classic example:

    I put the javascript code in programs /Acrobat/.../javascript/


    AJAX = {function (cURL)}

    var params =

    {

    cVerb: 'GET ',.

    cURL: cURL,.

    oHandler:

    {

    answer: {function (msg, uri, e, h)

    var stream = msg;

    string var = "";

    String = SOAP.stringFromStream (stream);

    App.Alert (String);

    }

    }

    };

    Net.HTTP.request (params);

    }

    app.addMenuItem ({cName: "Go PHP", cParent: "File"})

    cExec: ' ajax ("http://localhost/myPage.php" ' ");", "

    cEnable: «event.rc = (event.target!» (= null); »,

    NPO: 0

    });

    but when I go to 'File/Go PHP' Acrobat says that it is an error internal


    What is the problem?

    Thank you

    Wrap your ajax() function in a block of confidence so it does not run as part of the event target (i.e. the open document):

    AJAX = {app.trustedFunction (function (fURL)}

    app.beginPriv ();

    var params = {cVerb: 'GET', cURL: fURL, oHandler: {}}

    answer: function(msg,uri,e,h) {}

    var stream = msg;

    string var = "";

    String = SOAP.stringFromStream (stream);

    App.Alert (String) ;}}} ;

    Net.HTTP.request (params);

    app.endPriv ();

    });

    app.addMenuItem({)

    cName: "Go PHP", cParent: "file."

    cExec: 'ajax ("http://localhost/myPage.php");',

    cEnable: «event.rc = (event.target!» (= null); »,

    ({NPOS: 0});

  • How to add the document level java script to the document via API?

    Hello

    Can someone tell me how to add a document level java script with pdf document?

    Thank you

    Amol

    Here is a link to the JavaScript documentation for the doc.addScript method: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.440.html

  • I get the error message like "error - ORA-29273 report: failure of the HTTP ORA-06512: at"SYS. " UTL_HTTP", line 1130 ORA-12535: TNS:operation expired ORA-06512: 37 29273 line. 00000 - "HTTP request failed" * Cause: package UTL_HTTP The Impossible to run

    I have tried the code

    DECLARE

    lv_url VARCHAR2 (1000): = ' http://shenzhoufellowship.org/main2/files/old/SpecialTopics/TheLoveDare.pdf';

    lc_return BLOB;

    lhttp_url httpuritype.

    Varriables - declared to have written the LOB to pdf file-

    l_file UTL_FILE. TYPE_DE_FICHIER;

    l_buffer RAW (32767).

    l_amount directory: = 32767;

    l_pos INTEGER: = 1;

    l_blob BLOB;

    l_blob_len INTEGER.

    BEGIN

    -create URIs

    lhttp_url: = httpuritype.createuri (lv_url);

    -get the PDF document

    lc_return: = lhttp_url.getblob ();

    -Open the destination file.

    l_file: = UTL_FILE. FOPEN ('MBO_INPUT_DIR', 'MBD.zip', 'wb');

    -Get the total length of the BLOB

    l_blob_len: = DBMS_LOB.getlength (lc_return);

    -Pieces of the BLOB to read and write to the file

    -full up.

    While l_pos < l_blob_len LOOP

    DBMS_LOB. READ (lc_return, l_amount, l_pos, l_buffer);

    UTL_FILE.put_raw (l_file, l_buffer, FALSE);

    l_pos: = l_pos + l_amount;

    END LOOP;

    -Closes the file.

    UTL_FILE. FCLOSE (l_file);

    EXCEPTION

    WHILE OTHERS THEN

    -Close the file if something goes wrong.

    IF UTL_FILE.IS_OPEN (l_file) THEN

    UTL_FILE. FCLOSE (l_file);

    END IF;

    LIFT;

    END;

    But make a mistake like:

    Error report-

    ORA-29273: HTTP request failed

    ORA-06512: at "SYS." UTL_HTTP", line 1130

    ORA-12535: TNS:operation expired

    ORA-06512: at line 37 level

    29273 00000 - "the HTTP request failed.

    * Cause: The UTL_HTTP package cannot run the HTTP request.

    * Action: Use get_detailed_sqlerrm to check the detailed error message.

    Correct the error and restart the HTTP request.

    Please suggest a solution. Is it possible to download a zip file with the same code?

    [oracle@localhost ~]$ sqlplus scott/tiger
    
    SQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 6 13:59:09 2015
    
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> --My Database version
    SQL> ----------------------
    SQL> SELECT * FROM v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  DECLARE
      2        lv_url    VARCHAR2(500) := 'http://shenzhoufellowship.org/main2/files/old/SpecialTopics/TheLoveDare.pdf';
      3        lc_return BLOB;
      4        lhttp_url httpuritype;
      5        ---Varriables declared for writing the LOB to pdf file --
      6        l_file     UTL_FILE.FILE_TYPE;
      7        l_buffer   RAW(32767);
      8        l_amount   BINARY_INTEGER := 32767;
      9        l_pos      INTEGER := 1;
    10       l_blob     BLOB;
    11       l_blob_len INTEGER;
    12     BEGIN
    13       --create uri
    14       lhttp_url := httpuritype.createuri(lv_url);
    15       --get the PDF document
    16       lc_return := lhttp_url.getblob();
    17       -- Open the destination file.
    18       l_file := UTL_FILE.FOPEN('SAUBHIK', 'TheLoveDare.pdf', 'wb');
    19       --Get the total length of the BLOB
    20       l_blob_len := DBMS_LOB.getlength(lc_return);
    21       -- Read chunks of the BLOB and write them to the file
    22       -- until complete.
    23       WHILE l_pos < l_blob_len LOOP
    24         DBMS_LOB.READ(lc_return, l_amount, l_pos, l_buffer);
    25         UTL_FILE.put_raw(l_file, l_buffer, FALSE);
    26         l_pos := l_pos + l_amount;
    27       END LOOP;
    28       -- Close the file.
    29       UTL_FILE.FCLOSE(l_file);
    30     EXCEPTION
    31       WHEN OTHERS THEN
    32         -- Close the file if something goes wrong.
    33         IF UTL_FILE.IS_OPEN(l_file) THEN
    34           UTL_FILE.FCLOSE(l_file);
    35         END IF;
    36         RAISE;
    37*    END;
    38  /
    DECLARE
    *
    ERROR at line 1:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1130
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at line 36
    
    SQL> conn sys as sysdba
    Enter password:
    Connected.
    SQL> ed
    Wrote file afiedt.buf
    
      1  BEGIN
      2    DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(acl         => 'love.xml',
      3                                      description => 'Love ACL',
      4                                      principal   => 'SCOTT',
      5                                      is_grant    => true,
      6                                      privilege   => 'connect');
      7    DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl       => 'love.xml',
      8                                         principal => 'SCOTT',
      9                                         is_grant  => true,
    10                                         privilege => 'resolve');
    11    DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(acl  => 'love.xml',
    12                                      host => 'shenzhoufellowship.org');
    13  commit;
    14* END;
    15  /
    
    PL/SQL procedure successfully completed.
    
    SQL> conn scott/tiger
    Connected.
    SQL> ed
    Wrote file afiedt.buf
    
      1  DECLARE
      2        lv_url    VARCHAR2(500) := 'http://shenzhoufellowship.org/main2/files/old/SpecialTopics/TheLoveDare.pdf';
      3        lc_return BLOB;
      4        lhttp_url httpuritype;
      5        ---Varriables declared for writing the LOB to pdf file --
      6        l_file     UTL_FILE.FILE_TYPE;
      7        l_buffer   RAW(32767);
      8        l_amount   BINARY_INTEGER := 32767;
      9        l_pos      INTEGER := 1;
    10       l_blob     BLOB;
    11       l_blob_len INTEGER;
    12     BEGIN
    13       --create uri
    14       lhttp_url := httpuritype.createuri(lv_url);
    15       --get the PDF document
    16       lc_return := lhttp_url.getblob();
    17       -- Open the destination file.
    18       l_file := UTL_FILE.FOPEN('SAUBHIK', 'TheLoveDare.pdf', 'wb');
    19       --Get the total length of the BLOB
    20       l_blob_len := DBMS_LOB.getlength(lc_return);
    21       -- Read chunks of the BLOB and write them to the file
    22       -- until complete.
    23       WHILE l_pos < l_blob_len LOOP
    24         DBMS_LOB.READ(lc_return, l_amount, l_pos, l_buffer);
    25         UTL_FILE.put_raw(l_file, l_buffer, FALSE);
    26         l_pos := l_pos + l_amount;
    27       END LOOP;
    28       -- Close the file.
    29       UTL_FILE.FCLOSE(l_file);
    30     EXCEPTION
    31       WHEN OTHERS THEN
    32         -- Close the file if something goes wrong.
    33         IF UTL_FILE.IS_OPEN(l_file) THEN
    34           UTL_FILE.FCLOSE(l_file);
    35         END IF;
    36         RAISE;
    37*    END;
    38  /
    
    PL/SQL procedure successfully completed.
    
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@localhost ~]$ cd saubhik/
    [oracle@localhost saubhik]$ pwd
    /home/oracle/saubhik
    [oracle@localhost saubhik]$ ls -l *.pdf
    -rw-r--r-- 1 oracle oinstall 60055 Apr  6 14:03 TheLoveDare.pdf
    [oracle@localhost saubhik]$
    

    I love this pdf file. I would like to read this and mean while if you get an error then please post in its entirety and also think that it is an Oracle error or network.

  • Problem in sending HTTP request on the server.

    Hello
    I have dveloped a script ant for deployment of the sar.

    I have deployed an endangered species to my server local soa with ant script. He has successfully deployed me...
    but when I try to deploy it to a remote server, get the below error...
    "The problem by sending the HTTP request on the server. Please make sure that the server is in place or check the code of standard HTTP response for a 404 "

    but the server is up and runnig and I am able to ping my machine and also access the console...

    Here's 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 = BIENVENUE1

    #For Composite deployment
    serverURL = http://10.177.154.6:7001
    forceDefault = true
    Server = 10.177.154.6
    port = 7001
    sarLocation = D: / code source/JAR


    Build.Xml
    ------------------------------------------------------

    <? XML version = "1.0" encoding = "iso-8859-1? >
    < project default = "soaDeployAll" name = "deployAll" >
    < echo > basedir ${basedir} < / echo >
    < environment property = "env" / >
    < echo > classes folder ${basedir} < / echo >
    < file="${basedir}/build.properties"/ property >
    "< taskdef resource="net/sf/antcontrib/antlib.xml ">
    < classpath >
    < pathelement location="${all.needed.jars.path}/ant-contrib.jar"/ >
    < / classpath >
    < / taskdef >
    < target name = "init" >
    < tstamp >
    < form property = "timestamp" reason = "yyyy-MM-dd_HH-mm-ss" / >
    < / tstamp >
    < name = "build.log.dir property" location ="${basedir} / buildlogs" / > "
    < dir="${build.log.dir}"/ mkdir > < property name = "build.log.filename" value = "build_$ {timestamp} .log" / > "
    {< record name="${build.log.dir}/${build.log.filename}" loglevel = "verbose" append = "false" / > ".
    < echo message = "Build connected to ${build.log.filename}"/ > "
    < / target >

    < target name = "deployAll" depends = "init" >
    < echo > deploy environment ${deployment.plan.environment} < / echo >

    < antcall target = "deployAllComposites" / >

    < / target >

    <! - the following Actions are performed for Composite files to the server run - deploy, redeploy - >
    < target name = "deployAllComposites" depends = "init" >
    < foreach target = "deployComposites" param = "File" >
    < fileset dir casesensitive = "${sarLocation}" = "no" includes = "*.jar" / >
    < / foreach >
    < / target >

    < target name = "deployComposites" depends = "init" >
    < file basename property = "${file}" = "basename" / >
    deploy < echo > ${name} of the environment project $ {deployment.plan.environment} < / echo >
    < if >
    < equals arg1 arg2 = "${deployAction}" = "deploy" / >
    < do >
    < echo message = "deployment of composites in Managed server...". "/ >
    "< antfile="${oracle.soa.home}/bin/ant-sca-deploy.xml ant "inheritAll ="true"target ="deploy">
    < property name = "ServerUri" value = "${ServerURI}" / >
    < 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 >
    < / may >
    < other >
    < echo message = "redeployment of composites in Managed server...". "/ >
    "< antfile="${oracle.soa.home}/bin/ant-sca-deploy.xml ant "inheritAll ="true"target ="deploy">
    < property name = "ServerUri" value = "${ServerURI}" / >
    < 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 >



    Help, please...

    Hello

    Give the serverURL as http://:/ soa-infra/deployer and try.

    for example. http://10.177.154.6:8001 / soa-infra/Deployer

    Kind regards
    Neeraj Sehgal

  • I need assistance with the HTTP request procedure

    This is the message I get debug, attempting a HTTPService request as follows
    < mx:Application... initialize = "myService.send ()" >
    Import mx.rpc.events.ResultEvent;
    < mx:HHTPService id = "myService" url = "" data / myInfo.xml "result =" resultHandler (event) "/ >:"

    [SWF] C:\Documents and Settings\ArchiMaster\My Documents\Flex Projects\krsl_corp\bin-debug\krsl_corp.swf - 786 719 bytes after decompression
    [Fault faultString = "HTTP request error" RPC faultCode = "Server.Error.Request" faultDetail ="error: [IOErrorEvent type ="ioError"bubbles = false cancelable = false eventPhase = 2 text =" Error #2032: stream error. "]] ["URL: file:///C:/Documents%20and%20Settings/ArchiMaster/My%20Documents/Flex%20Projects/krsl_cor p/bin-debug/data/ilungas.xml"]. ["URL: data / ilungas.xml"]
    to mx.rpc::AbstractInvoker / http://www.adobe.com/2006/flex/mx/internal:faultHandler () [E:\dev\3.0.x\frameworks\project s\rpc\src\mx\rpc\AbstractInvoker.as:216 ]
    at mx.rpc::Responder/fault() [E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Responder.as:49]
    at mx.rpc::AsyncRequest/fault() [E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AsyncRequest .as:103]
    to DirectHTTPMessageResponder / errorHandler ([E:\dev\3.0.x\frameworks\projects\rpc\src\mx\mes saging\channels\DirectHTTPChannel.as:343])
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/redirectEvent()

    What it means? In addition, I do not use the default workspace, so Flex created only the ".metadata' but not the 'configuration' file, that is why, I had to copy a block as the default workspace. So, how do you get Flex to create two files no matter the location of the workspace? I really need help. Thank you!

    Looks like the error message saying that "data / ilungas.xml ' was not found. You use url = "" data / myInfo.xml ' in your service. " They do not match.

  • How can I send a HTTP request to a web server using TCP?

    I'm writing a HTTP string to activate a script CGI, server of our company. It seems that the OPEN TCP CONNECTION works. Can I just use the TCP WRITE function to send the HTTP request string to the server?
    Thank you
    Tim

    I know that I probably would have finished faster if I had the Internet Toolbox, but the solution ends up being pretty simple with just the TCP features.
    Here is the solution, I came with yesterday (in the case where someone else needs) after searching Protocols TCP as suggested by "Laboratory Viewer" and examine details in the riding of developer. It ends up being only a string of 4 line.

    GET HTTP://proxyserver/path/file.asp?id=test HTTP/1.1
    HOMEroxyserver

    The first line of the string is made up of three things:
    (1) the GET command
    (2) the URL of the program target (in this case an ASP program that distributes a message preset)
    NOTE that in this case, the URL contained "HTTP://proxyserver" and not only the path to the file. If your not using a proxy server, you can probably omit the name of the server of the URL, but you must always the name of the host server to the second line.
    (3) the HTTP version used

    The second line is the host server.

    The last two lines are empty, but the two are apparently necessary to properly close the TCP request.

    Vi uses an OPEN TCP CONNECTION to connect to port 80, then the 4 line string is sent with a WRITING of TCP and the connection is closed with a NARROW CONNECTION of TCP.

    In my application, when the piece of equipment monitored by LabVIEW begins to enter a dangerous to use, LabVIEW uses this vi to send the HTTP request through the TCP connection and a program of target ASP on the company's web server. The ASP reads the message ID (? id = test) and sends the message page and the text messaging appropriate to maintenance and engineering personnel. People warned by text pagers are supposed to respond immediately.

    Our DSI wrote the ASP that allows you to set the ID of multiple message with different distribution lists. Each message is triggered with a different ID of the virtual instrument according to the gravity of the situation.

    Thanks to other amateurs who have published their questions and their answers. Hope someone else finds this useful.

  • Today, I have a problem with the HTTP request

    Well, this time, I try to get an image .png from a URL. To get this I do the following:

    try{   if (CoverageInfo.isOutOfCoverage()){      setError("No hay covertura suficiente de la red");        errorFlag = true; } else{     c = (HttpConnection)Connector.open(url);      is = c.openDataInputStream();     for(int j=0;j
    

    My problem is the second 'try' returns: "java.lang.illegalArgumentException". I don't really know much on HTTP conections, so I don't know that I have a lot of wrong code

    in other words, I'm moving to the java language this short code on the C++ language:

    WebRequest request = System.Net.WebRequest.Create(url);HttpWebResponse response = (HttpWebResponse)request.GetResponse();Stream datos = response.GetResponseStream();Imagen = new Bitmap(datos);pb1.Image = Imagen;datos.Close();response.Close();
    

    can someone help me?

    Thank you RexDoug and peter_strange,

    in the book "java J2ME a tope"-unfortunately or fortunately (for me), it is in Spanish - explain everything about HTTP request and how to interpret correctly the answer. Finally with the following code, I solved my problem:

    try{
        //ask if i have coverage
        if (CoverageInfo.isOutOfCoverage()){
            setError("No hay covertura suficiente de la red");
            errorFlag = true;
        }
        else{
            //create connection
            c = (HttpConnection)Connector.open(url);
            c.setRequestMethod(HttpConnection.GET);
            is = c.openInputStream();
    
            //process response
            if(c.getResponseCode()==HttpConnection.HTTP_OK){
                size = (int)c.getLength();
                if(size != -1){
                    data = new byte[size];
                    is.read(data, 0, data.length);
                    imagen = Bitmap.createBitmapFromBytes(data, 0, -1, 1);
                }
                else{
                    ByteArrayOutputStream byteArray = new ByteArrayOutputStream();
                    int stream;
                    while((stream=is.read())!=-1){
                        byteArray.write(stream);
                    }
                    data = new byte[byteArray.size()];
                    data = byteArray.toByteArray();
                    byteArray.close();
                    imagen = Bitmap.createBitmapFromBytes(data, 0, -1, 1);
                }
            }
            //close connections
            c.close();
            is.close();
        }
    }
    

    This code is similar to the example of rexdoug.

  • How is it that when I click on clear form Acrobat is option clears all fields populated by a JavaScript document level and if I save them the start of the JavaScript document level form is no longer works?

    How is it that when I click on clear form Acrobat is option clears all fields populated by a JavaScript document level and if I save them the start of the JavaScript document level form is no longer works?

    Or a link to the form or a sample with the same problem.

    You only set the function to run but not executed.

    You should add a line like:

    AtStartup();

    to your script.

    As noted if you have been set "defaultValue" to the fields, then clear the fields would remove any entry present and restore the default values.

    Or you could write a custom JavaScript to clear the fields and then run your startup script.

  • Groovy http requests timeout

    If I do the http request models groovy by setting the fetch URL and content of class, is - can I change default timeout values.

    Here is the excerpt from groovy example:

    def url = new URL ("http://myserver.foo.com/test")
    def content = url.getText)

    This works well if the server is not available or if the application gives any kind of error. However, if this connection time-outs, it is quite play my alert models. Finally the HQ template engine will notice that there is long-term, methods, but it will take too long. I want to just make sure that this model is run within 10 seconds.

    If anyone wants to know why I'm doing the HTTP alert model, short here's answer. I have an external knowledge (wiki) database to store alert documents. Here, I'm just trying to attach certain documents to emails that HQ sends to users.

    It's groovy kind of problem. Does anyone know of any workaround for this problem?

    Hi Janne,

    I do not know how to set the timeout... I guess it's the price to pay for convenience when using these Groovy shortcut methods.

    You simply need to do the old-fashioned way.  As an alternative, HQ is delivered with Commons-httpclient, so you can also use it if you need finer grain size control settings and connection settings.

    -Ryan

Maybe you are looking for