HttpURLConnection , Response Code : 404 for HTTP method HEAD  302 for GET

After establishing the connection For the URL : http://calendar.google.com/ the response code is different for different HTTP METHODS.
For the method HEAD the response code is 404
For the method GET the response code is 302
Ideally according to W3 standards the header part for both methods should be same.
www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
Unfortunately all the websites are not following the same standards.
The above brings up an important issue.
(i.e) soley depending on the HEAD method for checking the validity of the link may fail sometimes even if the link is
valid.
Please put up your comments and observations on this.
Sample Code
public static void main(String[] args) {
try{
URL myurl = new URL("http://calendar.google.com");
URLConnection connection = myurl.openConnection();
if(connection instanceof HttpURLConnection) {
HttpURLConnection httpConnection = (HttpURLConnection) connection;
HttpURLConnection.setFollowRedirects(true);
httpConnection.setRequestMethod("HEAD");
httpConnection.connect();
System.out.println("Response = "+httpConnection.getResponseCode());
catch(Exception e) {
System.out.println(e);
Edited by: rama.krishna on Dec 3, 2007 3:47 AM

Iam not encountering any problem.It's just a discussion.

Similar Messages

  • Error: CIM_ERR_FAILED: HTTP response code: 404 Not found

    Hi, we had finished to install Sap Netweaver Usage type PI (Abap +Java), now we are running Post Installation task, but we are getting an error when we ran "Configuration Wizard"
    In the step: Configure the integration server for sld
    Error: CIM_ERR_FAILED: HTTP response code: 404 Not found
    Any Idea?
    Thanks
    Elias Mendoza
    The following lines are part of the error log:
    Debug Events
    InvokeService:Configure the integration server for sld
    Library: sap.com/tclmctctemplateslevel1_4_tcc
    SourcePath ./PIPostInstallProcess/configureIntegrationServer8
    Time 2008/07/07 at 20:47:33
    WSDL /content/NetWeaver/PI/service/SLDConfig_configureIntegrationServer_configureIntegrationServer.wsdl
    Execute Java Service
    Library:sap.com/tclmctcutilbasic_ear
    Class:com.sap.ctc.util.SLDConfig
    Method:void com.sap.ctc.util.SLDConfig.configureIntegrationServer(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
    InvokeService- Result: Failed
    Exception Message:CIM_ERR_FAILED: HTTP response code: 404 Not found
    Exception Class:com.sap.sld.api.wbem.exception.CIMCommunicationException

    Dear
    Possibly CIM content is not uploaded to your SLD.
    Is your SLD running properly ?
    Did you install this SLD as a local SLD at the installation of your SAP system (along with other stuff using sapinst) ?
    <removed_by_moderator>
    Kind regards
    Tom
    Edited by: Julius Bussche on Jul 8, 2008 1:55 PM

  • CIM_ERR_FAILED: HTTP response code: 404 Not found

    Hello!
    We are installing NW7.0 PI with local SLD as HA system with virtual name and after patching it up to SPS17 we started Configuration wizard
    PI_00_This wizard will execute Postinstall steps of technical configuration for the PI Usage
    and on step 33/142 Configure the Integration server for sld  we got an error:
    CIM_ERR_FAILED: HTTP response code: 404 Not found
    and from log:
    InvokeService:Configure the integration server for sld
    Library: sap.com/tclmctctemplateslevel1_4_tcc
    SourcePath ./PIPostInstallProcess/configureIntegrationServer8
    Time 2009/05/07 at 10:45:31
    WSDL /content/NetWeaver/PI/service/SLDConfig_configureIntegrationServer_configureIntegrationServer.wsdl
    Execute Java Service
    Library:sap.com/tclmctcutilbasic_ear
    Class:com.sap.ctc.util.SLDConfig
    Method:void com.sap.ctc.util.SLDConfig.configureIntegrationServer(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
    Arguments
    SID : XRQ 
    CLIENT : 001 
    HOST : capitate 
    PORT : 8032 
    SLDUSER : PISUPER 
    SLDPASSWORD : % secure content % 
    InvokeService- Result: Failed
    Exception Message:CIM_ERR_FAILED: HTTP response code: 404 Not found
    Exception Class:com.sap.sld.api.wbem.exception.CIMCommunicationException
    Stacktrace
    com.sap.sld.api.wbem.client.WBEMHttpRequestSender.newCommunicationException(WBEMHttpRequestSender.java:414)
    com.sap.sld.api.wbem.client.WBEMHttpRequestSender.processResponse(WBEMHttpRequestSender.java:323)
    com.sap.sld.api.wbem.client.WBEMHttpRequestSender.send(WBEMHttpRequestSender.java:142)
    This error would be normal with Central SLD but we have local SLD. Is there any parameters for systems with virtual name which is not configured?
    Regards,
    Mart

    Thanks for answering.
    Configuration is done by the Post-Installation Guide - SLD of SAP NetWeaver 7.0   , but there is still same error.
    It seems, that point is in CPA Cache full refresh, because in SLD Java system on app.server still shows his patchlevel 9 not 17 .
    CPA Cache refresh gives an error:
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'http://capitate:53200/CPACache/refresh?mode=full'. Li...
    CPA cache refresh (mode=full) successfully executed in 703 milliseconds.
    ^
    Regards,
    Mart

  • Received HTTP response code 404 : Not Found

    I am attempting to pass a file through XI into an IDoc to ECC.  I have tested the mapping, and that works fine.  I have also tested the configuration in the integration builder and it seems to be fine.  However, when the file is picked up by XI from the directory, processed by XI, and then sent to ECC, an error occurs in the runtime workbench:
    Transmitting the message to endpoint http://server:port/sap/xi/engine?type=entry using connection AFW failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Received HTTP response code 404 : Not Found.
    The error leads me to believe that the system cannot be found, or there is a privelage issue with the service user attempting to log onto ECC.  However I believe I have set up the RFC connection correctly, and the service user should be fine.
    Does anyone know what may be causing this?  I am using the IDoc adapter for the reciever communication channel.  I have set the RFC destination (and tested it in SM59, works fine) and the port (I assume this is the port in WE21?).  Not sure where to look...

    Being that the error says:
    Transmitting the message to endpoint http://server:port/sap/xi/engine?type=entry using connection AFW failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Received HTTP response code 404 : Not Found.
    I am trying to understand what this means.  Can anyone explain to me why the message is getting sent to this address?  I assume that the AFW is coming into play because I am using the IDoc adapter, hence the adapter framework.  Is this true?  Should the AFW be showing up, or do you think there is another issue?
    Mainly I want to know if this is more of a basis issue, or a configuration problem with the interface in XI?

  • HTTP Response code 404 - RFC Adapter des not connect to Integration engine

    Hi,
    I seem to have problem with XI Integration engine. My integration process does not go beyond adapter engine and it fails with the following error,
    Begining of the erorr report -
    2006-01-23 13:35:53 Success RFC adapter received sRFC for ZSCEN2_XI from <sysno>/<client>. Attempting to send message synchronously
    2006-01-23 13:35:54 Success Application attempting to send an XI message synchronously using connection AFW.
    2006-01-23 13:35:55 Success Trying to put the message into the call queue.
    2006-01-23 13:35:55 Success Message successfully put into the queue.
    2006-01-23 13:35:55 Success The message was successfully retrieved from the call queue.
    2006-01-23 13:35:55 Success The message status set to DLNG.
    2006-01-23 13:35:55 Error Returning synchronous error notification to calling application: Received HTTP response code 404 : Not Found.
    2006-01-23 13:35:55 Error Transmitting the message using connection http://<host>:55300/sap/xi/engine?type=entry failed, due to: Received HTTP response code 404 : Not Found.
    2006-01-23 13:35:55 Error The message status set to FAIL.
    2006-01-23 13:35:55 Error Returning to application. Exception: Received HTTP response code 404 : Not Found
    end of error report -
    and the runtime workbench does not connect to Integration engine and fails with the following error,
    begin error report -
    javax.ejb.CreateException: Unable to log on to system XID in language en with user XIRWBUSER
         at com.sap.aii.mdt.server.integrationengine.IntegrationEngineMonitoringBean.ejbCreate(IntegrationEngineMonitoringBean.java:374)
         at com.sap.aii.mdt.server.IntegrationEngineHomeImpl10.create(IntegrationEngineHomeImpl10.java:185)
         at com.sap.aii.mdt.server.IntegrationEngineHome_Stub.create(IntegrationEngineHome_Stub.java:56)
    end of report -
    Have anyone experienced the same issue?. Are we missing some post installation configuration?.
    Thanks in advance
    Regards,
    Arul

    HI Anulraja,
    Your Adapter Engine searches the pipeline url of the integration engine from the SLD.
    Check the Bussiness System in Sld , which you'll have defined for XI Server.
    It should have ROLE : Integration Server And
    pipeline url: http://ux0800:55300/sap/xi/engine?type=entry
    should be this if your http port is 55300.
    Check if this url is right in SLD-Bussiness System.
    You can check the exact http port in transaction sxmb_adm.
    Go to Integration engine configuration and then click on check icon(F7).
    It should match with that provided in the BS in SLD.
    By default it should be 8000.
    Check all these things and then try.
    Regards,
    Yomesh

  • Getting HTTP response code: 404  Not Found  while playback

    Hi Folks,
    Am creating a loadtest script on Oracle Empirica application by using web protocol with only 6 steps. While play back am getting the following error
    Error Code:INVALID_HTTP_RESPONSE_CODE
    Error Detail:
    oracle.oats.scripting.modules.http.api.exceptions.ThinBrowserException: HTTP response code: 404 Not Found
         at oracle.oats.scripting.modules.http.api.exceptions.ThinBrowserException.createErrorInvalidHttpResponseCode(ThinBrowserException.java:66)
         at oracle.oats.scripting.modules.http.api.internal.ResponseCodeValidator.validate(ResponseCodeValidator.java:21)
         at oracle.oats.scripting.modules.http.api.internal.AbstractHTTPService.validate(AbstractHTTPService.java:993)
         at oracle.oats.scripting.modules.http.api.internal.AbstractHTTPService.navigate(AbstractHTTPService.java:595)
         at oracle.oats.scripting.modules.http.api.internal.AbstractHTTPService.doNavigate(AbstractHTTPService.java:504)
         at oracle.oats.scripting.modules.http.api.internal.AbstractHTTPService.doNavigate(AbstractHTTPService.java:494)
         at oracle.oats.scripting.modules.http.api.internal.InternalHTTPService.navigate(InternalHTTPService.java:1930)
         at oracle.oats.scripting.modules.http.api.internal.InternalHTTPService.navigate(InternalHTTPService.java:1867)
         at oracle.oats.scripting.modules.http.api.internal.InternalHTTPService.get(InternalHTTPService.java:1975)
         at oracle.oats.scripting.modules.http.api.internal.InternalHTTPService.get(InternalHTTPService.java:1966)
         at oracle.oats.scripting.modules.http.api.HTTPService.get(HTTPService.java:2426)
         at script.run(script.java:153)
         at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:320)
         at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:726)
         at java.lang.Thread.run(Thread.java:619)
    please help me to fix this issue.
    Thanks,
    Jay.

    I have checked this link: /people/krishna.moorthyp/blog/2006/07/23/http-errors-in-xi
    The SLD and the Integrationserver pipeline URL the Port was 50100 and the HTTP port in the RFC Dest. is 8001.
    Witch port must entered in the URL, 50100 or 8001?
    If the port must be 8001, how could i change the URL in the SLD? Must the business System Integrationserver be deleted and new entered witch the right URL?
    Thank you for all answers.
    regards
    Jochen Schütze

  • HTTP response Code 404: Not Found

    Hallo,
    I want to get a Email from the account to my SAP-System.
    The Email is downloaded in the XI-System and then directly the following error is shown.
    "Fehler beim Übertragen zum Endpunkt /sap/xi/engine?type=entry über die Verbindung AFW. Grund: com.sap.aii.af.ra.ms.api.RecoverableException: Received HTTP response code 404 : Not Found".
    What could i do?
    Thank you.
    Jochen Schütze

    I have checked this link: /people/krishna.moorthyp/blog/2006/07/23/http-errors-in-xi
    The SLD and the Integrationserver pipeline URL the Port was 50100 and the HTTP port in the RFC Dest. is 8001.
    Witch port must entered in the URL, 50100 or 8001?
    If the port must be 8001, how could i change the URL in the SLD? Must the business System Integrationserver be deleted and new entered witch the right URL?
    Thank you for all answers.
    regards
    Jochen Schütze

  • RecoverableException: Received HTTP response code 404 : Not Found

    Hi All,
    I am getting the below error while doing Scenario JDBC to ABAP Proxy.
    Transmitting the message to endpoint http://XXXXXXXX:50000/sap/xi/engine?type=entry using connection AFW failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Received HTTP response code 404 : Not Found.
    Can any body tell me:
    1. Ideally what should be the port if it is an error due to Port?
    2. I am not able to see the messages in SXMB_MONI?
    3. What is the Flow of my message in the above mentioned Scenario I mean to say from which Engine to which engine?
    Thanks,
    RP

    Hi Rajesh,
    Do I need to mention  Port 8XXX in my Pipeline URL " http://XXXXXXXX:50000/sap/xi/engine?type=entry"?
    I have checked in
    1. SMICM there is HTTP Service port 8XXX
    2. SLD - PI Business System - Pipeline URL is "http://XXXXXXXX:50000/sap/xi/engine?type=entry"
    3. In SXMB_ADM - Corresponding Integ. Server = "http://XXXXXXXX:50000/sap/xi/engine?type=entry"
    Now tell me is these entries are Ideal??
    Also is thr any place where I need to check for Port and URL??
    Thanks for quick response.
    RP

  • Help: Received HTTP response code 404 : Not Found

    Transmitting the message to endpoint http://chmsxd42:52200/sap/xi/engine?type=entry using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Received HTTP response code 404 : Not Found.
    Our senario is a simple file transfer one, no object has been created in IR.
    While we run the wizard, we just put the dummy interface name and namespace in the interface and namespace blanks.
    After we activate the objects, the source files were picked up and deleted but there is no file created in the target directory, and we got the error message listed at the top.
    Does anyone has some clue about this? Please help.
    Thanks a lot.
    Aditya Babu

    Hi,
    The port of Integration Engine is 80XX, and so 8001.
    In the SLD you must to select the Business System of XI and there you can just set the corret Pipeline URL.
    It means you AE is unable to communicate with IE.
    t-code SMICM..check the HTTP port No:
    open the SMICM code...just right click anywhere in the window...then click on the Services..it will show u the HTTP and HTTPs port no.
    THen from SLD --Business Landscape --your Business System..chek the Pipeline URL http://<host>:<port>/sap/xi/engine?type=entry
    the HTTP port that u will see in the SMICM should be same in the pipeline URL
    Have you checked this one,...
    /people/krishna.moorthyp/blog/2006/07/23/http-errors-in-xi
    Go through this link which as the information of all HTTP errors in XI
    /people/krishna.moorthyp/blog/2006/07/23/http-errors-in-xi
    Thanks
    Vikranth

  • Cannot download WSDL from .....Invalid Response Code: (404) Not Found.

    Hi expert,
    hcb-msap59 (PI system) & hcb-msap49 (ecc system)
    When I try calling the ws navigator with this wsdl: http://hcb-msap49.res.no.enterdir.com:8016/sap/bc/srt/wsdl/sdef_ECC_DOCUMENTCRTRC1/wsdl11/ws_policy/document?sap-client=101
    it gives error :
    Cannot download WSDL from http://hcb-msap49.res.no.enterdir.com:8016/sap/bc/srt/wsdl/sdef_ECC_DOCUMENTCRTRC1/wsdl11/ws_policy/document?sap-client=101: Invalid Response Code: (404) Not Found. The request URL was:"http://hcb-msap49.res.no.enterdir.com:8016/sap/bc/srt/wsdl/sdef_ECC_DOCUMENTCRTRC1/wsdl11/ws_policy/document?sap-client=101". Check, whether the URL is correct, and the Web Service that you are requesting is up and running
    In http://hcb-msap49.res.no.enterdir.com:8016/sap/bc/webdynpro/sap/appl_soap_management?sap-language=EN and go to technical configuration, system global settings, access information j2ee server, the hostname and port is of PI system.
    Any idea why Im getting the error? If I click on http://hcb-msap49.res.no.enterdir.com:8016/sap/bc/srt/wsdl/sdef_ECC_DOCUMENTCRTRC1/wsdl11/ws_policy/document?sap-client=101 the sire is opening.
    Any idea why I cant open it from ws navigator of my PI system?
    Thanks.
    Regards,
    Thava

    Hi,
    Can you access that URL when you paste it into your browser? You don't need to configure system global settings unless you want to go to PI's navigator automatically - you can always copy & paste the link after opening the wsnavigator in PI yourself as well. If you can access the link, kindly check your network & proxy setup.
    Regards,
    Gokhan

  • Getting the response code from a http url connection

    The following program bombs if it does not find a page
    import java.net.*;
    import java.io.*;
    public class URLReader {
    public static void main(String[] args) throws Exception {
    URL yahoo = new URL("http://www.yahoo.com/sadjhasjd.html");
    HttpURLConnection client = (HttpURLConnection) yahoo.openConnection();
    int resp_code = 0;
    if(client!=null)
    resp_code = client.getResponseCode();
    I want to get the page that the yahoo returns if it cannot get the page.... just cut and paste the above address in a web browser and see what you get.....how can i get that page back....the above thing throws an IOException...............
    thanks
    sharad

    The problem is it doesn't like .htm or .html for some reason.. I don't know this reason but somebody else might..
    Just try taking the .html off the link like this, then I'm sure you'll get the error now.
    URL yahoo = new URL("http://www.yahoo.com/sadjhasjd");
    I know it's not what you want but that is all I can offer. It seems to only look for the main index.htm(l) or welcome.htm(l) files. Sorry thats as much as I can offer on this.

  • InvalidResponseCodeException: Invalid Response Code: (404) Not Found

    I get the following error when trying to launch an view with an embedded Adobe Interactive Form .. I guess it is because the ADS server is not installed on my local trial copy of Netweaver SAP WAS .. I tried to confirm this by accessint the link: http://<server>:<port>/AdobeDocumentServices/Config but get the error that the requested document does not exist ... should this come as part of a trial version .. is there a way I can download / install .. thanks in advance !

    Hi Damien,
    After executing the URL, are u able to get the version number of the ADS in the response area ?You can ignore the message Required stream: "PDFDocument" not found.
    You can also check in the System Info of the WAS if ADS is installed or not.
    You you can download the ADS installation from the download section at http://service.sap.com provided you have a user id and password.
    To configure the ADS, you can refer to the configuration guide at <a href="http://help.sap.com/saphelp_nw70/helpdata/en/37/504b8cbc2848a494facfdc09a359b1/frameset.htm">http://help.sap.com/saphelp_nw70/helpdata/en/37/504b8cbc2848a494facfdc09a359b1/frameset.htm</a>
    In addition you can check note# 894009 and use the search function.
    Hope this helps.

  • Support for HTTP  Range header element

    Regarding Weblogic 7.1 sp2 +,
    Does the HTTP implementation in the web server component support the "Range" header
    element ???

    Damien Dallimore wrote:
    Regarding Weblogic 7.1 sp2 +,
    Does the HTTP implementation in the web server component support the "Range" header
    element ???Welblogic 8.1 supports HTTP byte-ranges. You can contact customer
    support if you need a patch on 71

  • Encountered HTTP Response Code: 482 when using HttpURLConnection object

    Hi, all.
    I was writing a Java web project deploying to OC4J which is used for asynchronous polling to Microsoft CWA server.
    At some time later, it is found that the polling fails due to HTTP response code: 482. However, on the CWA side, no exceptions and errors can be found.
    I searched for long and didn't get any 482 response code related to HTTP.
    Could anybody give a hand?
    Thanks.
    Edited by: xdallen on Oct 8, 2009 7:16 PM

    It's not a standard HTTP response code. You will have to ask whoever sent it what it means.

  • Outbound RFC to file: Received HTTP response code 500

    hello:
    i am doing outbound rfc from ecc to other system using PI and I get the below error in the PI.
    I am on PI 7.0 and looked at the RFC destiantions in ECC and all look good.
    The registered program in TCP/IP RFC destination was tested and looks fine .
    I checked the SMICM in PI running at port 8000 and it looks file and also i checked the SXMB_ADM Interation configuration in PI which looks good too .
    Even the PI integration engine is restarted . i am sure its in PI and I am hoping its related to user in PI -adapter frame work user XIAFUSER?
    can you please let me know how to fix the below issue ..
    "Transmitting the message to endpoint http://HGSGXI50:8000/sap/xi/engine?type=entry using connection RFC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Received HTTP response code 500 : Internal Server Error"
    thanks,

    HI
    for the error com.sap.aii.af.ra.ms.api.RecoverableException Received HTTP response code 500 Internal Server Error" 
    HTTP 500 can be any problem at receiver side. Are you sure, that the payload fits to the receiver requirements
    Please refer this thread answered by Stefan Grube
    Plain HTTP adapter error
    check the similar thread HTTP server code 500 reason Internal Server Error

Maybe you are looking for

  • Regarding comment statement in JSP Page

    Hai to All, I have written one small jsp page which checks the given name and display the entered name. This is the code which i have written. Its working fine. <html> <% String name = request.getParameter("txtName"); out.println("THe Name is"+name);

  • Mapping exception in XI :Cannot produce target element

    Hi All, This is for RFC-to-JDBC Scenario. I import an RFC from SAP for Vendor Master ( BTE Event : 00001421). In that there are tables and structures. When i create a Vendor in transaction XK01, if i dont fill any of the values in structure WYT3, it

  • ASA 5510 & Object-groups

    I have an ASA 5510 and have just started using object-groups which are super handy in theory, but not working in reality. I have a service object-group with a mix of tcp, icmp, and udp ports. Let's call it Sample_Port_Group. I'm trying to apply it to

  • Windows 2008 R2 smtp server Relay only selected servers without authentication

    Hello, Need help in configuring Windows SMTP server. Windows 2008 R2 Server. SMTP service is installed and configured. Access TAB -- Authentication TAB -- Anonymous Access is selected.. Relay TAB -- Only the list below is selected and specfic scanner

  • Wallpaper in lockscreen won't update

    I set bing photo as my default lockscreen wallpaper. However, I notice it will not update daily albeit the photo in bing search has updated. Any trick in setting to make it update itself as well as bing search? Thanks Lumia buddy.