Embedded "multipart/encrypted" HTTP Request?

Hi,
I am using 'httpclient.jar'. I am able to successfully send a normal HTTPRequest and receive the response using the 'MultipartRequestEntity' class.
Now, I need to send an Embedded HTTP Request as mentioned below. Kindly suggest how can I send an Embedded HTTPRequest and how do I set the 'RequestHeader' to change the 'Content Type' to "multipart/encrypted".
POST /RecipientServer/mailbox HTTP/1.1
Date: Tue, 20 Dec 2000 08:12:31 GMT
Connection: Keep-Alive
Host: www.ontarioRecipientServer.com
Content-Language: en, fr
Content-Type: multipart/form-data; boundary=EBTpart;
Content-Length: 3222
--EBTpart
Content-Disposition: form-data; name=”sender”
12345678
--EBTpart
Content-Disposition: form-data; name=”user_id”
aUser
--EBTpart
Content-Disposition: form-data; name=”user_password”
aPassword
--EBTpart
Content-Disposition: form-data; name=”request_type”
Upload
--EBTpart
Content-Disposition: form-data; name=”ebt_document”; filename=”transaction.xml”
Content-Type: application/octet-stream
MIME-Version: 1.0
Content-Type: multipart/encrypted; boundary=”=--”;
protocol="application/pgp-encrypted"
--=--
Content-Type: pgp-encrypted
Version: 1
--=--
Content-Type: application/octet-stream
-----BEGIN PGP MESSAGE-----
Version: 2.6.2
hIwDY32hYGCE8MkBA/wOu7d45aUxF4Q0RKJprD3v5Z9K1YcRJ2fve87lMlDlx4OjeW4GDdBfLbJE7VUpp13N19GL8e/AqbyyjHH4aS0YoTk10QQ9nnRvjY8nZL3MPXSZg9VGQxFeGqzykzmykU6A26MSMexR4ApeeON6xzZWfo+0yOqAq6lb46wsvldZ96YA AABH78hyX7YX4uT1tNCWEIIBoqqvCeIMpp7UQ2IzBrXg6GtukS8NxbukLeamqVW31yt21DYOjuLzcMNe/JNsD9vDVCvOOG3OCi8=
=zzaA
-----END PGP MESSAGE-----
--=----
EBTpart

Hi,
I am using 'httpclient.jar'. I am able to successfully send a normal HTTPRequest and receive the response using the 'MultipartRequestEntity' class.
Now, I need to send an Embedded HTTP Request as mentioned below. Kindly suggest how can I send an Embedded HTTPRequest and how do I set the 'RequestHeader' to change the 'Content Type' to "multipart/encrypted".
POST /RecipientServer/mailbox HTTP/1.1
Date: Tue, 20 Dec 2000 08:12:31 GMT
Connection: Keep-Alive
Host: www.ontarioRecipientServer.com
Content-Language: en, fr
Content-Type: multipart/form-data; boundary=EBTpart;
Content-Length: 3222
--EBTpart
Content-Disposition: form-data; name=”sender”
12345678
--EBTpart
Content-Disposition: form-data; name=”user_id”
aUser
--EBTpart
Content-Disposition: form-data; name=”user_password”
aPassword
--EBTpart
Content-Disposition: form-data; name=”request_type”
Upload
--EBTpart
Content-Disposition: form-data; name=”ebt_document”; filename=”transaction.xml”
Content-Type: application/octet-stream
MIME-Version: 1.0
Content-Type: multipart/encrypted; boundary=”=--”;
protocol="application/pgp-encrypted"
--=--
Content-Type: pgp-encrypted
Version: 1
--=--
Content-Type: application/octet-stream
-----BEGIN PGP MESSAGE-----
Version: 2.6.2
hIwDY32hYGCE8MkBA/wOu7d45aUxF4Q0RKJprD3v5Z9K1YcRJ2fve87lMlDlx4OjeW4GDdBfLbJE7VUpp13N19GL8e/AqbyyjHH4aS0YoTk10QQ9nnRvjY8nZL3MPXSZg9VGQxFeGqzykzmykU6A26MSMexR4ApeeON6xzZWfo+0yOqAq6lb46wsvldZ96YA AABH78hyX7YX4uT1tNCWEIIBoqqvCeIMpp7UQ2IzBrXg6GtukS8NxbukLeamqVW31yt21DYOjuLzcMNe/JNsD9vDVCvOOG3OCi8=
=zzaA
-----END PGP MESSAGE-----
--=----
EBTpart

Similar Messages

  • Multipart/encrypted content type

    In RFC 1847 it is written that for an encrypted mail content type will be multipart/encrypted. So if i say message.isMimeType("multipart/encrypted") i should get true. But it never returns true for an encrypted mail. Does it depend on JDK version,MIME version or something?

    Check out HTTPClient. It's a set of classes that can be used to create POST requests (including file uploads) and has builtin support for many MIME types. It's available at http://www.innovation.ch/java/HTTPClient/

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

    I have read and reread the doc on net.HTTP.request, and it says I can pass an argument of oRequest, but I have not succeeded at passing in the current document, which is what I want to do.
    I've tried app.activeDocs[0], or encoding that to a string, but though it makes the call without error, nothing is sent.
    Should oRequest be simply a document, or a variable made up of name-value pairs? How do we send multiple parameters to a POST otherwise?
    I've succeeded fine with calling using GET, but when I tried to pass the document as a GET variable, I got nothing either.
    I'm sending to a LiveCycle REST end point so either POST or GET is fine.
    Thanks!

    POSTing the current document is straightforward *provided* your script is running outside the document context (i.e. in the console or a folder-level script). There's no access from doc-level scripts for obvious reasons.
    For example, putting this in the JS console will POST the current file to a URL:
    Net.HTTP.request({
      cVerb:'POST',
      cURL: 'http://localhost/submit.php',
      oRequest: Collab.documentToStream(this),
      oHandler: {
        response: function (msg, uri, err) {
           if (err!=undefined) app.alert(msg);
    Your problem with talking to a vanilla webservice is that you cannot send the RFC1867 delimeters (i.e. form a "multipart/form-data" request) as the ReadStream object doesn't have a concatenation method in the Acrobat JSAPI. That's also how you would usually prepend other form fields, but if you're careful with your server-side coding you can send those as GET parameters in cURL. Normally you'd be polite and pass a Context-Type header in the aHeaders array - it won't matter to the transmission process but will allow your webservice to predict what the heck it's been sent.
    Your webservice will then have to read the raw data. In PHP for example, you won't get anything in the $_FILES global but you can grab the PDF by reading everything from the input buffer, with the line:
    $pdf = file_get_contents("php://input");
    If that line was in the server script that the above JS code was aimed at, the variable $pdf will contain an exact binary copy of the currently-open document.

  • PL/SQL posting to HTTP request

    Hi
    As part of a web application I am developing, I need to generate an HTTP post from a PL/SQL package. The problem I am having is that the message going out is not properly formatted and is being rejected by the listening application (in this case, WebCT)
    The MIME message should be formatted like this. (this is what I get when I use Perl to generate the call...)
    POST /webct/systemIntegrationApi.dowebct HTTP/1.1
    Host: roach:4041
    Connection: Keep-Alive, TE
    TE: trailers, deflate, gzip, compress
    User-Agent: RPT-HTTPClient/0.3-3E
    Accept-Encoding: deflate, gzip, x-gzip, compress, x-compress
    Content-type: multipart/form-data; boundary=WebCT_Enterprise_API_boundary
    Content-length: 1506
    --WebCT_Enterprise_API_boundary
    Content-Disposition: form-data; name="adapter"
    ims
    --WebCT_Enterprise_API_boundary
    Content-Disposition: form-data; name="ACTION"
    import
    --WebCT_Enterprise_API_boundary
    Content-Disposition: form-data; name="OPTION"
    unrestrict
    --WebCT_Enterprise_API_boundary
    Content-Disposition: form-data; name="SCTMODE"
    OFF
    --WebCT_Enterprise_API_boundary
    Content-Disposition: form-data; name="TIMESTAMP"
    1091141996
    --WebCT_Enterprise_API_boundary
    Content-Disposition: form-data; name="AUTH"
    3D 1F DC E0 F7 15 5A 1F F4 99 CA 70 D4 68 1C 57
    --WebCT_Enterprise_API_boundary
    Content-Disposition: form-data; name="FILENAME"; filename="baseline_import.xml"
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE ENTERPRISE SYSTEM "IMS-EP01.dtd">
    <ENTERPRISE>
    <PROPERTIES>
    <DATASOURCE>McGill University SCT Banner</DATASOURCE>
    <TYPE>Initial Creation</TYPE>
    <DATETIME>2000-00-00T12:00:00</DATETIME>
    </PROPERTIES>
    <GROUP>
    <SOURCEDID>
    <SOURCE>Banner 2000 SCT Banner</SOURCE>
    <ID>6536.200409</ID>
    </SOURCEDID>
    <DESCRIPTION>
    <SHORT>HIST-666-001</SHORT>
    </DESCRIPTION>
    <RELATIONSHIP myrelationship="3">
    <SOURCEDID>
    <SOURCE>Banner 2000 SCT Banner</SOURCE>
    <ID>6537.200409</ID>
    </SOURCEDID>
    </RELATIONSHIP>
    </GROUP>
    </ENTERPRISE>
    WebCT_Enterprise_API_boundary
    HTTP/1.1 200 OK
    Date: Thu, 29 Jul 2004 21:56:27 GMT
    Server: Apache/2.0.49 (Unix) DAV/2 mod_ssl/2.0.49 OpenSSL/0.9.6m mod_jk/1.2.3-dev
    Keep-Alive: timeout=15, max=100
    Connection: Keep-Alive
    Transfer-Encoding: chunked
    Content-Type: text/html
    35
    Success: Import file (baseline_import.xml) complete.
    0
    My PL/SQL code that tries to build the outgoing call is
    req := utl_http.begin_request('http://atlas.cc.mcgill.ca:8900/webct/systemIntegrationApi.dowebct','POST', 'HTTP/1.1');
    utl_http.write_text(req,'Content-type: multipart/form-data; boundary=WebCT_Enterprise_API_Boundary' || CHR(13)|| CHR(10) ||
                   '' || CHR(13)|| CHR(10) ||
                   '--WebCT_Enterprise_API_Boundary' || CHR(13)|| CHR(10) ||
                   'Content-Disposition: form-data; name="adapter"' || CHR(13)|| CHR(10) ||
                   '' || CHR(13)|| CHR(10) ||
                   'ims' || CHR(13)|| CHR(10) ||
                   '--WebCT_Enterprise_API_Boundary' || CHR(13)|| CHR(10) ||
                   'Content-Disposition: form-data; name="ACTION"' || CHR(13)|| CHR(10) ||
                   '' || CHR(13)|| CHR(10) ||
                   'import' || CHR(13)|| CHR(10) ||
                   '--WebCT_Enterprise_API_Boundary' || CHR(13)|| CHR(10) ||
                   'Content-Disposition: form-data; name="OPTION"' || CHR(13)|| CHR(10) ||
                   '' || CHR(13)|| CHR(10) ||
                   'unrestrict' || CHR(13)|| CHR(10) ||
                   '--WebCT_Enterprise_API_Boundary' || CHR(13)|| CHR(10) ||
                   'Content-Disposition: form-data; name="SCTMODE"' || CHR(13)|| CHR(10) ||
                   '' || CHR(13)|| CHR(10) ||
                   'OFF' || CHR(13)|| CHR(10) ||
                   '--WebCT_Enterprise_API_Boundary' || CHR(13)|| CHR(10) ||
                   'Content-Disposition: form-data; name="TIMESTAMP"' || CHR(13)|| CHR(10) ||
                   '' || CHR(13)|| CHR(10) ||
                   timestamp || CHR(13)|| CHR(10) ||
                   '--WebCT_Enterprise_API_Boundary' || CHR(13)|| CHR(10) ||
                   'Content-Disposition: form-data; name="AUTH"' || CHR(13)|| CHR(10) ||
                   '' || CHR(13)|| CHR(10) ||
                   mac || CHR(13)|| CHR(10) ||
                   '--WebCT_Enterprise_API_Boundary' || CHR(13)|| CHR(10) ||
                   'Content-Disposition: form-data; name="FILENAME"; filename="xlist.xml"' || CHR(13)|| CHR(10) ||
                   '' || CHR(13)|| CHR(10) ||
                   total_xml_string || CHR(13)|| CHR(10) ||
                   '--WebCT_Enterprise_API_Boundary--' || CHR(13)|| CHR(10));
    resp := utl_http.get_response(req);
    utl_http.read_text(resp, val);
    utl_http.end_response(resp);
    When I watch the network traffic generated by this PL/SQL I do not have any carriage returns which makes WebCT to believe that the message does not carry the proper data and returns Fatal Failure(99): Invalid URL arguments...
    Is there somewhere where I can see sample code for placing HTTP requests using the utl_http package? Or if I am doing something obviously wrong (I am new at this whole PL/SQL thing...) please let me know.
    Thank you
    Bogdan

    If UTL_HTTP.SET_TRANSFER_TIMEOUT has no effect, probably your hang is due to the fact that the machine is completely down and inaccessible.
    As the name suggests, SET_TRANSFER_TIMEOUT only controls the timeout when UTL_HTTP succeeds in making a connection to the remote Web server and it times out the request when no more response is received by certain time while the connection is not closed by the remote server either.
    In your case, you probably need a connect-timeout which isn't provided by UTL_HTTP (yet).

  • ACE 4710 and mangled HTTP requests

    After replacing a Cisco CSS/SSL  Accelorator and PIX firewall with an ACE 4710 to do load balancing and  SSL encryption behind an ASA firewall we started seeing mangled HTTP  requests in the Apache access logs for the servers in the server farm.  Here is one example:
    XX.XX.XXX.XXX  - - [21/Oct/2012:01:42:12 -0500]  "heckoutFlag=true&verifyPassword=false&newsletter=false&emailaddress=&email2=&pass1=&pass2=&username=POST /register/LServlet HTTP/1.1" 501 3322 "https://www.ourwebsite.com/register/CServlet" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
    Rather  than appearing just after the timestamp, the "POST /register/LServlet"  is tacked on to header information that shouldn't even appear in the  log. Also the first letter in that header information is always missing  (heckoutFlag instead of checkoutFlag in this example). 
    The  mangled request always shows up as a 501 HTTP error and shows up late  in the Apache access logs (timestamp is out of chronogical order) and  always appears with several duplicate POSTs:
    XX.XX.XXX.XXX - - [21/Oct/2012:01:42:23 -0500] "POST /register/LServlet HTTP/1.1" 200 8537 "https://www.ourwebsite/register/CServlet" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
    XX.XX.XXX.XXX - - [21/Oct/2012:01:44:12 -0500] "POST /register/LServlet HTTP/1.1" 200 8537 "https://www.ourwebsite/register/CServlet" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
    XX.XX.XX.XXX  - - [21/Oct/2012:01:42:12 -0500]   "heckoutFlag=true&verifyPassword=false&newsletter=false&emailaddress=&email2=&pass1=&pass2=&username=POST /register/LServlet HTTP/1.1" 501 3322 "https://www.ourwebsite.com/register/CServlet"  "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
    XX.XX.XXX.XXX - - [21/Oct/2012:01:44:12 -0500] "POST /register/LServlet HTTP/1.1" 200 8537 "https://www.ourwebsite/register/CServlet" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
    This is occurring for several different URLs and not just the one above and for multiple web browsers.
    The ACE load balances to servers running Tomcat 7 with Apache HTTP server v. 2.2.14.
    A recent ACE software upgrade to A5(2.1) has not fixed the problem.
    Has anyone seen this before?
    Thanks for any insight you can provide.
    -Kari

    Hi Kari,
    Do you have a sample of the configuration which you got with the CSS?
    What is the current configuration which you got on the ACE?
    Can you shows this output: # show stats http?
    Jorge

  • Call web service (multipart MIME soap request) using pl/sql (utl_http)

    I've the following header and http request.
    POST http://deab/DexNETWebServices_4_0_0_4/LoginService.svc HTTP/1.1
    MIME-Version: 1.0
    Content-Type: multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=1";start-info="application/soap+xml"
    VsDebuggerCausalityData: uIDPo5F/qXRc4YJImqB6Ard30cQAAAAAAjIXinpIVUulXLJOsSG7yyv7Lf2yHgpHlIxvc6oeqaAACQAA
    Host: deab
    Content-Length: 1017
    Expect: 100-continue
    Accept-Encoding: gzip, deflate
    Connection: Keep-Alive
    --uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=1
    Content-ID: <http://tempuri.org/0>
    Content-Transfer-Encoding: 8bit
    Content-Type: application/xop+xml;charset=utf-8;type="application/soap+xml"
    <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://tempuri.org/ILoginService/LoginByUserName</a:Action><a:MessageID>urn:uuid:cf410a05-23d4-4b92-a22c-329cbc19fbe7</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><a:To s:mustUnderstand="1">http://deab/DexNETWebServices_4_0_0_4/LoginService.svc</a:To></s:Header><s:Body><LoginByUserName xmlns="http://tempuri.org/"><systemId>19e0ddb4-5fa5-41ee-b624-aea762865a6c</systemId><strName>FirmwareUpdateLogQueryWorker</strName><productId>0af39a3e-6549-485b-872f-b73413203998</productId><password>abc</password></LoginByUserName></s:Body></s:Envelope>
    --uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=1--
    I'm using the following code to set the header from PL/SQL and call the request. But UTL_HTTP.get_response returns the error 400 Bad Request.
    DECLARE
       l_request         CLOB;
       l_http_req        UTL_HTTP.req;
       l_http_resp       UTL_HTTP.resp;
       v_buffer          VARCHAR2 (32767);
       p_status_code     NUMBER (9);
       p_error_message   VARCHAR2 (32767);
       p_response        CLOB;
    BEGIN
      l_request :=
                '--uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=1'
             || CHR (13)
             || 'Content-ID: <http://tempuri.org/0>'
             || CHR (13)
             || 'Content-Transfer-Encoding: 8bit'
             || CHR (13)
             || 'Content-Type: application/xop+xml;charset=utf-8;type="application/soap+xml"'
             || CHR (13)
             || CHR (13)
             || '<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://tempuri.org/ILoginService/LoginByUserName</a:Action><a:MessageID>urn:uuid:cf410a05-23d4-4b92-a22c-329cbc19fbe7</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><a:To s:mustUnderstand="1">http://deab/DexNETWebServices_4_0_0_4/LoginService.svc</a:To></s:Header><s:Body><LoginByUserName xmlns="http://tempuri.org/"><systemId>'
             || '19e0ddb4-5fa5-41ee-b624-aea762865a6c'
             || '</systemId><strName>'
             || 'FirmwareUpdateLogQueryWorker'
             || '</strName><productId>'
             || '0af39a3e-6549-485b-872f-b73413203998'
             || '</productId><password>'
             || 'abc'
             || '</password></LoginByUserName></s:Body></s:Envelope>'
             || CHR (13)
             || '--uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=1--';
          DBMS_OUTPUT.put_line ('request ' || l_request);
          l_http_req := UTL_HTTP.begin_request ('http://deab/DexNETWebServices_4_0_0_4/LoginService.svc', 'POST', 'HTTP/1.1');
          UTL_HTTP.set_header (l_http_req, 'MIME-Version', '1.0');
          UTL_HTTP.set_header (
             l_http_req,
             'Content-Type',
             'multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=1";start-info="application/soap+xml"');
          --      UTL_HTTP.set_header (l_http_req, 'Content-ID', '<http://tempuri.org/0>');
          --      UTL_HTTP.set_header (l_http_req, 'Content-Transfer-Encoding', '8bit');
          UTL_HTTP.set_header (
             l_http_req,
             'VsDebuggerCausalityData',
             'uIDPo5F/qXRc4YJImqB6Ard30cQAAAAAAjIXinpIVUulXLJOsSG7yyv7Lf2yHgpHlIxvc6oeqaAACQAA');
          UTL_HTTP.set_header (l_http_req, 'Content-Length', LENGTH (l_request));
          --                  UTL_HTTP.set_header (l_http_req,
          --                                       'SOAPAction',
          --                                       'http://tempuri.org/ILoginService/LoginByUserName');
          UTL_HTTP.write_text (l_http_req, l_request);
          DBMS_LOB.createtemporary (p_response, FALSE);
          l_http_resp := UTL_HTTP.get_response (l_http_req);
       BEGIN
          LOOP
             UTL_HTTP.read_text (l_http_resp, v_buffer, 32767);
             DBMS_OUTPUT.put_line (v_buffer);
             DBMS_LOB.writeappend (p_response, LENGTH (v_buffer), v_buffer);
          END LOOP;
       EXCEPTION
          WHEN UTL_HTTP.end_of_body
          THEN
             NULL;
       END;
       UTL_HTTP.end_response (l_http_resp);
       p_status_code := l_http_resp.status_code;
       p_error_message := l_http_resp.reason_phrase;
       p_response := REPLACE (p_response, '&lt;', '<');
       p_response := REPLACE (p_response, '&gt;', '>');
       DBMS_OUTPUT.put_line (
          'Status: ' || p_status_code || '-' || p_error_message || ': ' || p_response);
    END;
    Thank you for your help on this.

    HI Michiel
    I am also trying to achieve something similar to that. I am trying to call a web service that sends an xml attachment over MTOM? Kindly, let me know if this was achievable from your end? I mean how did the issue got resolved.
    thanks
    vijay

  • HTTP request using PL/SQL

    I've the following header and http request.
    POST http://deab/DexNETWebServices_4_0_0_4/LoginService.svc HTTP/1.1
    MIME-Version: 1.0
    Content-Type: multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=1";start-info="application/soap+xml"
    VsDebuggerCausalityData: uIDPo5F/qXRc4YJImqB6Ard30cQAAAAAAjIXinpIVUulXLJOsSG7yyv7Lf2yHgpHlIxvc6oeqaAACQAA
    Host: deab
    Content-Length: 1017
    Expect: 100-continue
    Accept-Encoding: gzip, deflate
    Connection: Keep-Alive
    --uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=1
    Content-ID: <http://tempuri.org/0>
    Content-Transfer-Encoding: 8bit
    Content-Type: application/xop+xml;charset=utf-8;type="application/soap+xml"
    <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://tempuri.org/ILoginService/LoginByUserName</a:Action><a:MessageID>urn:uuid:cf410a05-23d4-4b92-a22c-329cbc19fbe7</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><a:To s:mustUnderstand="1">http://deab/DexNETWebServices_4_0_0_4/LoginService.svc</a:To></s:Header><s:Body><LoginByUserName xmlns="http://tempuri.org/"><systemId>19e0ddb4-5fa5-41ee-b624-aea762865a6c</systemId><strName>FirmwareUpdateLogQueryWorker</strName><productId>0af39a3e-6549-485b-872f-b73413203998</productId><password>abc</password></LoginByUserName></s:Body></s:Envelope>
    --uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=1--
    I'm using the following code to set the header from PL/SQL.
    l_http_req := UTL_HTTP.begin_request ('http://deab/DexNETWebServices_4_0_0_4/LoginService.svc', 'POST', 'HTTP/1.1');
    UTL_HTTP.set_header (
             l_http_req,
             'Content-Type',
             'multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=1";start-info="application/soap+xml"');
    UTL_HTTP.set_header (l_http_req, 'Content-Length', LENGTH (l_request));
    But UTL_HTTP.get_response returns the error 400 Bad Request. How do I set MIME-Version and VsDebuggerCausalityData from the header?
    Thank you for your help on this.

    Here is the complete code that returns the 400 Bad Request error. Thanks for your help.
    DECLARE
       l_request         CLOB;
       l_http_req        UTL_HTTP.req;
       l_http_resp       UTL_HTTP.resp;
       v_buffer          VARCHAR2 (32767);
       p_status_code     NUMBER (9);
       p_error_message   VARCHAR2 (32767);
       p_response        CLOB;
    BEGIN
       l_request :=
             '--uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=1
    Content-ID: <http://tempuri.org/0>
    Content-Transfer-Encoding: 8bit
    Content-Type: application/xop+xml;charset=utf-8;type="application/soap+xml"
    <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://tempuri.org/ILoginService/LoginByUserName</a:Action><a:MessageID>urn:uuid:cf410a05-23d4-4b92-a22c-329cbc19fbe7</a:MessageID><a:ReplyTo><a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address></a:ReplyTo><a:To s:mustUnderstand="1">http://deab/DexNETWebServices_4_0_0_4/LoginService.svc</a:To></s:Header><s:Body><LoginByUserName xmlns="http://tempuri.org/"><systemId>'
          || '19e0ddb4-5fa5-41ee-b624-aea762865a6c'
          || '</systemId><strName>'
          || 'FirmwareUpdateLogQueryWorker'
          || '</strName><productId>'
          || '0af39a3e-6549-485b-872f-b73413203998'
          || '</productId><password>'
          || 'abc'
          || '</password></LoginByUserName></s:Body></s:Envelope>
    --uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=1--';
       DBMS_OUTPUT.put_line ('request ' || l_request);
       l_http_req :=
          UTL_HTTP.begin_request (
             'http://deab/DexNETWebServices_4_0_0_4/LoginService.svc',
             'POST',
             'HTTP/1.1');
       UTL_HTTP.set_header (
          l_http_req,
          'Content-Type',
          'multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:e4c19840-745d-45b2-90ca-12d71be4cfd9+id=1";start-info="application/soap+xml"');
       UTL_HTTP.set_header (l_http_req, 'Content-Length', LENGTH (l_request));
       UTL_HTTP.set_header (l_http_req, 'MIME-Version', '1.0');
       UTL_HTTP.set_header (
          l_http_req,
          'VsDebuggerCausalityData',
          'uIDPo5F/qXRc4YJImqB6Ard30cQAAAAAAjIXinpIVUulXLJOsSG7yyv7Lf2yHgpHlIxvc6oeqaAACQAA');
       UTL_HTTP.write_text (l_http_req, l_request);
       DBMS_LOB.createtemporary (p_response, FALSE);
       l_http_resp := UTL_HTTP.get_response (l_http_req);
       BEGIN
          LOOP
             UTL_HTTP.read_text (l_http_resp, v_buffer, 32767);
             DBMS_OUTPUT.put_line (v_buffer);
             DBMS_LOB.writeappend (p_response, LENGTH (v_buffer), v_buffer);
          END LOOP;
       EXCEPTION
          WHEN UTL_HTTP.end_of_body
          THEN
             NULL;
       END;
       UTL_HTTP.end_response (l_http_resp);
       p_status_code := l_http_resp.status_code;
       p_error_message := l_http_resp.reason_phrase;
       p_response := REPLACE (p_response, '&lt;', '<');
       p_response := REPLACE (p_response, '&gt;', '>');
       DBMS_OUTPUT.put_line (
          'Status: ' || p_status_code || '-' || p_error_message || ': ' || p_response);
    END;

  • Error log on http request from business connector (BC)

    Hi all,
    We are sending http requests from our business connector to one client but the messages keep having log errors :
    server.log details :
    003C24  [B2BCORE.0064.0014] Opening Socket https://www.qab2b.xxx.com:443/invoke/wm.b2b.cxml:receiveCXML  proxy=10.28.38.27:80
    003C25  [B2BCORE.0038.0002] --> CONNECT www.qab2b.xxx.com:443 HTTP/1.0
    003C26  [B2BCORE.0038.0002] --> User-Agent: Mozilla/4.0 [en] (WinNT; I)
    003C27  [B2BCORE.0038.0002] --> Accept: image/gif, /
    003C28  [B2BCORE.0038.0002] --> Host: www.qab2b.xxx.com:443
    003C29  [B2BCORE.0038.0002] --> Proxy-Authorization: Basic YWJ1c2luZXNzY29ubmVjdG9yOmFidXNpbjA0
    003C2A  [B2BCORE.0038.0002] --> Authorization: Basic U0ZSQ2VnZXRlbDoyMDA3KkVBSV9TRlI=
    003C2B  [B2BCORE.0038.0002] > Content-type: multipart/mixed; boundary="--=_Part_0_1941981.1219399983635"
    003C2C  [B2BCORE.0038.0002] --> Message-ID: <7159395.1219399983666.JavaMail.SYSTEM@sw0030>
    003C2D  [B2BCORE.0038.0002] --> Mime-Version: 1.0
    003C2E  [B2BCORE.0040.0001] HTTP/1.1 200
    003C2F  [B2BCORE.0064.0017] Proxy Header <--Connection established
    003C30  [B2BCORE.0038.0002] --> POST /invoke/wm.b2b.cxml:receiveCXML HTTP/1.0
    003C31  [B2BCORE.0038.0002] --> User-Agent: Mozilla/4.0 [en] (WinNT; I)
    003C32  [B2BCORE.0038.0002] --> Accept: image/gif, /
    003C33  [B2BCORE.0038.0002] --> Host: www.qab2b.xxx.com:443
    003C34  [B2BCORE.0038.0002] --> Proxy-Authorization: Basic YWJ1c2luZXNzY29ubmVjdG9yOmFidXNpbjA0
    003C35  [B2BCORE.0038.0002] --> Authorization: Basic U0ZSQ2VnZXRlbDoyMDA3KkVBSV9TRlI=
    003C36  [B2BCORE.0038.0002] > Content-type: multipart/mixed; boundary="--=_Part_0_1941981.1219399983635"
    003C37  [B2BCORE.0038.0002] --> Message-ID: <7159395.1219399983666.JavaMail.SYSTEM@sw0030>
    003C38  [B2BCORE.0038.0002] --> Mime-Version: 1.0
    003C39  [B2BCORE.0038.0002] --> Content-Length: 188225
    003C3A  [B2BCORE.0040.0001] HTTP/1.0 200
    003C3B  [B2BCORE.0041.0001] ssnid=86087kPxFCsECcmXU5DHUAInKY9mEIIU-9355222; path=/;
    003C3C  [B2BCORE.0038.0002] <-- Set-Cookie: ssnid=86087kPxFCsECcmXU5DHUAInKY9mEIIU-9355222; path=/;
    003C3D  [B2BCORE.0038.0002] <-- Content-Type: multipart/mixed; boundary="----=_Part_0_1941981.1219399983635"
    003C3E  [B2BCORE.0038.0002] <-- Connection: Close
    003C3F  [B2BCORE.0038.0002] <-- Content-Length: 0
    003C40  [B2BCORE.0049.0008] Sequence : index=8 depth=3
    003C41  [B2BCORE.0049.0008] Sequence : index=6 depth=2
    003C42  [B2BCORE.0049.0008] Sequence : index=1 depth=3
    003C43  [B2BCORE.0049.0005] Invoke : index=1 depth=4
    003C44  [B2BCORE.0049.0008] Sequence : index=2 depth=3
    003C45  [B2BCORE.0049.0005] Invoke : index=1 depth=4
    003C46  [B2BCORE.0049.0008] Sequence : index=3 depth=3
    003C47  [B2BCORE.0049.0005] Invoke : index=1 depth=4
    003C48  [B2BSERV.0048.9999] Array index out of range: -1
    003C49  [B2BCORE.0049.0008] Sequence : index=4 depth=3
    003C4A  [B2BCORE.0050.0004] Copy failed: (Simple) No source data available: to=/returnedStatusCode(0), from=/returnHttp(0)/cXML(0)/Response(0)/Status(0)/@code(0)
    003C4B  [B2BCORE.0050.0004] Copy failed: (Simple) No source data available: to=/returnedMessage(0), from=/returnHttp(0)/cXML(0)/Response(0)/Status(0)/*body(0)
    003C4C  [B2BCORE.0050.0004] Copy failed: (Simple) No source data available: to=/returnedText(0), from=/returnHttp(0)/cXML(0)/Response(0)/Status(0)/@text(0)
    003C4D  [B2BCORE.0049.0008] Sequence : index=5 depth=3
    003C4E  [B2BCORE.0049.0008] Sequence : index=6 depth=3
    003C4F  [B2BCORE.0049.0008] Sequence : index=7 depth=2
    003C50  [B2BCORE.0049.0008] Sequence : index=2 depth=1
    003C51  [B2BSERV.0056.0003] Unable to send mail. Illegal address
    error java log on server>logs>error:
    2008-08-22 12:16:33 CEST java.lang.ArrayIndexOutOfBoundsException: Array index out of range: -1
         at com.wm.util.List.elementAt(List.java:101)
         at com.wm.lang.xml.token.BlockInputBuffer.getChar(BlockInputBuffer.java:59)
         at com.wm.lang.xml.TextNode.appendSqueezedText(TextNode.java:178)
         at com.wm.lang.xml.ElementNode.appendSqueezedText(ElementNode.java:333)
         at com.wm.lang.xml.ElementNode.getTextOfChildren(ElementNode.java:309)
         at com.wm.lang.xml.Document.getTextOfChildren(Document.java:542)
         at com.wm.app.b2b.services.DocumentToRecordService.recursiveCollect(DocumentToRecordService.java:661)
         at com.wm.app.b2b.services.DocumentToRecordService.bind(DocumentToRecordService.java:356)
         at pub.web.documentToRecord(web.java:667)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:281)
         at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:693)
         at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:140)
         at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:292)
         at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:559)
         at com.wm.lang.flow.FlowState.step(FlowState.java:430)
         at com.wm.lang.flow.FlowState.invoke(FlowState.java:400)
         at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:1786)
         at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:693)
         at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:455)
         at com.wm.app.b2b.server.Service.doInvoke(Service.java:495)
         at com.wm.app.b2b.server.Service.doInvoke(Service.java:392)
         at wm.PartnerMgr.gateway.transport.B2B.OutboundProcess(B2B.java:157)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:281)
         at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:693)
         at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:140)
         at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:292)
         at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:559)
         at com.wm.lang.flow.FlowState.step(FlowState.java:430)
         at com.wm.lang.flow.FlowState.invoke(FlowState.java:400)
         at com.wm.app.b2b.server.FlowSvcImpl.baseInvoke(FlowSvcImpl.java:1786)
         at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:693)
         at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:455)
         at com.wm.app.b2b.server.Service.doInvoke(Service.java:495)
         at com.wm.app.b2b.server.Service.doInvoke(Service.java:464)
         at wm.PartnerMgr.gateway.runtime.InboundProcess(runtime.java:423)
         at pub.sap.transport.RFC.InboundProcess(RFC.java:190)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:281)
         at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:693)
         at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:455)
         at com.wm.app.b2b.server.Service.doInvoke(Service.java:495)
         at com.wm.app.b2b.server.Service.doInvoke(Service.java:464)
         at com.wm.pkg.sap.rfc.Listener.handleRequest(Listener.java:286)
         at com.sap.mw.jco.JCO$Server.dispatchRequest(JCO.java:6022)
         at com.sap.mw.idoc.jco.JCoIDoc$Server.dispatchRequest(JCoIDoc.java:10120)
         at com.wm.pkg.sap.rfc.Listener.dispatchRequest(Listener.java:186)
         at com.sap.mw.jco.rfc.MiddlewareRFC$Server.nativeListen(Native Method)
         at com.sap.mw.jco.rfc.MiddlewareRFC$Server.listen(MiddlewareRFC.java:1070)
         at com.sap.mw.jco.JCO$Server.listen(JCO.java:5797)
         at com.sap.mw.jco.JCO$Server.run(JCO.java:5731)
         at com.wm.pkg.sap.rfc.Listener.run(Listener.java:101)
         at java.lang.Thread.run(Thread.java:479)
    Thanks for your support on this eai.
    Regards,
    Laurent.

    ok, I think we do not need the save/loadPipeline things, because you can debug the flow without that. I first thought you act as HTTP server, but you issue the client call in the flow itself.
    Looking at the logs more carefully, it shows for example:
    Copy failed: (Simple) No source data available: to=/returnedStatusCode(0), from=/returnHttp(0)/cXML(0)/Response(0)/Status(0)/@code(0)
    But you say have that input:
    <?xml version="1.0"?>
    <!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.011/cXML.dtd">
    <cXML version="1.2.011" payloadID="20080825171850716.18637uTQ9ExzheaK+H6b7O9oCAQWPzHA-9355222.8b3632def70da7220004d0b6" timestamp="2008-08-25T17:18:50-CEST">
    <Response>
    <Status code="500">No cXML document received from sender.</Status>
    </Response>
    </cXML>
    So we see that your mappings assumptions do not match the result structure.
    The other problem is that you get a status 500 and do not receive a cXML document, but that might be ok, depending on what parameters you pass to the other HTTP server. At least, you get a meaningful error message back from the server, meaning communication is ok.
    I suggest you first correct those "copy failed" issues and then check by single-stepping where exactly the flow fails and check that input again.
    By the way, when I feed the above cXML into recordToDocument, it works fine. Did you specify other input parameters besides "node" (e.g. recordName) ? And again, are you on Core Fix 8 ?
    CSY

  • Server keeps refusing HTTP request while uploading file

    Hello, I have written an applet that uses sockets to communicate with HTTP server. I use following string to send a HTTP request to a server:
    req = "POST /!pages/upload.php HTTP/1.1\r\n";
        req += "Host: www.austyn.sk\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6\r\n";
        req += "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n";
        req += "Accept-Language: sk,cs;q=0.8,en-us;q=0.5,en;q=0.3\r\n";
        req += "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n";
        req += "Keep-Alive: 300\r\n";
        req += "Connection: keep-alive\r\n";
        req += "Referer: http://www.upnito.sk/\r\n";
        req += "Content-Length: 500\r\n";
        req += "Content-Type: multipart/form-data;boundary=007\r\n";
        req += "--007\r\n";
        req += "Content-Disposition: form-data; name=\"subor\"; filename=\"msvcp80.txt\"\r\n";
        req += "Content-Type: text/plain\r\n\n";
        req += "abcdef\r\n";
        req += "--007--\r\n\r\n";I get response like this:
    HTTP/1.1 400 Bad Request
    Date: Sat, 15 Sep 2007 14:24:42 GMT
    Server: Apache/2.0.55 (Ubuntu) PHP/5.1.2 mod_ssl/2.0.55 OpenSSL/0.9.8a
    Content-Length: 297
    Connection: close
    Content-Type: text/html; charset=iso-8859-1
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>400 Bad Request</title>
    </head><body>
    <h1>Bad Request</h1>
    <p>Your browser sent a request that this server could not understand.<br />
    Request header field is missing ':' separator.<br />
    <pre>
    --007</pre>
    </p>
    </body></html>I think that my request should be alright. I used the Live HTTP headers extension on Firefox and even a packet sniffer to get the entire communication between server and client during HTTP upload and I wrote the request string according to that. It seems, that the server doesn't like the first boundary --007, which marks the beginning of the form element..
    So what's wrong with that request string?
    Edited by: whitewash on Sep 15, 2007 7:28 AM

    on some other links people are saying to add this line for solving this problem :
    "java -DHTTPClient.log.file=httpclient.log -DHTTPClient.forceHTTP_1.0=true -DHTTPClient.disableKeepAlives=true -DHTTPClient.dontTimeoutRespBody=true"
    does nyone know what to do with this line....where to add this??....
    FYI i am using weblogic server

  • Differentiating HTTP Request through a URL and a value change listener

    Version Details:
    Oracle JDeveloper 11g Release 1 11.1.1.4.0
    Studio Edition Version 11.1.1.4.0
    Build JDEVADF_11.1.1.4.0_GENERIC_101227.1736.5923
    IDE Version: 11.1.1.4.37.59.23
    Product ID: oracle.jdeveloper
    Product Version: 11.1.1.4.37.59.23
    ADF Business Components     11.1.1.59.23
    Java(TM) Platform     1.6.0_21
    Oracle IDE     11.1.1.4.37.59.23
    Versioning Support     11.1.1.4.37.59.23
    Base Details:
    The Product, that a different team is working on (<i><b>which I cannot access, code, touch,...</b></i>), creates reports and essentially generates a URL with a bunch of parameters:
    http://<host>:<port>/myApplication/main.jspx?parameter1=value1&parameter2=value2...When the user clicks on an "Edit" button, a modal popup window is displayed (using jQuery) with an embedded iFrame with its source pointing to the above URL.
    The "myApplication" is an ADF application which brings up an ADF form based on the parameters. Once the user enters the data, validations occur and the data is written into a total of 3 different Tables in the Database. Once the operation is finished, the user closes the popup by clicking on the "X" button of the popup window, which essentially does "popup.*hide()*".
    Limitations:
    <li>Since there are varied combination of parameter values and associated ADF forms, taskflows is not* an option.
    <li>Since the logic of generating the ADF form is not straightforward, ADF BC is not* an option.
    <li>Since validations are based on the value change listeners, the managed bean has to be a session scope_ bean.
    Problem:
    When, for the first time, the user clicks on the Edit button with a particular set of parameter values, the corresponding ADF form is displayed and things work normal. Since the managed bean is under session scope, the form generated for the first popup window stays the same for any subsequent popup windows, even when the URL and its parameters are completely different. As I can not listen to the popup close event, I cannot invalidate my session either.
    I tried using filters in the web.xml to grab the request and apply the business logic. Due to the presence of multiple value change listeners (too many <tt>autosubmit=true</tt>), every value change listener triggers a request and so the business logic gets applied with every value change.
    After some tests, I deduced that the difference between the call from iFrame and the call from value change is the HTTP Request Method - GET for iFrame and POST for value change listener. So in my filter I apply the business logic when there is a GET request and not apply when its a POST request.
    Turns out, that is not a valid enough differentiation between the two requests being made. Sometimes, even the value change listeners are issuing a GET request.
    Question:
    *<font color="red">1</font>*. Is there a way to force the value change listeners to always trigger a POST request?
    *<font color="red">2</font>*. Is there a way to differentiate the requests originating from the other team's Product and those generated by my own value change listeners?
    *<font color="red">3</font>*. Is there a different approach, incorporating the above-mentioned limitations, to clear out the session scope each time when a request is made through iFrame? That is, whenever a request is made through the other team's Product?
    Edited by: user737922 on Apr 13, 2011 10:58 AM

    _(Temporary) Solution_:
    Summary:
    I am using the request parameter <b><tt>_adf.ctrl-state</tt></b> to differentiate between the HTTP requests that my application receives.
    Details:
    When I receive the request from the other team's Product, I receive a <tt>GET</tt> and a <tt>adf.ctrl-state</tt> value which I store into a local variable in my session-scoped managed bean. The <tt>adf.ctrl-state</tt> value stays the same for all requests (<tt>GET</tt> or <tt>POST</tt>) made from within my own application. It changes only when there is a new request from the other team's Product.
    Also, as my application is accessed through an iFrame, there is no possibility of the generated URL being modified by the end-user.
    For now it seems that the solution is appropriate but I am not fully confident if relying on the <tt>_adf.ctrl-state</tt> value is the best approach.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • 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

  • Taleo Connect Client http request

    Hi guys,
    I'm trying to use Taleo connect client to post http request with the following template:
    POST /way HTTP/1.0
    Host: host
    Content-type: application/x-www-form-urlencoded
    Content-length: request_length
    Accept: */*
    type=type&username=username&password=passwordAccording to user guide: +"Custom HTTP headers are supported through the use of advanced parameters. A parameter having the prefix Header: followed by the name of the header as the name of the parameter can be defined. For example, to define the Content-type the parameter name will be Header:Content-type."+ I have inserted following specification (please read as a table);
    Name Value
    Header: Method POST /way HTTP/1.0
    Header:Host
    Header:Content-type application/x-www-form-urlencoded
    Header: Content-length request_length
    Header: Accept */*
    type=type&username=username&password=password
    Could anyone help me and tell me if it's on the good way or explain me what should i correct?
    Thank you
    N.

    CONNECT command is used when it wants to open another connection. it is similar to secure protocol https. so what i think is you have to open another connection to google and port is 443. but different between connect and GET/POST menthod will send the request header to the server. but connect method will not send any request header but it will transfer some data through that connection. data can be anything like encrypted information, binary file and so on.

  • Java Networking - displaying HTTP Request stream

    Hi all,
    I am using java.net.HttpURLConnection object to get a response from a http server. I need to see/display the actual HTTP Request stream (containing POST HTTP/1.1 etc.) being sent to the server. How do I do it?
    Please help.
    Nikhil

    Pete_The_Hat,
    Thanks a lot for advising the packet sniffer. It works pretty well for HTTP requests. However, for HTTPS requests (SSL), the data in the packets (that I can see through the sniffer) is encrypted. How do I collaborate with the Browser (where the encryption/decryption keys are stored) to see the decrypted/unencrypted code?
    It seems too much of work to manually assemble the encrypted data from different packets and then try to decrypt it somehow.
    What's the right approach to see/sniff unencrypted HTTPS Streams? It appears to me to be outside the realm of packet sniffers because data in SSL packets is already encrypted before packets are constructed.
    Networking Gurus please help.

  • Mac would not reply to Handoff encryption key request

    I have this handoff one way problem between 2 Macs and another iOS devices, a Macbook Pro can get see others handing off, but none of others can see anything from the Macbook Pro. After monitoring the logs and keychain, I discovered that the Macbook Pro simply won't reply to any Handoff encryption key request.
    I have cleared all the handoff related keychains off both Macs, and reproduced the problem. After rebooting both Macs, and an iPad. I got the following logs and keys.
    From a Mac Pro:
    Own encryption key
    iPad's key
    Log
    26/3/15 7:08:56.443 am sharingd[329]: 07:08:56.442 : Requesting Handoff encryption key from "McB iPad Retina"
    26/3/15 7:08:57.341 am sharingd[329]: 07:08:57.341 : Requesting Handoff encryption key from "Macbrush’s MBP Retina"
    26/3/15 7:09:17.945 am sharingd[329]: 07:09:17.944 : Requesting Handoff encryption key from "McB iPad Retina"
    26/3/15 7:09:17.946 am sharingd[329]: 07:09:17.945 : Requesting Handoff encryption key from "Macbrush’s MBP Retina"
    26/3/15 7:09:19.351 am sharingd[329]: 07:09:19.351 : Received a new Handoff encryption key from "McB iPad Retina"
    26/3/15 7:09:27.788 am sharingd[329]: 07:09:27.787 : Replying to Handoff encryption key request from "McB iPad Retina"
    26/3/15 7:10:28.947 am sharingd[329]: 07:10:28.946 : Requesting Handoff encryption key from "Macbrush’s MBP Retina"
    From the Macbook Pro:
    Own encryption key
    iPad's key
    Mac Pro's key
    Log
    26/3/15 7:03:31.157 am sharingd[310]: 07:03:31.156 : Requesting Handoff encryption key from "McB Mac Pro"
    26/3/15 7:03:51.661 am sharingd[310]: 07:03:51.661 : Requesting Handoff encryption key from "McB Mac Pro"
    26/3/15 7:03:52.561 am sharingd[310]: 07:03:52.560 : Received a new Handoff encryption key from "McB Mac Pro"
    26/3/15 7:08:56.544 am sharingd[310]: 07:08:56.543 : Requesting Handoff encryption key from "McB iPad Retina"
    26/3/15 7:09:18.040 am sharingd[310]: 07:09:18.040 : Requesting Handoff encryption key from "McB iPad Retina"
    26/3/15 7:09:19.227 am sharingd[310]: 07:09:19.227 : Received a new Handoff encryption key from "McB iPad Retina"
    From the look of it, either the Macbook Pro didn't receive any encryption key request, or was ignoring them for some reason. So the Macbook got everyone's key hence can see others' Handoff payload, but since none of others had the Macbook Pro's key, its payload could not be seen by any other devices.
    Now I know the cause, but I have no idea how to fix it. Any recommendation and suggestions would be very much appreciated.
    Cheers
    Kenneth

    Here is the results. BTW, that's the longest, messiest script I have ever  seen! :-P
    Start time: 01:23:08 03/27/15
    Revision: 1307
    Model Identifier: MacBookPro11,3
    System Version: OS X 10.10.2 (14C1514)
    Kernel Version: Darwin 14.1.0
    Time since boot: 1:27
    UID: 501
    USB
        v240b (Hewlett Packard)
    Activity
        en0: in 7, out 82 (KiB/s)
    Energy (lifetime)
        WindowServer (UID 88): 11.81
        kernel_task (UID 0): 6.52
    Memory (MB)
        kernel_task (UID 0): 1417
    Font issues: 6
    Listeners
        kdc: kerberos
        launchd: afpovertcp
        launchd: microsoft-ds
        launchd: ssh
    Diagnostic reports
        2015-03-26 Google Drive crash x2
        2015-03-26 discoveryd crash
        2015-03-26 sharingd crash
    HID errors: 10
    Kernel log
        Mar 26 21:20:33 key_getsastat: Error finding SAs.
        Mar 26 21:21:03 key_getsastat: Error finding SAs.
        Mar 26 21:24:20 SATA WARNING: IDENTIFY DEVICE checksum not implemented.
        Mar 26 21:24:28 SIOCPROTODETACH_IN6: utun0 error=6
        Mar 26 21:25:22 utun_start: ifnet_disable_output returned error 12
        Mar 26 21:53:29 [IOBluetoothHostControllerUSBTransport][ReceiveInterruptData] -- kIOReturnAborted, data size is 0, but data in buffer -- (data Length = 39, packet length = 41)  Data Content:
        Mar 26 21:53:31 [IOBluetoothHostControllerUSBTransport][ReceiveInterruptData] -- previous data from kIOReturnAborted -- before combine the data (39)
        Mar 26 21:53:31 [IOBluetoothHostControllerUSBTransport][ReceiveInterruptData] -- previous data from kIOReturnAborted -- after combine the data (39)
        Mar 26 22:03:04 TLV Error:
        Mar 26 22:03:04 IO80211AWDLPeerManager::updateLocalRequests can't allocate service descriptor for add len 30 type 2 Tlv Error
        Mar 26 22:41:42 SATA WARNING: IDENTIFY DEVICE checksum not implemented.
        Mar 26 22:41:51 SIOCPROTODETACH_IN6: utun0 error=6
        Mar 26 22:43:03 utun_start: ifnet_disable_output returned error 12
        Mar 26 23:24:32 SATA WARNING: IDENTIFY DEVICE checksum not implemented.
        Mar 26 23:24:41 SIOCPROTODETACH_IN6: utun0 error=6
        Mar 26 23:25:04 SATA WARNING: IDENTIFY DEVICE checksum not implemented.
        Mar 26 23:25:13 SIOCPROTODETACH_IN6: utun0 error=6
        Mar 26 23:25:18 utun_start: ifnet_disable_output returned error 12
        Mar 26 23:27:56 SATA WARNING: IDENTIFY DEVICE checksum not implemented.
        Mar 26 23:28:04 SIOCPROTODETACH_IN6: utun0 error=6
        Mar 26 23:47:21 TLV Error:
        Mar 26 23:47:21 IO80211AWDLPeerManager::updateLocalRequests can't allocate service descriptor for add len 30 type 2 Tlv Error
        Mar 26 23:56:10 SATA WARNING: IDENTIFY DEVICE checksum not implemented.
        Mar 26 23:56:19 SIOCPROTODETACH_IN6: utun0 error=6
        Mar 26 23:57:45 utun_start: ifnet_disable_output returned error 12
    System log
        Mar 27 00:51:20 WindowServer: window b4 is already attached to window a9
        Mar 27 00:51:20 WindowServer: window b4 is already attached to window a9
        Mar 27 00:51:21 WindowServer: window b4 is already attached to window a9
        Mar 27 00:51:21 WindowServer: window b4 is already attached to window a9
        Mar 27 00:51:21 WindowServer: window b4 is already attached to window a9
        Mar 27 00:51:21 WindowServer: window b4 is already attached to window a9
        Mar 27 00:51:21 WindowServer: window b4 is already attached to window a9
        Mar 27 00:52:00 WindowServer: window b4 is already attached to window a9
        Mar 27 00:52:00 WindowServer: window b4 is already attached to window a9
        Mar 27 00:52:00 WindowServer: window b4 is already attached to window a9
        Mar 27 00:52:00 WindowServer: window b4 is already attached to window a9
        Mar 27 00:52:00 WindowServer: window b4 is already attached to window a9
        Mar 27 00:52:21 WindowServer: window b4 is already attached to window a9
        Mar 27 00:52:21 WindowServer: window b4 is already attached to window a9
        Mar 27 00:52:21 WindowServer: window b4 is already attached to window a9
        Mar 27 00:52:21 WindowServer: window b4 is already attached to window a9
        Mar 27 00:52:21 WindowServer: window b4 is already attached to window a9
        Mar 27 00:52:23 WindowServer: _CGXGetWindowOrderingGroup: Operation on a window 0xb4 requiring rights 0x5 by caller System Preferences
        Mar 27 00:52:58 WindowServer: WSGetSurfaceInWindow : Invalid surface 1117615552 for window 105
        Mar 27 00:54:14 CalendarAgent: Stream 0x7f9b13a613d0 is sending an event before being opened
        Mar 27 00:54:17 secd:  SOSCoderUnwrap dpZjh3pDb8IzCtdhnahlx6AVHS Decode OTR Protected Packet: The operation couldn’t be completed. (OSStatus error -25293 - dpZjh3pDb8IzCtdhnahlx6AVHS Cannot expose message: -25293)
        Mar 27 01:12:02 CalendarAgent: Stream 0x7f9b13b8a810 is sending an event before being opened
        Mar 27 01:18:33 Notes: Stream 0x60000010c570 is sending an event before being opened
        Mar 27 01:19:59 Notes: Stream 0x60000010a830 is sending an event before being opened
        Mar 27 01:22:48 Notes: Stream 0x60800010dc80 is sending an event before being opened
    launchd log
        Mar 26 23:25:15 com.apple.xpc.launchd.user.501.100007.Aqua: Could not import service from caller: caller = otherbsd.227, service = com.linebreak.CloudLoginHelper, error = 119: Service is disabled
        Mar 26 23:25:15 com.apple.xpc.launchd.user.501.100007.Aqua: Could not import service from caller: caller = otherbsd.227, service = com.radiantlabs.Living-Earth-Launcher, error = 119: Service is disabled
        Mar 26 23:25:15 com.apple.xpc.launchd.user.501.100007.Aqua: Could not import service from caller: caller = otherbsd.227, service = com.tencent.localserver, error = 119: Service is disabled
        Mar 26 23:25:15 com.apple.xpc.launchd.user.501.100007.Aqua: Could not import service from caller: caller = otherbsd.227, service = com.tencent.ScreenCapture, error = 119: Service is disabled
        Mar 26 23:25:15 com.apple.xpc.launchd.user.501.100007.Aqua: Could not import service from caller: caller = otherbsd.227, service = com.whoisonmywifi.helperagent, error = 119: Service is disabled
        Mar 26 23:25:15 com.apple.xpc.launchd.user.501.100007.Aqua: Could not import service from caller: caller = otherbsd.227, service = com.xlogteam.xloghelper, error = 119: Service is disabled
        Mar 26 23:28:14 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = J8RPQ294UB.com.skitch.SkitchHelper, error = 119: Service is disabled
        Mar 26 23:28:14 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.vladalexa.diskfailurehelper, error = 119: Service is disabled
        Mar 26 23:28:14 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.apple.photostream-agent, error = 119: Service is disabled
        Mar 26 23:28:14 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.linebreak.CloudLoginHelper, error = 119: Service is disabled
        Mar 26 23:28:14 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.radiantlabs.Living-Earth-Launcher, error = 119: Service is disabled
        Mar 26 23:28:14 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.tencent.localserver, error = 119: Service is disabled
        Mar 26 23:28:14 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.tencent.ScreenCapture, error = 119: Service is disabled
        Mar 26 23:28:14 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.whoisonmywifi.helperagent, error = 119: Service is disabled
        Mar 26 23:28:14 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.xlogteam.xloghelper, error = 119: Service is disabled
        Mar 26 23:56:25 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = J8RPQ294UB.com.skitch.SkitchHelper, error = 119: Service is disabled
        Mar 26 23:56:25 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.vladalexa.diskfailurehelper, error = 119: Service is disabled
        Mar 26 23:56:25 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.apple.photostream-agent, error = 119: Service is disabled
        Mar 26 23:56:25 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.linebreak.CloudLoginHelper, error = 119: Service is disabled
        Mar 26 23:56:25 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.radiantlabs.Living-Earth-Launcher, error = 119: Service is disabled
        Mar 26 23:56:25 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.tencent.localserver, error = 119: Service is disabled
        Mar 26 23:56:25 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.tencent.ScreenCapture, error = 119: Service is disabled
        Mar 26 23:56:25 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.whoisonmywifi.helperagent, error = 119: Service is disabled
        Mar 26 23:56:25 com.apple.xpc.launchd.user.501.100006.Aqua: Could not import service from caller: caller = otherbsd.224, service = com.xlogteam.xloghelper, error = 119: Service is disabled
        Mar 27 00:43:49 com.apple.xpc.launchd.domain.pid.iBooks.598: Failed to bootstrap path: path = /Applications/iBooks.app/Contents/XPCServices/com.apple.iBooksX-SecureUserDefau lts.xpc, error = 128: The specified path is not a bundle
    Loaded kernel extensions
        at.obdev.nke.LittleSnitch (4234)
        com.Cycling74.driver.Soundflower (1.5.1)
        com.squirrels.airparrot.framebuffer (3)
        com.squirrels.driver.AirParrotSpeakers (1.7)
        com.symantec.kext.internetSecurity (5.2.1f2)
        com.symantec.kext.ips (3.5.1f2)
        com.symantec.kext.ndcengine (1.0f2)
    System services loaded
        at.obdev.littlesnitchd
        com.DuetUSBDaemon.plist
        com.adobe.fpsaud
        com.apple.watchdogd
        com.cisco.anyconnect.vpnagentd
        com.microsoft.office.licensing.helper
        com.oracle.java.Helper-Tool
        com.oracle.java.JavaUpdateHelper
        com.symantec.liveupdate.daemon
        - status: 1
        com.symantec.liveupdate.daemon.ondemand
        com.symantec.sharedsettings
        com.symantec.symdaemon
        org.macosforge.xquartz.privileged_startx
    System services disabled
        org.openldap.slapd
        com.apple.mrt
        com.apple.PasswordService
    Login services loaded
        2BUA8C4S2C.com.agilebits.onepassword-osx-helper
        at.obdev.LittleSnitchUIAgent
        com.ApogeePopup.plist
        com.apple.mrt.uiagent
        com.cisco.anyconnect.gui
        com.google.keystone.user.agent
        com.oracle.java.Java-Updater
        com.symantec.uiagent.application
        org.macosforge.xquartz.startx
    Login services disabled
        com.apple.photostream-agent
    User services disabled
        com.apple.photostream-agent
    Startup items
        /Library/StartupItems/HWNetMgr/HWNetCfg
        /Library/StartupItems/HWNetMgr/HWNetMgr
        /Library/StartupItems/HWNetMgr/StartupParameters.plist
        /Library/StartupItems/HWPortDetect/HWPortCfg
        /Library/StartupItems/HWPortDetect/HWPortDetect
        /Library/StartupItems/HWPortDetect/StartupParameters.plist
    User login items
        Quicksilver
        - /Applications/Quicksilver.app
        Dropbox
        - /Applications/Dropbox.app
        Google Drive
        - /Applications/Google Drive.app
    iCloud errors
        bird 219
        cloudd 91
        comapple.InputMethodKit.UserDictionary 5
        storedownloadd 2
    Continuity errors
        lsuseractivityd 6
        Safari 1
        Contacts 1
        Calendar 1
    Restricted files: 106
    Data packages
        /Users/USER/Dropbox/apps/macjournal/MacJournal Data.mjdoc
    Contents of /Library/LaunchAgents/at.obdev.LittleSnitchUIAgent.plist
        - mod date: Jan  9 15:56:02 2015
        - size (B): 464
        - checksum: 2014742307
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
        <key>KeepAlive</key>
        <true/>
        <key>Label</key>
        <string>at.obdev.LittleSnitchUIAgent</string>
        <key>ProgramArguments</key>
        <array>
        <string>/Library/Little Snitch/Little Snitch Agent.app/Contents/MacOS/Little Snitch Agent</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        </dict>
        </plist>
    Contents of /Library/LaunchAgents/com.ApogeePopup.plist
        - mod date: Mar 10 09:46:31 2015
        - size (B): 640
        - checksum: 2520660496
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
        <key>Label</key>
        <string>com.ApogeePopup.plist </string>
        <key>LimitLoadToSessionType</key>
        <string>Aqua</string>
        <key>KeepAlive</key>
        <dict>
        <key>PathState</key>
        <dict>
        <key>/unloadApogeePopupTemp</key>
        <false/>
        </dict>
        </dict>
        <key>RunAtLoad</key>
        <true/>
        <key>ProgramArguments</key>
        <array>
        <string>/Library/Application Support/Apogee/ApogeePopup.bundle/Contents/ApogeePopup.app/Contents/MacOS/Apoge ePopup</string>
        </array>
        </dict>
        </plist>
    Contents of /Library/LaunchAgents/com.cisco.anyconnect.gui.plist
        - mod date: Dec 20 23:50:41 2010
        - size (B): 734
        - checksum: 993854663
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN
        http://www.apple.com/DTDs/PropertyList-1.0.dtd >
        <plist version="1.0">
        <dict>
             <key>Label</key>
             <string>com.cisco.anyconnect.gui</string>
             <key>ProgramArguments</key>
             <array>
                  <string>open</string>
                  <string>--wait-apps</string>
                  <string>/Applications/Cisco/Cisco AnyConnect VPN Client.app</string>
             </array>
             <key>LimitLoadToSessionType</key>
             <string>Aqua</string>
             <key>KeepAlive</key>
             <dict>
                  <key>PathState</key>
                  <dict>
                       <key>/opt/cisco/vpn/gui_keepalive</key>
                       <true/>
                  </dict>
             </dict>
        </dict>
        </plist>
    Contents of /Library/LaunchAgents/com.oracle.java.Java-Updater.plist
        - mod date: Oct 10 10:33:34 2014
        - size (B): 104
        - checksum: 2293328306
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
        <key>Label</key>
        <string>com.oracle.java.Java-Updater</string>
        <key>ProgramArguments</key>
        <array>
        <string>/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Resources/Java Updater.app/Contents/MacOS/Java Updater</string>
        <string>-bgcheck</string>
        </array>
        <key>StandardErrorPath</key>
        <string>/dev/null</string>
        <key>StandardOutPath</key>
        <string>/dev/null</string>
        <key>StartCalendarInterval</key>
        <dict>
        <key>Hour</key>
        <integer>17</integer>
        <key>Minute</key>
        <integer>5</integer>
        <key>Weekday</key>
        <integer>1</integer>
        </dict>
        </dict>
        ...and 1 more line(s)
    Contents of /Library/LaunchAgents/com.symantec.uiagent.application.plist
        - mod date: Sep 13 11:59:24 2014
        - size (B): 476
        - checksum: 2715641560
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
        <key>KeepAlive</key>
        <true/>
        <key>Label</key>
        <string>com.symantec.uiagent.application</string>
        <key>ProgramArguments</key>
        <array>
        <string>/Library/Application Support/Symantec/SymUIAgent/SymUIAgent.app/Contents/MacOS/SymUIAgent</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        </dict>
        </plist>
    Contents of /Library/LaunchAgents/com.teamviewer.teamviewer.plist
        - mod date: Aug  8 14:34:37 2014
        - size (B): 668
        - checksum: 1602219417
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
        <key>Label</key>
        <string>com.teamviewer.teamviewer</string>
        <key>LimitLoadToSessionType</key>
        <string>Aqua</string>
        <key>ProgramArguments</key>
        <array>
        <string>/Applications/TeamViewer.app/Contents/MacOS/TeamViewer</string>
        <string>-RunAsAgent</string>
        <string>YES</string>
        </array>
        <key>WorkingDirectory</key>
        <string>/Applications/TeamViewer.app/Contents/MacOS/</string>
        <key>RunAtLoad</key>
        <true/>
        <key>KeepAlive</key>
        <true/>
        <key>Disabled</key>
        <true/>
        </dict>
        </plist>
    Contents of /Library/LaunchAgents/com.teamviewer.teamviewer_desktop.plist
        - mod date: Aug 22 22:48:52 2014
        - size (B): 779
        - checksum: 2466887275
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
        <key>Label</key>
        <string>com.teamviewer.desktop</string>
        <key>LimitLoadToSessionType</key>
        <array>
        <string>LoginWindow</string>
        <string>Aqua</string>
        </array>
        <key>ProgramArguments</key>
        <array>
        <string>/Applications/TeamViewer.app/Contents/Helpers/TeamViewer_Desktop</strin g>
        <string>-RunAsAgent</string>
        <string>YES</string>
        <string>-Module</string>
        <string>Full</string>
        </array>
        <key>WorkingDirectory</key>
        <string>/Applications/TeamViewer.app/Contents/Helpers/</string>
        <key>RunAtLoad</key>
        <true/>
        <key>KeepAlive</key>
        <true/>
        ...and 4 more line(s)
    Contents of /Library/LaunchDaemons/at.obdev.littlesnitchd.plist
        - mod date: Jan  9 15:56:02 2015
        - size (B): 631
        - checksum: 4174275850
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
        <key>KeepAlive</key>
        <true/>
        <key>Label</key>
        <string>at.obdev.littlesnitchd</string>
        <key>ProgramArguments</key>
        <array>
        <string>/Library/Little Snitch/Little Snitch Daemon.bundle/Contents/MacOS/Little Snitch Daemon</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>StandardErrorPath</key>
        <string>/Library/Logs/LittleSnitchDaemon.log</string>
        <key>StandardOutPath</key>
        <string>/Library/Logs/LittleSnitchDaemon.log</string>
        </dict>
        </plist>
    Contents of /Library/LaunchDaemons/com.DuetUSBDaemon.plist
        - mod date: Mar 10 09:46:31 2015
        - size (B): 697
        - checksum: 1799602859
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
        <key>WorkingDirectory</key>
        <string>/Library/Audio/Plug-Ins/HAL/Apogee/DuetUSB/DuetUSBPlugIn.bundle/Content s/MacOS</string>
        <key>Label</key>
        <string>com.DuetUSBDaemon.plist</string>
        <key>KeepAlive</key>
        <dict>
        <key>PathState</key>
        <dict>
        <key>/unloadDuetUSBDaemonTemp</key>
        <false/>
        </dict>
        </dict>
        <key>ProgramArguments</key>
        <array>
        <string>/Library/Audio/Plug-Ins/HAL/Apogee/DuetUSB/DuetUSBPlugIn.bundle/Content s/MacOS/duetUSBDaemon</string>
        </array>

  • Doubts about HTTPS requests and Java proxy

    Hello,
    I need help about SSL connections and Java.
    I'm developing a HTTP/S proxy with Java. To test my proxy, I use Firefox. I configure the proxy option in the browser. The proxy works good with HTTP requests, but with HTTPS requests doesn't work and I don't know why.
    I explain the steps that I do for a HTTPS request:
    * The browser sends a CONNECT message to the proxy.
    I check that the proxy receives the CONNECT request correctly.
    * The proxy establish a secure connection with the content server.
    I use an SSLSocket to connect with my content server, and the SSL handshake is succesful.
    * The proxy sends a 200 HTTP response to the client:
    I send
    HTTP/1.0 200 Connection established[CRLF]
    [CRLF]
    to the application client (Firefox)
    * The proxy sends/receive data to/from Firefox/content server
    I have a Socket between Firefox and my proxy, and a SSLSocket between my proxy and my content server. I use two threads to communicate the client and the server.
    Java code:
    //Thead server-->proxy-->application(Firefox)
    ThreadComm tpa = new ThreadComm(bis_serverSSL, bos_app);
    //Thread application(Firefox)-->proxy-->server
    ThreadComm tap = new ThreadComm(bis_app, bos_serverSSL);
    The "tpa" thread reads from the SSLSocket between the proxy and the server and sends data to the Socket between the proxy and Firefox.
    The "tap" thread reads from the Socket between the proxy and Firefox and sends data to the SSLSocket between the proxy and the server.
    This is the class ThreadComm:
    public class ThreadComm extends Thread{
        private BufferedInputStream bis = null;
        private BufferedOutputStream bos = null;
        public ThreadComm(BufferedInputStream bis, BufferedOutputStream bos) {
            this.bis = bis;
            this.bos = bos;
        @Override
        public void run() {
            int b = -1;
            FileOutputStream fos = null;
              do {
                   try {
                        b = bis.read();
                        System.out.print((char) b);
                        fos.write(b);
                        bos.write(b);
                        bos.flush();
                   } catch (Exception ex) {
                        Logger.getLogger(ThreadAplicacionProxy.class.getName()).log(Level.SEVERE, null, ex);
                        //b=-1;
              } while (b != -1);
        }But this doesn't work and I don't know why.      
    I have an Apache server with the mod_ssl enabled as content server, I can send requests (with Firefox) to the port 80(HTTP request) and 443(HTTPS request) without use my proxy and it works. If I use my proxy, HTTP request works but with HTTPS request doesn't work, I look the log of Apache and I see:
    [Tue Apr 27 17:32:03 2010] [info] Initial (No.1) HTTPS request received for child 62 (server localhost:443)
    [Tue Apr 27 17:32:03 2010] [error] [client 127.0.0.1] Invalid method in request \x80\x7f\x01\x03\x01
    [Tue Apr 27 17:32:03 2010] [debug] ssl_engine_kernel.c(1770): OpenSSL: Write: SSL negotiation finished successfully
    [Tue Apr 27 17:32:03 2010] [info] [client 127.0.0.1] Connection closed to child 62 with standard shutdown (server localhost:443)
    Why it say? Invalid method in request \x80\x7f\x01\x03\x01 , my proxy sends the data that the Firefox sends.
    I think than I have follow the explanations of [1] but doesn't work, I have problems in implementation in Java but I don't know where.
    I appreciate any suggestions.
    Thanks for your time.
    [1] http://www.web-cache.com/Writings/Internet-Drafts/draft-luotonen-web-proxy-tunneling-01.txt

    ejp, I have checked the socket between the proxy and server and ... You are right! , I was using the port 80 instead of the 443 (incredible mistake!, I'm sorry). I was convinced that I was using the port 443... Well, is a little step, but I still have not won the war :)
    If I see the log files of Apache, We can see that something goes wrong.
    localhost-access.log
    >
    127.0.0.1 - - [04/May/2010:17:44:48 +0200] "\x 80\x 7f\x01\x03\x01" 501 219
    >
    localhost-error.log
    >
    [Tue May 04 17:44:48 2010] [info] Initial (No.1) HTTPS request received for child 63 (server localhost:443)
    [Tue May 04 17:44:48 2010] [error] [client 127.0.0.1] Invalid method in request \x80\x7f\x01\x03\x01
    [Tue May 04 17:44:48 2010] [debug] ssl_engine_kernel.c(1770): OpenSSL: Write: SSL negotiation finished successfully
    [Tue May 04 17:44:48 2010] [info] [client 127.0.0.1] Connection closed to child 63 with standard shutdown (server localhost:443)
    >
    I think that this happens because Apache receives the data without decrypt, this is the reason because in the log we can see the "Invalid method in request \x80\x7f\x01\x03\x01". This supposition is true?
    ejp, you say that the "Termination is quite tricky." I have changed my code following yours suggestions (using the join and the shutdownOutput) but the threads don't die.
    I explain you what I do:
    (in time 1)
    I launch the thread (threadFirefoxToApache) that reads data from Firefox and sends to Apache.
    I launch the thread (threadApacheToFirefox) that reads data from Apache and sends to Firefox.
    (in time 2)
    threadFirefoxToApache sends the firts data to the server.
    threadApacheToFirefox is waiting that the server says something.
    (in time 3)
    threadFirefoxToApache is waiting that Firefox says something.
    threadApacheToFirefox sends data to Firefox.
    (in time 4)
    threadFirefoxToApache is waiting that Firefox says something.
    threadApacheToFirefox is waiting that Firefox says something.
    and they are waiting... and never finish.
    In time 2, these first data are encrypted. The server receives these data and It doesn't understand. In time 3, the server sends a HTTP response "501 Method Not Implemented", here there is a problem because this data must be encrypt. According to the documentation that I read, the proxy cannot "understand" this data but I can "understand" this data. What's happen?
    Firefox encrypt the data and send to the proxy. This It's correct.
    The proxy encrypt the data another time, because I use the SSLSocket to send the data to the server. Then the server receives the data encrypted two times, when decrypt the data gets the data encrypted one time. And this is the reason why the server doesn't understand the data that sends Firefox. It's correct? May be.
    Then If I want that the server receives the data encrypted one time I need to use the socketToServer, It's correct?
    I will supposed that yes. If I use the socketToServer, the proxy doesn't understand nothing, because the data received from the socketToServer are encrypted (I only see simbols), but the Apache log says that there is a problem with the version? (If I use the socketToServer the threads die)
    >
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1760): OpenSSL: Loop: SSLv3 read finished A
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1760): OpenSSL: Loop: SSLv3 write change cipher spec A
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1760): OpenSSL: Loop: SSLv3 write finished A
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1760): OpenSSL: Loop: SSLv3 flush data
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1756): OpenSSL: Handshake: done
    [Tue May 04 19:55:42 2010] [info] Connection: Client IP: 127.0.0.1, Protocol: TLSv1, Cipher: RC4-MD5 (128/128 bits)
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1817): OpenSSL: read 5/5 bytes from BIO#29bd910 [mem: 29ea0a8] (BIO dump follows)
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1750): -------------------------------------------------------------------------
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1789): | 0000: 80 7f 01 03 .... |
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1793): | 0005 - <SPACES/NULS>
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1795): ------------------------------------------------------------------------
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1770): OpenSSL: Write: SSL negotiation finished successfully
    [Tue May 04 19:55:42 2010] [info] [client 127.0.0.1] SSL library error 1 reading data
    [Tue May 04 19:55:42 2010] [info] SSL Library Error: 336130315 error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1770): OpenSSL: Write: SSL negotiation finished successfully
    [Tue May 04 19:55:42 2010] [info] [client 127.0.0.1] Connection closed to child 63 with standard shutdown (server localhost:443)
    >
    What option is the correct? I need use the SSLSocketToServer or socketToServer to send/read the data to/from the server?. Use the SSLSocket has sense because the data travel in a secure socket, but use the Socket also has sense because the data are encrypted and they are protected by this encription. It's complicated...

Maybe you are looking for