Verify impdp completed successfully then send email

Hi,
I am creating a daily job refresh a test database.
Basic steps
1. kill all sessions/connections to database.
2. drop schema 1 and schema 2
3. impdp schema 1 and schema 2
4. verify that impdb completed successfully. If job did not complete successfull send an email to DBA. If job did completed successfully sent email to developers stating that database has been refreshed.
I am in a windows enviorment so I do not have GREP to read my log file. With a script, how to I determine if the refresh/impdp completed successfully?
Edited by: user9934078 on Jan 14, 2010 1:58 PM

I wanted to share this code that I created. It checks that your expdp log file, then sends an html email based on the completion status.
Hope this helps someone
--THIS CODE READS THE DATA PUMP EXPORT LOG AND CHECKS FOR ERRROS. THEN SENDS EMAIL.
DECLARE
vinhandle utl_file.file_type;
vnewline VARCHAR2(32767);
statusMessage VARCHAR2(32767);
jobName     VARCHAR2(32767) := 'ORACLE Scheduled Task: MWFPROD backup completed on \\MWFDBPRODSVR ';
styleCSS VARCHAR2(32767) := '<style>BODY {font-family: Arial, Verdana; margin-top: -9px; background-color:#FFFFFF; font-size:12px;} A {font-family: Arial, Verdana;} A:link {text-decoration: underline; color:#003399;} A:visited {text-decoration: underline; color:#003399;} A:hover {text-decoration: underline; color:#003399;} A:active {text-decoration: underline; color:#003399;} B {font-size:12px;} TABLE {border-width: 0px; border-spacing: 0;border-style: solid; border-color: #E7E7E7; border-collapse: collapse;}TH {border-width: 0px; padding: 2px 10px 2px 5px ; border-style: solid; border-color:#333399; font-size: 12px; color:#FFFFFF; background-color:#333399; text-align:left;} TD {border-width: 0px; padding: 2px 10px 2px 5px ; border-style: solid; border-color:#E7E7E7; font-size: 12px;} .redAlert{FONT-WEIGHT: bolder;FONT-SIZE: 12px; COLOR: #FF4976;}</style>';
jobCompleted BOOLEAN := FALSE;
startLine VARCHAR2(32767);
startTime VARCHAR2(32767);
endTime     VARCHAR2(32767);
totTime     VARCHAR2(32767);
BEGIN
vinhandle := utl_file.fopen('DATA_PUMP_DIR','MWFPRODexport.log','R');
LOOP
BEGIN
     utl_file.get_line(vinhandle, vnewline);
IF instr(vnewline,'successfully completed') > 0 THEN
jobCompleted := TRUE;
END IF;
IF instr(vnewline,'Export:') > 0 THEN
startLine := vnewline;
startTime := vnewline;
END IF;
     --GET LAST LINE OF LOG. THIS IS USED FOR END TIME AND MESSAGES
     statusMessage := vnewline;
EXCEPTION
WHEN others THEN
EXIT;
END;
END LOOP;
startTime := substr(startTime,instr(startTime,':',1,2)-2,length(startTime));
endTime := substr(statusMessage,instr(statusMessage,' at ') + 4,length(statusMessage));
--GET DURATION OF JOB
--totTime := ( to_char(trunc(sysdate) +(TO_DATE(endTime,'HH24:MI:SS') - TO_DATE(startTime,'HH24:MI:SS')) ,'HH24:MI:SS')); 
totTime := ( to_char(trunc(sysdate) +(TO_DATE(endTime,'HH24:MI:SS') - TO_DATE(startTime,'HH24:MI:SS')) ,'HH24')) || ' hours, ';
totTime := totTime || ( to_char(trunc(sysdate) +(TO_DATE(endTime,'HH24:MI:SS') - TO_DATE(startTime,'HH24:MI:SS')) ,'MI')) || ' minutes, ';
totTime := totTime || ( to_char(trunc(sysdate) +(TO_DATE(endTime,'HH24:MI:SS') - TO_DATE(startTime,'HH24:MI:SS')) ,'SS')) || ' seconds';
if jobCompleted then
UTL_MAIL.send(sender => '[email protected]',
recipients => '[email protected]',
subject => jobName,
message => styleCSS ||'<br><table><tr><td><b>DURATION:</b></td><td>' || totTime || '</td></tr><tr><td><b>STATUS:</b></td><td> Succeeded </td></tr>' || '<tr><td><b>JOB RUN:</b></td><td>' || startLine || '</td></tr>' || '<tr><td><b>MESSAGES:</b></td><td>' || statusMessage || '</td></tr></table>',
mime_type => 'text/html; charset=windows-1250');
else
UTL_MAIL.send(sender => '[email protected]',
recipients => '[email protected]',
subject => jobName,
message => styleCSS ||'<br><table><tr><td><b>DURATION:</b></td><td>' || totTime || '</td></tr><tr><td><b>STATUS:</b></td><td class=redAlert> Failed </td></tr>' || '<tr><td><b>JOB RUN:</b></td><td>' || startLine || '</td></tr>' || '<tr><td><b>MESSAGES:</b></td><td>' || statusMessage || '</td></tr></table>',
mime_type => 'text/html; charset=windows-1250');
end if;
utl_file.fclose(vinhandle);
END fopen;
exit;

Similar Messages

  • DUPLICATE PLEASE IGNORE verify impdp completed successfully then send email

    Hi,
    I am creating a daily job refresh a test database.
    Basic steps
    1. kill all sessions/connections to database.
    2. drop schema 1 and schema 2
    3. impdp schema 1 and schema 2
    4. verify that impdb completed successfully. If job did not complete successfull send an email to DBA. If job did completed successfully sent email to developers stating that database has been refreshed.
    I am in a windows enviorment so I do not have GREP to read my log file. With a script, how to I determine if the refresh/impdp completed successfully?
    Edited by: user9934078 on Jan 14, 2010 1:59 PM

    Hi,
    I am creating a daily job refresh a test database.
    Basic steps
    1. kill all sessions/connections to database.
    2. drop schema 1 and schema 2
    3. impdp schema 1 and schema 2
    4. verify that impdb completed successfully. If job did not complete successfull send an email to DBA. If job did completed successfully sent email to developers stating that database has been refreshed.
    I am in a windows enviorment so I do not have GREP to read my log file. With a script, how to I determine if the refresh/impdp completed successfully?
    Edited by: user9934078 on Jan 14, 2010 1:59 PM

  • Will Apple lock my account then send email with link to register my account? Even ask for Social Security

    Will Apple lock my acct, send me email with link to register again requiring Social Security #? How do I verify request is from Apple?

    Forward Apple Phishing emails to: <[email protected]>

  • Creating first Alert - not sending email

    Hi guys, hoping someone can point me in the right direction for creating an Alert.
    I've followed :
    How Do You Set Up A Test Event Alert That Sends An Email. [ID 455688.1]
    However once I've got my alert created, when I carry out the step to update the table which should result in an email, I get nothing.
    Can anyone suggest what might be wrong ?
    Contents of the doc I followed :
    How do you set up a test event alert that sends an email?
    Solution
    1. Navigate to the Alert > Define window in Oracle Alert manager.
    2. Use the 'Alert' for the application.
    3. Check the enabled checkbox.
    4. Enter 'Test Event Alert Email' for the Name.
    5. Select Event tab.
    6. Enter 'Alert' for the application.
    7. Enter the 'ALR_DISTRIBUTION_LISTS' table.
    8. Check either the 'After Insert' or 'After Update' check box, or both.
    9. Enter the following select:
    SELECT 123245
    into &test_num
    FROM DUAL
    Click on the Verify button to ensure select works.
    10. Select 'Actions' button.
    11. Enter 'Test Email' for Action Name.
    12. Set Action Level to Detail.
    13. Drill down on 'Actions Details' button.
    14. Set 'Action Type' to Message.
    15. In the 'To' field, enter your valid email address.
    16. In Subject field enter 'Test Periodic Alert Email'
    17. Select Text and enter 'Test &test_num'.
    18. Save and close out to Alert Define Window.
    19. Select Action Sets button.
    20. Enter 1 for Seq number.
    21. Enter 'Test Email Number'
    22. Check the Enabled box.
    23. Drill down on 'Action Set Details' button.
    24. Select 'Outputs' tab.
    25. Check the 'Check for Duplicates' box.
    26. Select 'Members' tab.
    27. Check the enabled box for the Action.
    28. Save and exit out to the Alert Define Window.
    29. Drill down on 'Alert Details' button.
    30. Select 'Outputs' tab.
    31. Enter 'test_num' for description.
    32. Enter 10 for Detail and Summary
    33. Enter 999,999 for Number Form.
    34. Check the 'Check For Duplicates' box.
    35. Select the 'Installation' tab.
    36. Enter 'APPS' for the Oracle ID.
    37. Enter the current Operating Unit being used.
    38. Check the Enabled check box.
    39. Save and exit form.
    40. Navigate to Alert > Distribution Lists.
    41. Enter 'Application Object Library' for the application.
    42. Enter 'Test Email Group' for Name.
    43. Enter your email address for the 'To' Mail Recipients.
    44. Save.
    45. Check for alert to run under the Request > View Window.
    46. If it completes successfully, check for email.

    I've found the workflow administration screen and theres a section which says :
    Business Event Local System
    Enter the Workflow Business Event System Name and System Processing Status.
    System Name          DEV.xxxxxx.COM
         This is the system name of the database where this instance of Oracle Workflow is installed.
    Status          Enabled
    is that it ?

  • Reminder Workflow does not recalculate new date to send email, if due date is changed

    I created a basic reminder workflow using due date, and status column. it works well.
    Let's say, I want to send a reminder email 2 days prior to the due date.
    I used Add -2 to due date and set a variable
    then used Pause variable
    if status is not equal to completed
    then send email
    And I have this set to initiate when a new item is created, and modified.
    However, if the due date is changed, it does not recalculate the new date to send the reminder email.  Help!

    Hi MonalisaM,
    The in-progress workflow instance will be unable to re-start itself when list item is modified, but I think you can design workflow with using the second workflow to update the list item one filed, then this update triggers
    the first workflow again.
    Stop this reminder workflow (first workflow) when due date is changed, then this will trigger the second workflow to change another custom column(e.g. Flag), then the first workflow will be triggered due to this custom column
    Flag value changed by second workflow, I mean the second workflow is used to upadate this custom list item one filed(e.g. Flag) in order to trigger the reminder workflow(first workflow).
    You can read the following article for more information to understand how to make the first workflow re-start by using second workflow.
    http://sharepoint713.blogspot.com/2011/09/sharepoint-designer-workflow-to-send.html
    Thanks
    Daniel Yang
    TechNet Community Support

  • Workflow not sending email

    We are in the process of upgrading to ECC 5.0.  I have read that many of the SAP email functions require a new COMMIT_WORK parameter to send email, or a COMMIT WORK in the main program.
    We have some functions in table T779X triggered when various infotypes are created or changed.  A few of these functions do a CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'.  The workflow is triggered, and the email shows up in my Outbox, but it never gets sent even though I have the COMMIT_WORK parameter set to 'X' in the calling function.
    We have other workflows not triggered directly from table T779X and other programs that call this function successfully to send email.  Has anyone encountered this problem?
    Janice Ishee

    Suresh/Karun
    Thank you for your suggestions.  I was aware of SCOT.  I am not sure what values I should be checking for, but our Basis team has used SCOT to set values, and I am receiving emails from other workflows, just not ones triggered directly from table T779X.
    I did not know about SOST.  That is very intersting.  Although I can see my emails in my Outbox, I do not see them in SOST.  I am not sure what that means.
    Other developers have said that I should not be sending email from a workflow triggered directly from T779X, but to use that workflow to raise an event.  Then have a second function waiting for the event, and to send my email from that second function.  I don't like that solution as I don't have the before image and after image like I do in the function triggered directly from T779X.  I'm going to post a message with OSS just to confirm that.
    Thanks
    Janice

  • Send Email Notification when comment blog in Sharepoint 2010

    Hi,
    Anyone can help me, when i comment on the blog, then send email directly ?. According to this link http://www.sitefinity.com/devnet/forums/sitefinity-3-x/general-discussions/blog-comment-notification.aspx 
    Its make some development or modifications, beside that is there any other way to do that without making modifications? probably just setting up in sharepoint admin?
    Please advice,
    Regards

    Hi
    I just found out that the the blog comments are stored in a list
    htp://yoursite/Blog/Lists/Comments/AllComments.aspx
    So you can write a workflow to send an email when a new item is created in this list.

  • My new Mac Mail is losing the ability to send emails periodically. It's running on 10.6.7 /new iMac. What's happening?

    My new Mac Mail is losing the ability to send emails periodically. It's running on 10.6.7 /new iMac. I can reset the account by going into Prefs, then first deleting the account and then adding a new SMTP account back. Then sending emails works for a while, until the next time. What's happening?

    Ah! Unfortunately, I'm on a company computer and can't just try these things myself. If that's the issue, I can ask our admins and they'll do it, but I want to make sure I've exhausted anything that could be a small fix.
    Is that a shot in the dark, or are you thinking there's a reason a clean install is the solution? Thanks for the help.

  • Can't send email on ipad

    Suddenly I can't send email from AOL account on my ipad.  When I send an email I get the error message Cannot send mail - rejected by the server because it does not allow relaying.

    Read this discussion. You may need to enter a a username and password in the outgoing mail server setting - even if it says that it is optional.
    https://discussions.apple.com/message/11770966#11770966
    This one as well.
    https://discussions.apple.com/thread/2582847?start=0&tstart=0
    And the explanation from yet another discussion ....
    Try going into Settings > Mail, Contacts, Calendars > select the account > account name , tap on SMTP (under the 'Outgoing Mail Server' heading) and then tap on your Primary Server and try entering your email account and password and see if you can then send emails.

  • TS3899 iPhone 5s Mail app shut down automatically when try to send email

    I just set up new iPhone 5s two days ago from iPhone 5.
    Everything works fine except Mail app.
    Due to Mail app, I had to set up new configuation instead of back up from old iPhone 5.
    Mail app works fine 1 day, but after the day after, the mail app shut down automatically when try to send email.
    Just one specific email account has problem. It worked fine on iPhone 5. Same setting on Pop and SMTP. Exactly same~~
    - I did try to reset iPhone 5s pressing home button and sleep button for 10 second. It did not work
    - I did try to reset all information and install iPhone 5s and the problem still exists.
    - I did try to delete specific email account and re-make it, but it did not work
    Funny thing is that if Lanuague is English, then sending email is working. Absolutely no problem.
    However, if Language setting is Korean, then Mail App shut down automatically.
    I'm heavy email maker and if it is very annoying.
    Does anyone have same issue like this?
    I believed it is iOS7 bug?
    Can anyone help me on this???

    Am having similar problems with a new iPad Air. It will recieve email in Mail as directd from my domain email account. It will not send, advising server does not recognise account. I have checked and re checked settings.
    My computer and old iPad work perfectly. Any ideas would be really appreciated.
    By the way sending email directly from the domain email account works perfectly but I prefer using Mail.
    James

  • TS3899 Problem with sending emails??

    When I send an email from my phone it then goes into the sent section of my emails, now all of a sudden within half an hour or so the email I sent is appearing in my inbox? Is the email being sent? And why is it coming back to me via my inbox??

    Actually have just read another thread about sending emails and the response below has actually solved this so thanks to the person who posted this
    Go to Settings >Mail, Contacts, Calendars>Your email account>account name , tap on SMTP (under the 'Outgoing Mail Server' heading) and then tap on your Primary Server and try entering your username and password and see if you can then send emails.
    Even if it says that the information is optional - enter it anyway.

  • Send Email on Content Checkin

    Hi ,
    I am creating a custom component which is supposed to send the email on new content checkin if checked in content meets the queryText specified.
    I have a table maintained -
    QueryText                                                UserName
    dDocTitle <substring> `Rajdeep`                 Anuj
    I have written the code to get the queryText and user subscribed to that queryText. Now I need to validate that new content checked in meets queryText1 then send email to corresponding user .
    I don't know where should I hook up code to validate newContent against queryText1 , queryText2 .. . This new content is not available in GET_SEARCH_RESULT till i am on confirmation page..
    Thanks,
    Rajdeep

    Is there a reason why the out-of-box subscription function won't work?  You can create criteria-based subscriptions that do this function already.

  • Send email to a non-sap email address

    Hi,
    I have to send a notification when one of the condition occurs. I have to send email based on the role of the users, i.e first find the email addresses of the users based on the role and then send email to their non-sap email addresses(like the company outlook email). Can someone tell me the detailed steps need to be followed here..
    Thanks in advance,
    Henry.

    hi David,
        WELCOME TO SDN
           Use FM <b>SO_NEW_DOCUMENT_SEND_API1.</b>
    SAP Send mail via ABAP functions SO_NEW_DOCUMENT_SEND_API1
    This abap mail sending program demonstrate how you can send a mail to the user SAP Office mailbox.
    REPORT ZSEND .
    TABLES: KNA1.
    data for send function
    DATA DOC_DATA  LIKE SODOCCHGI1.
    DATA OBJECT_ID LIKE SOODK.
    DATA OBJCONT   LIKE SOLI OCCURS 10 WITH HEADER LINE.
    DATA RECEIVER  LIKE SOMLRECI1 OCCURS 1 WITH HEADER LINE.
    SELECT * FROM KNA1 WHERE ANRED LIKE 'C%'.
      WRITE:/ KNA1-KUNNR, KNA1-ANRED.
    send data internal table
      CONCATENATE KNA1-KUNNR KNA1-ANRED
                             INTO OBJCONT-LINE SEPARATED BY SPACE.
      APPEND OBJCONT.
    ENDSELECT.
    insert receiver (sap name)
      REFRESH RECEIVER.
      CLEAR RECEIVER.
      MOVE: SY-UNAME TO RECEIVER-RECEIVER,
            'X'      TO RECEIVER-EXPRESS,
            'B'      TO RECEIVER-REC_TYPE.
      APPEND RECEIVER.
    insert mail description
      WRITE 'Sending a mail through abap'
                     TO DOC_DATA-OBJ_DESCR.
    CALL FUNCTION <b>'SO_NEW_DOCUMENT_SEND_API1'</b>
         EXPORTING
              DOCUMENT_DATA              = DOC_DATA
         IMPORTING
              NEW_OBJECT_ID              = OBJECT_ID
         TABLES
              OBJECT_CONTENT             = OBJCONT
              RECEIVERS                  = RECEIVER
         EXCEPTIONS
              TOO_MANY_RECEIVERS         = 1
              DOCUMENT_NOT_SENT          = 2
              DOCUMENT_TYPE_NOT_EXIST    = 3
              OPERATION_NO_AUTHORIZATION = 4
              PARAMETER_ERROR            = 5
              X_ERROR                    = 6
              ENQUEUE_ERROR              = 7
              OTHERS                     = 8.
    http://sapr3.tripod.com/abap011.htm
    Regards,
    Santosh
    Note: Reward Points if helpful

  • Send email when first record updated problem

    Hi guys i have problem
    this code send email based on timer every 5 minutes
    it working ok but my problem i need to determine first rcord updated not inserted
    and send email this is starting work
    this is my code
    ---timer1_Tick---
    Sales.SalesClass SalesClass1 = new Sales.SalesClass();
    DataTable dt = SalesClass1.ShowSalesData("Data Source=192.168.1.5;Initial Catalog=Altawi-last06-01-2015;User ID=admin;Password=123");
    dataGridView1.DataSource = dt;
    dataGridView1.Refresh();
    namespace Sales
    class SalesClass
    public DataTable ShowSalesData(string ConnectionString)
    SqlConnection con = new SqlConnection(ConnectionString);
    SqlCommand cmd = new SqlCommand();
    cmd.Connection = con;
    cmd.CommandType = CommandType.Text;
    cmd.CommandText = "showsales1";
    SqlDataAdapter da = new SqlDataAdapter();
    da.SelectCommand = cmd;
    DataSet ds = new DataSet();
    da.Fill(ds);
    DataTable dt = ds.Tables[0];
    return dt;
    SELECT     ROW_NUMBER() OVER (ORDER BY dbo.[Jeddah-Live$Sales Header].No_) AS [م], dbo.[Jeddah-Live$Sales Line].[Document No_] AS 'رقم الطلب',
    dbo.[Jeddah-Live$Sales Header].[Bill-to Name] AS 'العميل', dbo.[Jeddah-Live$Sales Line].Area AS 'نوع الصبه', dbo.[Jeddah-Live$Sales Line].Description AS 'البيان',
    dbo.[Jeddah-Live$Sales Header].[Pump No_] AS 'المضخه', CAST(ROUND(dbo.[Jeddah-Live$Sales Line].Quantity, 0, 1) AS int) AS 'المطلوب',
    CAST(ROUND(dbo.[Jeddah-Live$Sales Line].[Quantity Shipped], 0, 1) AS int) AS 'المصبوب', CAST(ROUND(dbo.[Jeddah-Live$Sales Line].[Outstanding Quantity], 0,
    1) AS int) AS 'المتبقى '
    FROM         dbo.[Jeddah-Live$Sales Header] INNER JOIN
                          dbo.[Jeddah-Live$Sales Line] ON dbo.[Jeddah-Live$Sales Header].No_ = dbo.[Jeddah-Live$Sales Line].[Document No_] AND
                          dbo.[Jeddah-Live$Sales Header].[Sell-to Customer No_] = dbo.[Jeddah-Live$Sales Line].[Sell-to Customer No_]
    The code above not have any problem and working
    When first record updated send email
    Example to show
    orderno   quantity  shipped quantity
    12            20               0
    13            30               0
    14            25               0
    15           22                0
    suppose order no 14 shipped quantity updated be 10 (meaning 0 be 10
    then send email with starting work
    after this any updated to any record not send
    no problem i dont need any send email code but how to get record updated first

    Hi guys i have problem
    this code send email based on timer every 5 minutes
    it working ok but my problem i need to determine first rcord updated not inserted
    and send email this is starting work
    this is my code
    ---timer1_Tick---
    Sales.SalesClass SalesClass1 = new Sales.SalesClass();
    DataTable dt = SalesClass1.ShowSalesData("Data Source=192.168.1.5;Initial Catalog=Altawi-last06-01-2015;User ID=admin;Password=123");
    dataGridView1.DataSource = dt;
    dataGridView1.Refresh();
    namespace Sales
    class SalesClass
    public DataTable ShowSalesData(string ConnectionString)
    SqlConnection con = new SqlConnection(ConnectionString);
    SqlCommand cmd = new SqlCommand();
    cmd.Connection = con;
    cmd.CommandType = CommandType.Text;
    cmd.CommandText = "showsales1";
    SqlDataAdapter da = new SqlDataAdapter();
    da.SelectCommand = cmd;
    DataSet ds = new DataSet();
    da.Fill(ds);
    DataTable dt = ds.Tables[0];
    return dt;
    SELECT     ROW_NUMBER() OVER (ORDER BY dbo.[Jeddah-Live$Sales Header].No_) AS [?], dbo.[Jeddah-Live$Sales Line].[Document No_] AS '??? ?????',
    dbo.[Jeddah-Live$Sales Header].[Bill-to Name] AS '??????', dbo.[Jeddah-Live$Sales Line].Area AS '??? ?????', dbo.[Jeddah-Live$Sales Line].Description AS '??????',
    dbo.[Jeddah-Live$Sales Header].[Pump No_] AS '??????', CAST(ROUND(dbo.[Jeddah-Live$Sales Line].Quantity, 0, 1) AS int) AS '???????',
    CAST(ROUND(dbo.[Jeddah-Live$Sales Line].[Quantity Shipped], 0, 1) AS int) AS '???????', CAST(ROUND(dbo.[Jeddah-Live$Sales Line].[Outstanding Quantity], 0,
    1) AS int) AS '??????? '
    FROM         dbo.[Jeddah-Live$Sales Header] INNER JOIN
                          dbo.[Jeddah-Live$Sales Line] ON dbo.[Jeddah-Live$Sales Header].No_ = dbo.[Jeddah-Live$Sales Line].[Document No_] AND
                          dbo.[Jeddah-Live$Sales Header].[Sell-to Customer No_] = dbo.[Jeddah-Live$Sales Line].[Sell-to Customer No_]
    The code above not have any problem and working
    When first record updated send email
    Example to show
    orderno   quantity  shipped quantity
    12            20               0
    13            30               0
    14            25               0
    15           22                0
    suppose order no 14 shipped quantity updated be 10 (meaning 0 be 10
    then send email with starting work
    after this any updated to any record not send
    no problem i dont need any send email code but how to get record updated first

  • Send email through wifi connection

    Hi
    Sometimes connected wifi, I dont success to send emails through smtp.free.fr
    So, I switch to 3G connection and that works!
    Anyone for genius idea? Pleaaaase :-)

    this
    while ((c=dis.read())!=-1)
    is going to be horribly inefficient
    It would seem that the server would send http response headers. I don't see where you are skipping this bit of info. But perhaps the server isn't doing this.
    Are you flushing the stream on the server side?

Maybe you are looking for