Error In Http Operation Midlet
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up J2ME - MIDP. Get error (40-Error in HTTP operation) with POST request to server up vote 0 down vote favorite i try run code copied from this tutorial http://www.developer.nokia.com/Community/Wiki/How_to_use_Http_POST_request_in_Java_ME But when i run it i get Exception in source code line dis = new DataInputStream(hc.openInputStream()); java.io.IOException: 40-Error in HTTP operation at com.sun.midp.io.j2me.http.Protocol.checkForException(+51) at com.sun.midp.io.j2me.http.Protocol.readResponseMessage_wap(+38) at com.sun.midp.io.j2me.http.Protocol.connect_wap(+649) at com.sun.midp.io.j2me.http.Protocol.connect(+107) at com.sun.midp.io.j2me.http.Protocol$PrivateOutputStream.flush(+39) at java.io.DataOutputStream.flush(DataOutputStream.java:106) at com.orionsource.onlinenards.api.API.sendPostRequest(API.java:221) at com.orionsource.onlinenards.api.API.helloApiWithParams(API.java:259) at com.orionsource.onlinenards.OnLineNards.startApp(OnLineNards.java:33) at javax.microedition.midlet.MIDletProxy.startApp(+7) How to resolve this problem? java-me nokia midp share|improve this question edited Oct 24 '11 at 14:14 gnat 5,83673148 asked Oct 24 '11 at 12:41 Dmitry Nelepov 4,40923552 it's possible that connection isn't correct. can you print hc.gerResponseCode() ?? –frayab Oct 24 '11 at 15:45 No,i c
the benefit that others might, eventually, contribute with intelligent insights. Sunday, April 29, 2007 HTTP POST from a J2ME midlet NOTE - this blog has now moved to codetrips.com It is highly recommended that you read the original post there. ------------- Although there are several examples and tutorials about how to connect to an HTTP server from a J2ME Midlet, I found that they all seem to concentrate a lot on the details of a http://stackoverflow.com/questions/7875778/j2me-midp-get-error-40-error-in-http-operation-with-post-request-to-server GET and the POST is always assumed as an "exercise to the reader." Now, although it is indeed rather straightforward to work out how to send POST requests to a server, I found (the hard way) that there are certain "minor details" that are best not forgotten. I have thus decided to post here a brief example of how to http://codetrips.blogspot.com/2007/04/http-post-from-j2me-midlet.html send a request to a server, using a form-encoded body, so that either a JSP or a servlet can retriever the parameters, but one can benefit from the many advantages of POSTing, as oppposed to GETting. The source code follows, I believe it is reasonably self-explanatory and comments should guide even the most novice reader through, but please do let me know if you feel that this is still too cryptic: private void OpenConnection(String server) throws java.io.IOException { // TODO: the actual "resource" part of the URL (/test in this case) // should be either passed as a parameter or obtained at application // level (maybe even set up at runtime). // To test this code, I have written the simple Servlet below, however // this would also work with a JSP page that echoes back the contents // in text/plain format for the midlet to display. // String url = "http://"+server+"/test"; byte[] data = null; InputStream istrm = null; HttpConnection http = (HttpConnection)Connector.open(url); http.setRequestMethod(HttpConnection.POST); // This allows a JSP page to process the parameters correctly
von GoogleAnmeldenAusgeblendete FelderBooksbooks.google.de - Novel Algorithms and Techniques in Telecommunications, Automation and Industrial https://books.google.com/books?id=z8nmMkUFqdwC&pg=PA126&lpg=PA126&dq=error+in+http+operation+midlet&source=bl&ots=AtbWGQWGsI&sig=92HMjhyrQJPW6X4MghVyeuhg5TY&hl=en&sa=X&ved=0ahUKEwiAwLXixczPAhUE92MKHZKhBpoQ6AEIOjAF Electronics includes a set of rigorously reviewed https://www.scribd.com/doc/282203877/Client-Log world-class manuscripts addressing and detailing state-of-the-art research projects in the areas of Industrial Electronics, Technology and Automation, Telecommunications...https://books.google.de/books/about/Novel_Algorithms_and_Techniques_in_Telec.html?hl=de&id=z8nmMkUFqdwC&utm_source=gb-gplus-shareNovel Algorithms and Techniques in Telecommunications, Automation and Industrial ElectronicsMeine BücherHilfeErweiterte BuchsucheE-Book error in kaufen - 149,93 €Nach Druckexemplar suchenSpringer ShopAmazon.deBuch.deBuchkatalog.deLibri.deWeltbild.deIn Bücherei suchenAlle Händler»Novel Algorithms and Techniques in Telecommunications, Automation and Industrial ElectronicsTarek Sobh, Khaled Elleithy, Ausif Mahmood, Mohammad A. KarimSpringer Science & Business Media, 15.08.2008 - 585 Seiten 0 Rezensionenhttps://books.google.de/books/about/Novel_Algorithms_and_Techniques_in_Telec.html?hl=de&id=z8nmMkUFqdwCNovel Algorithms error in http and Techniques in Telecommunications, Automation and Industrial Electronics includes a set of rigorously reviewed world-class manuscripts addressing and detailing state-of-the-art research projects in the areas of Industrial Electronics, Technology and Automation, Telecommunications and Networking. Novel Algorithms and Techniques in Telecommunications, Automation and Industrial Electronics includes selected papers form the conference proceedings of the International Conference on Industrial Electronics, Technology and Automation (IETA 2007) and International Conference on Telecommunications and Networking (TeNe 07) which were part of the International Joint Conferences on Computer, Information and Systems Sciences and Engineering (CISSE 2007). Voransicht des Buches » Was andere dazu sagen-Rezension schreibenEs wurden keine Rezensionen gefunden.Ausgewählte SeitenSeite 17TitelseiteIndexInhaltKernel Locally Linear
allUploadSign inJoinBooksAudiobooksComicsSheet Music You're Reading a Free Preview Pages 2 to 11 are not shown in this preview. Buy the Full Version Client LogUploaded by Herry Purwanto PanjaitanHypertext Transfer ProtocolJava (Programming Language)Short Message ServiceSubscriber Identity Module11 viewsDownloadEmbedDescription: adwadawSee MoreadwadawCopyright: © All Rights ReservedList price: $0.00Download as TXT, PDF, TXT or read online from ScribdFlag for inappropriate content Documents similar to Client LogSpring RemotingLearning Network Programming with Java - Sample ChapterDEV Rest Services Documentation 230412 0836 8Labsheet1ASA Scansafe Step by Step ConfWireshark Http Solution v6.1Free Esl Downloadables روعةHTTP SuccinctlyWindows Wls Server LogvertxcorePathUnwriter-HowToDwg Sms API.v2.1 en.11caleb09wioptDownload Paddle Ball Game JavaInside the Java 2 Virtual Machine by Bill Venners - 5 Star Book Review.pdfmFMS-FAQs15969397 Jeremy Weiskottens ResumeProxifierFinFlyISP on the CloudShield CS-2000 (Handover).pdf000-315Where the Cloud Things AreTelecommunication Networks University of Wollongong 2004 - Lecture 8310-502HTML6_WMQ_APIsTE2403IBM Certified WAS 8.5 Administration Intelligent ManagementNokia_C2-03_UG_enJAVA 8 GUIBooks similar to Client LogJava 8 Programmer II Study GuideMastering ElasticSearchNginx HTTP Server - Third EditionCore Java Professional Core Java Professional Core Java Professional Java Core Java Professional Core Java Professional Java Core Java Java Java Java for RPG ProgrammersWildFly Performance TuningJBoss Weld CDI for Java PlatformSpring CookbookCRACKING THE PROGRAMMING INTERVIEW Slick2D Game DevelopmentTomcat 6 Developer's GuideJavaRuby on Rails Web Mashup ProjectsREST API Design Control and ManagementJava Practice QuestionsJava Practice QuestionsMastering JavaServer Faces 2.2Natural Language Processing with JavaApache Maven 2 Effective ImplementationJava Cryptography