Why http socket return -1

I use HttpURLConnection class to submit a list of values to a servlet,
When I use application to do that,it works.But after I change it to
a servlet,it failed.getResponseCode() return -1 not 200,why?

public void SubmitToParty(String reqMethod,String URLStr,String Content)
try
URL UrlInst = new URL(URLStr);
URLConnection MyConn= UrlInst.openConnection();
HttpURLConnection HttpConn = (HttpURLConnection)MyConn;
if(reqMethod.compareTo("GET")==0||reqMethod.compareTo("POST")==0)
HttpConn.setRequestMethod(reqMethod);
HttpConn.setDoOutput(true);
PrintStream out = new PrintStream(HttpConn.getOutputStream());
out.println(Content);     
out.close();
System.out.println(HttpConn.getResponseCode());
System.out.println("send data ok!");
catch(Exception URLExp)
System.out.println("Submit to party error!");
URLExp.printStackTrace();
}

Similar Messages

  • How to consume web service in WDP ABAP ---HTTP error (return code 404, mess

    Hi,
    Am trying to consume a web serivce in WDP where I got error HTTP error (return code 404, message "conn failed")in sdn i came to know that it could be resloved by giving the IP address of the host but in case it is not the web services am using are the external links.
    kindly help me to sort it.
    Regards
    Raj

    hi,
    in addition to above thread
    refer this too
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0d4aa08-beed-2a10-fab2-ad975cead04a
    bvr

  • Error in Webservice Call HTTP error (return code 404, message conn failed)

    Hi
    We wish to call  a standard EP7 webservice through ABAP.
    When we try to create consumer proxy , we get the following error.
    HTTP error (return code 404, message "conn failed")
    Message no. SPRX090
    ==> Display Error Document
    If you want to generate a proxy for an external WSDL document by specifying a URL, check that the proxy settings of the system are correct (transaction SICF - Client - Proxy Settings). If you want to generate a proxy for an XI Repository object, check the connection to the Enterprise Services Builder as follows:
    Check List for Setting Up a Connection to the Service Repository
    1. The address of the Enterprise Services Repository must be known in the SAP system
    Check with report SPROX_CHECK_IFR_ADDRESS
    The address is taken from the following parameters in the exchange profile ('Connections' section):
    com.sap.aii.connect.repository.name: Server (for example,pwdf0436)
    com.sap.aii.connect.repository.httpport: Port (for example, 1080)
    com.sap.aii.connect.repository.contextroot: Root (for example,rep)
    The logon data is also read from the exchange profile ('ApplicationSystem' section):
    com.sap.aii.applicationsystem.serviceuser.name: User
    com.sap.aii.applicationsystem.serviceuser.pwd: Password
    As an alternative to using the exchange profile, you can maintain the RFC destination SAP_PROXY_ESR. If this RFC destination is maintained it will be used by the proxy generation in place of data from the exchange profile to access the Service Repository. In this case, the Exchange Profile will even not be read.
    The RFC destination has to be set up using transaction SM59 and should look like this:
    RFC Destination: SAP_PROXY_ESR
    Connection Type: G (HTTP Connection to External Serv)
    Description1: ESR for Proxy Generation
    Target Host: esr_host
    Service No: 1080
    Path Prefix: rep
    Logon and Security:
    Basic Authentication: active
    User: esr_user
    Password: esr_password
    2. The HTTP Framework of the Web Application Server must function
    Check with report SPROX_CHECK_HTTP_COMMUNICATION
    If necessary, contact your system administrator. Please be aware of the fact, that the HTTP framework is depending on the application server. Thus the result of the report may differ for different application servers.
    3. Proxy generation must interpret the data of the Enterprise Services Repository correctly
    Check with report SPROX_CHECK_IFR_RESPONSE
    you can also login in dev and go to Xn se91
    enter msg id SPRX and msg no 090
    select the message and click on long text..
    you get the same message in a formatted manner..
    How to get rid of this ?
    Regards
    Rajendra

    Hi
    we have given the correct path as we have tested the webserive from
    other technology (.net) by providing the same path.
    regards
    Rajendra

  • Threads with http socket

    Are there any good tutorials that teaches multithreading with http sockets?

    Topic: IDLE Time for Java Application not SYSTEM Idle Hi I am Krishna , I want to calculate idle time for an application.That is , if user1 uses the application for example called "yahoo site" for checking mails , then after 10 mins he went to outside , from 11th min the status of application should show (Like Yahoo messenger after certail time it shows idle time ) in another ADMINJSP page for Admins that how much this user1 idle say.. : 1 min idle 2 min idle .... .... 10 min idle Now user1 comes and now clicks on application . then ADMINJSP page should show total IDLE time (10 mins idle). And he again after 15 mins he went some where from 16th min the status of the application should show in ADMINJSP page.If user1 left the application like that then the application should be idle for 1 hour i.e 1 min idle 2 min idle ... ... 59 mins idle 60 mins idle Time Up -- Session Expired then he has to login again. So the above is the issue --------------------------------------------------------------------------- What i have done ..................issssssssssssss ------------------------------------------------------------------------- I have taken time for last request by using getLastAccessedTime() I have taken present time System.currentTimeMills() Taking the difference we will get the idle time . But the problem here is When user1 click on any page only this calcuting will be done and showing to ADMINJSP because getLastAccessedTime works only when any requests comes , but we dont want like that , we want the application without any requests from user1 the application should show idle for 1 min , 2 mins , 3 mins...so on upto user1 uses the application then the time should be normal. I have also tried all the EVENTS classes in HttpSessionBinding like valueunbound()...or sessiondestroy() etc. Can any one please help me by giving any CODE.If you need more information plz ask me Plz plz plz plz this is very urgent plz can any please send me the CODE , ihave tried this very hard but no idea how to do? long startTime = session.getLastAccessedTime(); long stopTime = System.currentTimeMillis(); long diffTimeInSecs = (stopTime - startTime) / 1000 ; gives idle time for every request Regards Krishna

  • Why must I return a device I own?

    I have a device I have had for 2 years and am NOT on the edge program. Why must I return it if I want to upgrade early on the edge? I can understand going from edge to edge but I OWN my device and it is NOT on the edge program currently.

    If you have had the phone for 2 years as you say, you DON'T need to return it if you want to go on Edge. You say you want to "upgrade early", though, which means you HAVE NOT had the phone for 2 years. If you want to keep your phone, simply complete the contract you agreed to before switching to Edge. Then you DON'T have to return your phone when going on Edge.
    Yes, you may OWN your device but Verizon OWNS a contract you agreed to in order to get your phone at hundreds of dollars off the retail price of that phone. Verizon is simply making you trade the item you own for the item they own. You don't want to make the trade, simply complete the contract and you won't have to.

  • Create a Client Proxy for consume wsdl via https URL return a 110 HTTP code

    Dear all.
    I has new in this forum, and i have a problem when trie to create a client proxy from external WSDL, using https URL, system returns me a 110 http code. For others externs WSDL called via http don´t have any problem, and create client proxy perfect
    Someone can help please.
    best regards in advance.

    Dear Anton I download de WSDL definition in a local file, but when I trie to use, the error persist.
    If I test de URL via WebService navigation option, this work correctly, but if I put this URL thats begins with https, in se80--> create client proxy -->insert URL and then system returns the message HTTP error (return code 110, message "") 
    What it´s happen?.
    Best regards in advance.
    Juliá

  • HTTP send returned with status code(100,101)

    Hi Experts,
    I am facing an error in ADS at se38 --> FP_PDF_TEST_00
    Test Program: Version Information (for Analysis Only)
    SYSTEM ERROR
    ERROR CODE    :    100,101
    ERROR MESSAGE : SOAP Runtime Exception: CSoapExceptionTransport : HTTP send returned with status code
    SOAP Framework error: SOAP Runtime Exception: CSoapExceptionTransport : HTTP send returned with status code(100,101).
    Please let me know how to resolve this issue
    Thanks & Regards,
    Arun

    Hi,
    Thanks For your reply..
    I tryied but no use
    Actually Here i am tryping to do configuration between ECC6 and Bi (ABAP+JAVA) system
    Here my Bi  system no id different from ECC6 system no.
    The steps i did is
    1.created ADS HTTP RFC Connection  in ECC6 sytem
    2. System no. given as BI system no.
    3. If i give prefix:  /AdobeDocumentServices/Config?style=rpc  it is not allowing me to save  But i give /AdobeDocumentServices/Config it allows me to save
    4.And other settings i followed as document "Configuring ADS for Guided Procedures ''
    I am facing same error
    Test Program: Version Information (for Analysis Only)
    SYSTEM ERROR
    ERROR CODE    :    100,101
    ERROR MESSAGE : SOAP Runtime Exception: CSoapExceptionTransport : HTTP send returned with status code
    SOAP Framework error: SOAP Runtime Exception: CSoapExceptionTransport : HTTP send returned with status code(100,101).
    Please any body know me the solution
    Thanks & Regards,
    Arun

  • Why OCIEnvCreate function return -1

    Hello,everyone. Now I use VS C++ 2005 (with sp1)and OCI that in ORACLE 10g to develop a application.
    calling OCIEnvCreate failed when connect the Database. The return value is -1. My Pataner saied, I cannot use OCIErrorGet() to get the error informaintion,becase The Environment isnot initialed.
    But I can connect Database by using ORACLE 10g Client in my mathine(Input the same username and password).
    Why OCIEnvCreate function return -1?

    VC++ 2005 has some known incompatible issues with 10g DLLs. Either downgrade the oracle client or upgrade the VC++ version and try. Hope $ORACLE_HOME env are set in your system.

  • Why oracle function return 4000 characters ?

    Dear All
    When I write any function to get some return value in a query, its width is set to 4000. Moreover, when i write the same query to create any LOV, it gives an error that record group field cannot be greater than 2000. Where the actual width of this field is 200 characters.
    Why function always returns 4000 characters?
    Regards
    Edited by: OraLearner on Dec 1, 2010 11:47 AM

    Because the maximum of a varchar2 in SQL is 4000 and you have no dimension in your function:
    SQL> r
      1  create or replace function myfunc(inMaxVal in number) return varchar2 is
      2    vRet varchar2(32000);
      3  begin
      4    for i in 1..inMaxVal loop
      5      vRet := vRet || '1';
      6    end loop;
      7    return vRet;
      8* end;
    Function created.
    SQL> select myfunc(4001) from dual;
    select myfunc(4001) from dual
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "SCOTT.MYFUNC", line 7
    SQL> select myfunc(4000) from dual;
    MYFUNC(4000)
    1111111111111111111111111111111111111111111111111111
    1111111111111111111111111111111111111111111111111111so the SQL Engine have to assume your function returns 4000 bytes. If you use this function in PL/SQL it can be up to 32767 bytes:
    SQL> r
      1  begin
      2  dbms_output.put_line(substr(myfunc(4002), 1,255));
      3* end;
    11111111111111111111111111111111111111111111111111111111
    PL/SQL procedure successfully completed.cheers

  • AXL: HTTP-Socket needs to be initiated for every packet?

    Hi,
    may be this is a little off-topic:
    I use Java to program AXL-API.
    Example: addRoutePattern. I would like to add 20 route pattern to CM.
    Is there a chance to open a http-socket (once), send the route patterns and close it?
    As far as my experience is, it is not. I have to build for every route pattern an SOAP-packet and it is not successfully, when I don't close the socket after every packet ...
    Any ideas?
    Thanks in advance
    Axel

    2500 RPs? Geez. And I thought my couple hundred was a lot. I actually wrote my axl class lib to automatically wait 10 seconds if it gets the appropriate http repsonse.. that way I can rapid fire and the server throttles my requests.
    I guess the question of whether you can keep the socket open or not comes down to what HTTP standard the server supports - it takes HTTP 1.1 to keep a socket open.

  • Help me with cpan please LWP::Protocol::https::Socket

    I get this error
    Can't locate object method "new" via package "LWP::Protocol::https::Socket"
    I installed a bunch of stuff with cpanp, including Crypt::SSLeay. Don't know where to go from here.

    Java has methods, not functions (it's important), and there are many other kinds of blocks. Here's how you create a static block: public static HashMap<String, String> wapforum=new HashMap<String, String>(37);
    static {
      wapforum.put("-//WAPFORUM//DTD WML 1.0//EN", "0x02");
      wapforum.put("-//WAPFORUM//DTD WTA 1.0//EN", "0x03");
      wapforum.put("-//WAPFORUM//DTD WML 1.1//EN", "0x04");
      // etc.
    } Also known as static initializers, static blocks get executed when the class is loaded, in the order they appear, along with static variable declarations.
    As for you other question, there's a bug in the forum software that sometimes adds right angle brackets when we use left angle brackets in our posts (as if it were closing HTML tags that had been left open). You can work around it by using the &lt; entity in place of literal left angle brackets: Set<Map.Entry<String, String>> settag = tags.entrySet(); ...or by always leaving a space after the bracket: Set< Map.Entry< String, String>> settag = tags.entrySet(); I prefer the former approach, but if you go back to edit your post you'll have to re-escape all the brackets because the forum software replaces them for you. As you may have guessed, the forum software is pretty pathetic.

  • How to detect email, http SOCKETS! HELP!

    I've been exploring socket programming for about 2 weeks now and i'm baffled by the problem of detecting when the SMTP POP3 and HTTP sockets are open... I've have been running all of these port scanners in java and none of these detect these ports when they are open and yes i have ran all of these services to open the ports and then checked to scanner... I know that there is two different types of protocl TCP and UDP... udp being the more basic one... but all of those services run on TCP atleast according to IANA

    try using the JavaMail API
    Using that you can get rid of socket programming and with its APIs you can actually open the inbox as a folder and check for the mails, check if there are new mails, unread mails etc.
    something like
    Folder folder          =store.getFolder("inbox");
    folder.open(Folder.READ_WRITE);
    System.out.println("Total messages are : "+folder.getMessageCount());

  • Cold Fusion 9, cfhttp (https) limiting return to 8K?

    We are running a post to a web service using cfhttp.
    When the post runs over https, the return is limited to 8K.
    Has anyone seen a similar issue?

    Hi
    If you are not on production, can you remove the connector and once again create it and test the same?
    Thanks
    VJ

  • HTTP error (return code 400, message "ICM_HTTP_CONNECTION_FAILED")

    Hello All,
    I am trying to create a proxy class from a webservice through a URL.
    I get the error:
    HTTP error (return code 400, message "ICM_HTTP_CONNECTION_FAILED")
    What could be the reason for this. Please help.
    Thanks,
    Smita

    Hi Smita
    Pls refer the links for this error ICM_HTTP_CONNECTION_FAILED
    The specified item was not found.
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/changing%252bhttp%252bport%252bof%252bdecentralized%252badapter%252bengine
    Http* Errors in XI
    Configuring & Publishing Enterprise Services from SAP Business Suite system into NWCE (Netweaver Composition Environment) Services Registry
    Publishing ABAP WebServices to an External UDDI Server
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/bd5950ff-0701-0010-a5bc-86d45fd52283
    Regards
    Abhishek

  • Why did you return your N97 - fail

    Somebody suggested to take this conversation elsewhere.  I'm starting this to really help Nokia as to why I returned my N97, and maybe somebody else looking to buy one, it will help them decide its nothing that matters to them.
    After reading Nokia's return policy I found that you really only have 7 days to return the phone with the California exception being 30 days but having to pay a 15% restocking fee.  
    I returned my N97 because of all the hoopla about being the new flag ship phone that was a touch screen phone. When I tried to use the phone for 4 days and the back light would not turn on (This has since been fixed in the latest software update)  Knowing I only had 7 days (30 really in my case) I called tech support and they quickly decided to have me send my phone in for repair, they said they had not heard of this problem and it was better to get it in earlier than later. All was so far ok, not great, about 4 days after they received the phone I received a call from the "executive offices of Nokia" telling me they understood I purchased their flag ship phone and they didn't want me to be without a phone, they were going to send me a N71 because the parts for my phone would not be in in 2-3 week. I said ok, and hung up the phone. Then my partner asked if this is a new phone without parts, why not just send you a new phone. I called back and the story changed, now it seemed they didn't know if it was software or hardware. I lost it, and asked for a refund, they said being a new phone they would give me 100% refund and send me out a box that day, and my refund would be mailed out in 6 weeks or more. 1 week later and no box to return the phone in, I called back, Seems they did not send a box out, its going out on Monday, When I said if I didn't get the box by Wednesday I would dispute the charges on my credit card. They also admited that the refund check has already been mailed and if I disputed the charges they would stop payment on the check.
    Issue
    #1 - Customer support never gave me the same story twice, it kept changing
    #2 - I own an iPod touch to listen to music at the gym. The web browser blows the N97 browser away, I don't think Nokia even looked at the iTouch/iPhone to enhance their browser. I found I couldn't use the browser
    #3 - Out of the box the phone software was bad, had they waited till July 1st to ship the phone (about 2 weeks) they would have had a phone that seemed to work
    #4 - OVI prices on application are too high, why are there not any application for $0.99 everything seems to be $2.99 and up
    #5 -  Days after the phone release, when the software still didn't work, Nokia lowered the prices for 1 day, Would not give a refund of the difference.
    #6 -  Memory for the C: default drive is limited, when I send over some ring tones via blue tooth, I filled it up, after reading the forums I found I could set the memory to the 32G partition, Why does a $700 phone cause me to tweek it like that.
    These were my major complaints, I figured for $700 (usd) I would get a phone that worked and smoked all the other phones out there. 

    Hello, you are bit late to the frenzy, but since your post is likely stemming from lots of misinformation that was flying around, here are some sources to get your facts straight:
    http://blog.gerv.net/2014/04/your-ire-is-misdirected/
    https://medium.com/p/7645a4bf8a2
    https://blog.mozilla.org/blog/2014/04/05/faq-on-ceo-resignation/
    Brendan Eich was not fired by Mozilla, it was his personal decision to step down. In fact he is still a Mozillian today...
    Since this forum is a place primarily for volunteers and fellow Firefox users to provide technical support for Mozilla products and not a general place for discussing policies, I'm also going to close this thread.

Maybe you are looking for

  • Full HD backup before sending in for repair-software recommended/how-to?

    Hi all, I have to send my MacBook 2GHz Intel Core 2 Duo running 10.4.11 in for a warrantied repair to the CD/DVD drive (MATSHITA DVD-R UJ-857D). It just doesn't want to read discs anymore and has always been a bit finicky. There are a few other issue

  • How do I use my Airport Express 1st generation to extend my wireless network?

    Hi all, I've got an old time capsule (1st gen) and a 1st gen airport express in another room with a USB printer connected. There's up to 100 meg broadband from a virgin hub, but that is connected by ethernet to my time capsule.  I then configured the

  • How can I import multiple PDF pages into ID?

    I am putting together a catalog which consists of over 400 pages. We had the products on our website exported into a PDF format and I need to add a header and footer to each page via a master page in ID. I don't need to edit the actual PDF but I need

  • An accounting document is not required for this billing document

    Hi, While releasing the billing document to accounting the error is coming like "An accounting document is not required for this billing document" Diagnosis: The billing document has the net value '0' and does not create an accounting document. Despi

  • Problem with selecting special distance

    This used to work on my old iPod. Now when I select special time I get a calories menu and can select 5,10,15 .ect. When I start workout the selected training is in minutes. The trouble is that I canot select other intervals as I used to, and that it