Howto connect with http to a socket - header problem?

Hi
i am writing a midlet that connects via http to a server with a java socket.
i can receive the data, but when i try to return data to the sockets outputstream,
the midlet doesnt receive it and waits endlessly.
Do i have to send a http header in the return connection?
Does anybody have another idea?
if not, how do i send the header and how should it look like?
Thanks for your help.
Mathis

if you use a socket connection you need to talk the language the server understands, means, you need to send the commands that are specified in the rfc for the protocol you use. means, talking to a webserver is different that talking to pop3 server or to a ftp server.....
and, just for your information: sockets are not requiered in the j2me specification, means that not all vendors have implemented socket protocol into their devices. only required is http.

Similar Messages

  • E3000 questions. Cisco Connect with https and turn off wireless?

    My old router died this weekend after 10 years and I have been wanting to get a faster router for a while anyways.
    I picked up a E3000 and set it up yesterday.
    The firmware is 1.0.03
    I have two main questions
    I changed the router settings so you can only browser manage the router through https and turned off http access to the router.
    Cisco Connect now doesn't work. Will Cisco Connect work with HTTPS? Do I have to do something to get it to work?
    I also didn't see a version number on Cisco Connect am I just not noticing it?
    I'd really like to shut off wireless on most days when I'm not home. I want the router to still be working since my desktop computers are directly connected to the router and I remote into them. Is there an easy way to shutoff the wireless and then easily turn it back on when I get home?
    thanks
    mike

    Mine works the same. It's probably designed that way for the manual way of logging into the setup page of the router.
    No, it seems no updates yet or see the need to have one.
    No, it doesn't have that option unfortunately.
    "The war between heaven and hell depends on the choices we make, and those choices require sacrifice. That's the test"

  • After having downloaded my e-book ADE gives the information that there is not a connection with internet. What is the problem? Liejaat.

    After having downloaded my e-book, Adobe Digital Edition gives me the information  that there is no connection with internet.Who can help me with this problem? Liejaa.Adobe Digital Editions

    I've never seen this error in the context of trying to connect via ODP.NET or ODT.
    If you have Oracle Dev Tools for Visual Studio installed, you can try to create a connection to the database using Server Explorer. If this works, that means your ODP.NET connection is just fine.
    If you don't have VS or the tools, another thing you can try is connecting through ODP.NET using a simple OracleConnection.Open. Make sure you have your client set up to connect to the DB server.
    Here's some info about connecting to the DB:
    http://download.oracle.com/docs/html/B28089_01/featConnecting.htm#sthref101

  • ITunes cannot connect with this iPad Error/iOS 5 problem

    It appears that ever since upgrading to iOS 5 and opting to sync my first gen iPad wirelessly, I have been receiving an error message each morning stating "iTunes cannot connect with this iPad..."
    The wireless sync capability works fine, I plug my iPad into the wall when I come home, and it starts pushing and pulling all the new apps that I've downloaded in the day.
    It appears that iTunes is will regularly try to connect with the iPad while it is charging. At some point during the evenings, either my iPad will be asleep or my iMac will be asleep. I think this is where the connection problem is arising.
    Does anyone know how to change iTunes' frequency of wireless sync to a device that it is wirelessly connected to? Ideally, I'd like it to only sync wirelessly once when I plug the iPad into the wall.

    See if this page helps : http://support.apple.com/kb/TS3221

  • Is there a workaround for connecting with https. the ssl/tls security fix is preventing us from connecting to a known trusted site

    i made the mistake of updating Firefox yesterday and with the ssl security fix find that i can longer connect to a web site at a remote data center that is protected by a fortigate appliance.
    i know the correct answer is to get the appliance upgraded or replaced but in the meantime i am in desperate need of a workaround. it would be nice if there was an archive of old Firefox versions.
    i have changed the config settings to allow renegotiation but i think the problem is more fundamental than that in that it doesn't appear that older versions of ssl are provided anymore.

    You're welcome
    It is better to use a .cmd or .bat file to set that environment variable and subsequently start Firefox and not set that variable in the system settings as it will there also affect other Gecko (XUL Runner) based software.<br />
    Then you can use a shortcut with that cmd file in case you really need it to access that site and run Firefox normally in other cases to be protected.
    <pre><nowiki>set NSS_SSL_CBC_RANDOM_IV=0
    start "" "C:\Program Files\Mozilla Firefox\firefox.exe"
    </nowiki></pre>

  • Howto callout with https

    Hi!
    I am looking for some document that describes how to set up web services callout from Oracle database (10g) via https.
    This is for callout only (i.e. the service itself already exists, and is external to Oracle, and it is not based on Oracle software)
    Specific questions:
    - Is it even possible (the service is not Oracle, can I still use https)?
    - What do I need in terms of software (in addition to database and callout utility)?
    - How exactly are the certificates configured (at least on the callout Oracle database side, are they stored in the database?)
    Any specific documentation pointers would be welcome.
    Again, this is not about creating a web service (I do not have, nor can have Oracle Application Server), but rather about calling an existing non-Oracle web service from Oracle 10g database, and doing so via https.
    Thanks.
    Kirill

    Assume JPub generates the plsql_proxy.jar and PLSQL wrapper CALLOUT.
    (1) Replace $ORACLE_HOME/javavm/lib/security/cacerts with the server keystore, then restart the db.
    (2) Zip the server keystore into plsql_proxy.jar as genproxy/client.keystore.
    (3) Run the following via SQLPLUS to set callout HTTP certificate:
    SQL> begin callout.setSystemProperty('javax.net.ssl.trustStore', 'genproxy/client.keystore'); end;
    SQL> begin callout.setSystemProperty('javax.net.ssl.trustStorePassword', 'oracle'); end;
    (4) Invoke CALLOUT wrapper as it is invoked for http://.

  • Configure ADF with HTTPS connections

    Hello.
    I am trying to deploy an ADF application with the protocol https.
    When I write the url:
    https://[my_domain]/[my_application]
    The request is done, but the adf controller answers suddenly with the url i sent, but it writes instead of https http, and adds in the end of the url a lot of get parameters like the next sample:
    http://[my_domain]/[my_application]/faces/[my_wellcomefile]?_afrLoop=2328230397945919&Adf-Window-Id=w0&_afrWindowMode=0&_adf.ctrl-state=14g97quz_327&_afrRedirect=2328230626510965
    I don`t mind the get parameters, I suppose that they are needed for adf to work. But the problem is that I need the request to connect with https, not with http, because my apache has only opened the port 8080.
    Please, anyone can tell me how to configure adf to disable this redirection, or to configure the redirection to point to:
    If the request comes from http -> redirect to http
    if the request comes from https -> redirect to https.
    Regards

    Thanks Chris,
    But I don`t think the problem is related with WebLogic Server. The weblogic is already with a ssl connection configured and working. In fact, after the redirection to the second url:
    http://[my_domain]/[my_application]/faces/[my_wellcomefile]?_afrLoop=2328230397945919&Adf-Window-Id=w0&_afrWindowMode=0&_adf.ctrl-state=14g97quz_327&_afrRedirect=2328230626510965
    if copy and paste this url but changing the protocol https:
    https://[my_domain]/[my_application]/faces/[my_wellcomefile]?_afrLoop=2328230397945919&Adf-Window-Id=w0&_afrWindowMode=0&_adf.ctrl-state=14g97quz_327&_afrRedirect=2328230626510965
    it works! So, summarizing, the problem is in the first redirection made in a transparent way for me.
    Refering to the post of Frank Niphus:
    Switching Http/Https in ADF
    you can understand my problem and we can see a workaround, but I want all the requests to go to https, not only some of them like is done in this post.
    Regards

  • Error when i try to connect with blogger from firefox

    when i try to connect with blogger.com and i enter my password the firefox is loading me as it should and then it returns to the blogger page...
    it doesn t say that i put the password wrong it does not say anything its like i m stuck there...i can connect to gmail
    but not to blogger and since the problems occurs only with firefox , as i can connect with other explorers i suppose the problem comes from firefox
    i reinstalled the firefox nothing changes
    also at blogger the firefox crashes in a way that it shows on the top of the page an error instead of the blogger links(connect , new post etc)

    See if this helps you. <br />
    http://support.mozilla.com/en-US/kb/Changing+the+e-mail+program+used+by+Firefox

  • Connecting to HTTPS site

    Hi all,
    I have a problem with connecting to a HTTPS site from a JSP page.
    I used the samplecode given in the Tomcat SSL guide in HttpClient for this purpose. But its giving error.
    First I didnt used the Protocol class to register the https protocol. Then I got an error
    "SSL handshaking error, No trusted certificate found"
    later when I used the Protocol class to resgister https, I got NullPointerException.
    My machine is behind proxy.
    Do I need any third party certificate to connect with https?
    Pls help me with details...
    Jijesh

    Jijesh,
    I am struggling with the same issue. Were you able to resolve it? Any help is greatly appreciated.
    Namrata

  • Steps to connect to HTTPS webservice

    Hi,
    I would like to know the steps to connect to HTTPS webservice URL.
    Please note the server is hosted within the network. So i would think that i do not require to use Adapter datastore and would need to use Webservice datastore.
    I have the certificate available with me as well.
    I am using DS 12.2.2.1
    Thanks

    You should check note ... 1423991 - How to use SSL with Data Services admin Console -
    Resolution
    Use the 'keytool.exe' tool within the 'javasdk\bin' folder to generate a JKS certificate
    Run the following command:
    keytool.exe -genkey -alias your_alias -keyalg RSA -validity 365 -keystore
    "D:\Business Objects\Tomcat55\conf\your_alias.JKS"
    The tool will ask for more details regarding the certificate and then ask to provide a password
              For test purpose use the jks file attached ''LHRSDSWEBPP.jks''
        3.   Drop this file LHRSDSWEBPP.jks on the ''C'' drive
        4.   Go to %LINK_DIR%\Tomcat55\conf
        5.   Edit server.xml
        6.   Replace the existing paragraph below <!-- Define a SSL HTTP/1.1 Connector on port 8443 > with the following one, making sure any comment tags like "<! -->" around this section are removed:
                   <Connector port="28443" redirectPort="28080" maxHttpHeaderSize="8192"
                   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                   enableLookups="false" disableUploadTimeout="true"
                   acceptCount="100" scheme="https" secure="true" SSLEnabled="true"
                   clientAuth="false" sslProtocol="TLS"
                   keystoreFile="C:\LHRSDSWEBPP.jks" keystorePass="accounT27" keyAlias="LHRSDSWEBPP"/>
        7.   Go to OS Services
        8.   Shutdown  and Restart Apache Tomcat 5.5.20
        9.   Connect with HTTPS://machine_name:28443/DataServices/launch/logon.do
        10.   For further information regarding the JKS file , go to http://mindprod.com/jgloss/keytoolexe.html

  • ISight - connects with windows users no problem?

    I'd like to buy this webcam, but I heard it has problems connecting with windows users. Will I be able to talk to people on it through AIM? Thats what I'd like, if not, I probably wont get it. Anyone have any personal experience or have any answers or helpful tips - I'd appreciate anything - thanks.

    It is not the iSight itself that gives you the impression that connecting with Micros~1 Windows users causes problems ... it is the availability of (cross platform) applications that makes connecting a bit more cumbersome.
    I have PowerMac G5 with iSight and I connect with my Micros~1 Windows platform family equiped with and without USB webcam.
    The challenge will be to find messaging / VoiP applications with bearable audio quality and reasonable video performance.
    I started with Skype for Voice and Yahoo! messenger for bad video ( 1-2 fps and video size 320 x 240).
    Skype has a video plugin (only for Windows)
    Yahoo! Messenger does not have voice yet (2.5.3)
    MSN is badmouthing because of the "M"
    I have used iChat with another Apple believer ... and the quality of Voice and Video is unparralled.
    The best two alternatives I found are:
    a) AIM 5.9
    b) Trillian (www.trillian.cc)
    Both use a free AIM screen name.
    AIM works fine, see also EZJim pages.
    TrillianPro 3.1 reuses AIM screen names ... and ... it has both good audio and zoom-to-full-screen-video size with fps rates filling your bandwidth.
    The only negative on Trillian so far, the "handshake" for connecting two people takes some time.
    TrillianBase is free but has no Video capabilities. The Pro version is 25$.
    Regards Coen
    ps. if you want to test your setup use my AIM screenname: coenjeukens

  • I can't connect with using connector

    Hi,
    I want to create a system(Solman 4.0) in Portal.I have created a SAP system using dedicated application server and then I filled all necessary fields.I tested with using system connection test.There are two test nameS(SAP Web AS Connection and Connection test for Connectors)Firstly, I checked WAS Connection and everything was ok but when I tested "Connection Test for Connectors" it didn't work.When I clicked test button, it said "Connection failed. Make sure user mapping is set correctly and all connection properties are correct" but I didn't use UIDPW.I used the Logon Ticket method and system_type is SAP_CRM but when I checked log file, it said this message "(R3/BW) Failed to get connection. Please contact your admin".I didin't understand because I have already used SAP_CRM syte sytem type.Why do I get this message. In addition, The ume.usermapping.unsecure is already on TRUE.In short, I can't connect with using connector.What's the problem?

    Hi Vijith,
    I perform your suggestion and I got an error message.This error message is written below.
    Exception in SAP Application Integrator occured: Unable to parse template '<System.ConnectionString>'; the problem occured at position 0. Cannot process expression <System.ConnectionString> because Invalid System Attribute: System: &#39;SAP_LocalSystem&#39;, Attribute: &#39;ConnectionString&#39;. .
    There is a connection string error but I didn't use by using connection string method.I have used by using dedicated application server. At the same time, I have another error message in the dev_jrfc.trc.This error message is as fallows
    Error> occured  >Mon May 07 09:18:37,334<    >RfcGetException rc (7) message: The system is unable to interpret the SSO ticket received
    <RfcGetException
    What's your comment?

  • 9.0.1  DB-Connect with jdbc

    Hello,
    we have a problem with a connect of the oracle 9.0.1 datebase.
    a connect with the sqlplus-editor and a precompiler programm is
    without problems.
    a connect with the jdbc (java) is a problem.
    the error message is in the file:
    /u01/app/oracle/admin/mpb1/bdump/s000_617_mpb1.tr
    /u01/app/oracle/admin/mpb1/bdump/s000_617_mpb1.trc
    Oracle9i Release 9.0.1.0.0 - 64bit Production
    JServer Release 9.0.1.0.0 - Production
    ORACLE_HOME = /u01/app/oracle/product/9.0.1
    System name: HP-UX
    Node name: MPB1
    Release: B.11.11
    Version: U
    Machine: 9000/800
    Instance name: mpb1
    Redo thread mounted by this instance: 1
    Oracle process number: 8
    Unix process pid: 617, image: oracle@MPB1 (S000)
    *** SESSION ID:(8.60) 2001-12-04 11:32:22.999
    *** 2001-12-04 11:32:22.998
    ksedmp: internal or fatal error
    ORA-00600: Interner Fehlercode, Argumente: [ttcgcshnd-1], [0],
    Current SQL statement for this session:
    SELECT VALUE FROM NLS_INSTANCE_PARAMETERS WHERE PARAMETER
    ='NLS_DATE_FORMAT'
    ----- Call Stack Trace -----
    calling call entry argument
    values in hex
    location type point (? means
    dubious value)
    have anybody a solution for this problem.
    thanks
    chris

    Are you trying external auth with LDAP?
    Have you tried using the ssooid.sql rather than ssoldap.sql?
    I saw a posting here recently indicating that they also got ssoldap.sql to work though.

  • Starting workflow with HTTP-Post

    Hello,
    like I wrote in Starting workflow with HTTP-Post I have a problem with starting a workflow with a http-post:
    I have an installation of SAP ERP 2005 SR2 IDES on Win2003 SR2 SP2 and want to start a simple workflow with an external application. Therefor I created an elementary test-workflow and set the general task flag so everybody is allowed to start it. So far everything work fine as I start it manually.
    Now I want to start the workflow by an external application over a HTTP-Post as described in
    http://help.sap.com/saphelp_47x200/helpdata/EN/54/de9e3887d6174fe10000009b38f842/content.htm
    I configured the webserver (Customizing Web-Server) as follows:
    Service: WebFlow (Intranet)
    Address: http://192.168.0.216:8000/
    Path: SAP/BC/WORKFLOW_XML/?
    and sent a post via perl to http://192.168.0.216:8000/SAP/BC/WORKFLOW_XML/?protocol=01&localkey=WS99900004
    <?xml version="1.0" ?>
    <WfMessage Version="1.0" xmlns="http://www.wfmc.org/standards/doc/WF-XML">
    <WfMessageHeader>
    <Request ResponseRequired="No">
    <Key>http://192.168.0.216:8000/SAP/BC/WORKFLOW_XML/?protocol=01&localkey=WS99900004</Key>
    </WfMessageHeader>
    <WfMessageBody>
    <CreateProcessInstance.Request StartImmediately="true">
    <ObserverKey>http://192.168.0.224</ObserverKey>
    </CreateProcessInstance.Request>
    </WfMessageBody>
    </WfMessage>
    The Web-Server returns
    C:\FH\SAP\perl-scripte>perl http-post.pl
    HTTP/1.1 200 OK
    Server: SAP Web Application Server (1.0;700)
    Content-Length: 0
    Content-Type: text/plain
    Client-Date: Sun, 01 Jun 2008 11:00:24 GMT
    Client-Peer: 192.168.0.216:8000
    Client-Response-Num: 1
    but it seems that nothing happens.
    I also tried to post the XML via html-form-field with the same result.
    Did I forgot something essential?

    Hello Daniel
    It's 6 years after you posted your question, but I found your post very useful and thought it would be worth updating for future reference.
    I've just managed to trigger a workflow via http.
    URL :
    http://server.domain:8000/sap/bc/workflow_xml?sap-client=110
    Java :
    URL obj = new URL(url);
    URLConnection con = (URLConnection) obj.openConnection();
    String userpass = "username:password";
    String basicAuth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userpass.getBytes());
    con.setRequestProperty ("Authorization", basicAuth);
    con.setRequestProperty("Content-type", "text/xml");
    con.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    wr.write( xml.getBytes("UTF-8") );
    wr.flush();
    wr.close();
    You can then read the response.
    I found that until I added the sap_client parameter I couldn't debug in CL_HTTP_WORKFLOW_XML->IF_HTTP_EXTENSION~HANDLE_REQUEST. Then I found that the content type has to be "text/xml".
    I set the xml variable (the data sent to ECC) to :
    <?xml version="1.0" ?>
    <WfMessage Version="SAP.1.0" xmlns="http://www.wfmc.org/standards/doc/WF-XML">
    <WfMessageHeader>
    <Request>
    <ResponseRequired>Yes</ResponseRequired>
    </Request>
    <Key>HTTP://server.domain:8000/SAP/BC/WORKFLOW_XML/?~localkey=WS90000074</Key>
    <Operation>CreateProcessInstance</Operation>
    </WfMessageHeader>
    <WfMessageBody>
    <CreateProcessInstance>
    <Key>HTTP://server.domain:8000/SAP/BC/WORKFLOW_XML/?~localkey=WS90000074</Key>
    <ContextData>
    <YOUR_CONTEXT_VARIABLE>x</YOUR_CONTEXT_VARIABLE>
    </ContextData>
    <StartImmediately>Yes</StartImmediately>
    </CreateProcessInstance>
    </WfMessageBody>
    </WfMessage>
    regards
    Steve

  • Socket communication with HTTP server : how to send a form variable ?

    Hi everyone,
    I'm trying to program a Socket application that calls a CGI programmed in ASP and sends a variable with some content via the POST HTTP method.
    My problem is that I'm unable to retrieve my variable content in the CGI. I don't know what I'm doing wrong when sending my variable. Here are the main steps of my application
    [Client side]
    - Create an URL
    - Open a connection
    - Send header info with variable name and content via POST method
    - Read server response
    [Server side]
    - Request the variable
    - Store its content in a file
    Here's the code of my class :
    import java.net.*;
    import java.io.*;
    public class SocketTest{
         public static void main(String args[]){
                 //create the URL
              URL url = null;
              String strURL = "http://192.168.1.11/htmleditor/cgi.asp";
              try{
                   url = new URL(strURL);
              catch(MalformedURLException exc){
                   System.out.println("Invalid URL : " + strURL);
                    //create a socket
              Socket socket = null;
              try{
                   int port = url.getPort();
                   if (port < 0){
                        port = 80;
                   socket = new Socket(url.getHost(), port);
              catch(Exception exc){
                   exc.printStackTrace();
              OutputStream out = null;
              InputStream in = null;
              try{
                   //configure request
                   String data = "htm_content=toto";
                   String request =      "POST "+ url + " HTTP/1.0\r\n" +
                                         "Accept: */*\r\n" +
                                         "Content-length: " + String.valueOf(data.length()) + "\r\n" +
                                         "Host: JAVA_HOST\r\n" +
                                         "User-Agent: Generic\r\n\r\n" +
                                         "htm_content=toto";
                   //send request
                   out = socket.getOutputStream();
                   out.write(request.getBytes());
                   out.flush();
                   //read server response
                   in = socket.getInputStream();
                   int bufferSize = 1024;
                   byte responseBytes[] = new byte[bufferSize];
                   while ((bufferSize = in.read(responseBytes)) > 0){
                        System.out.print(new String(responseBytes, 0,bufferSize));
              catch(IOException exc){
                   System.out.println(exc);
              //Close streams and sockets
              try{
                   in.close();
              catch(IOException exc){
                   exc.printStackTrace();
              try{
                   out.close();
              catch(IOException exc){
                   exc.printStackTrace();
              try{
                   socket.close();
              catch(IOException exc){
                   exc.printStackTrace();
    }Here's the code of my ASP CGI page (called cgi.asp) :
    //CGI.ASP - Begin
    <%
         Option Explicit
         Dim objFso, objFile, strHtmContent, strFileName
         On Error Resume Next
         Set objFso  = Nothing
         Set objFile = Nothing
         Set objFso  = Server.CreateObject("Scripting.FileSystemObject")
         strFileName = Server.MapPath("htm_content.htm")
         Set objFile = objFso.CreateTextFile(strFileName, True)
         strHtmContent = Request("htm_content")
            If len(strHtmContent) > 0 Then
           objFile.Write strHTMContent
            Else
              objFile.Write "NO CONTENT RECEIVED"
            End If
    %>
    <html>
    <head>
    <script language="javascript">
      function closeAll()
        window.close();
        return 0;
    </script>
    <body onLoad="javascript:closeAll();">
    </body>
    </html>
    //CGI.ASP - ENDWhen I execute my SocketTest app I get this output:
    F:\JavaDev\htmleditor\docs>java SocketTest
    HTTP/1.1 200 OK
    Server: Microsoft-IIS/5.0
    Date: Fri, 12 Jul 2002 15:31:56 GMT
    Connection: Keep-Alive
    Content-Length: 192
    Content-Type: text/html
    Set-Cookie: ASPSESSIONIDQQGGGKMU=MMPPMLEDGDEMCCJDBGOKMNDC; path=/
    Cache-control: private
    <html>
    <head>
    <script language="javascript">
    function fermerTout()
    window.close();
    return 0;
    </script>
    <body onLoad="javascript:fermerTout();">
    </body>
    </html>
    The file "htm_content.htm" is created but it has this content :
    NO CONTENT RECEIVED
    This means the server was unable to retrieve the content of the variable called "htm_content"
    REM : the variable is called like this 'cause I intend to use it to send HTML content
    Any idea of what I'm doing wrong ?
    Thanxs in advance for any help,
    Diego TERCERO

    For the POST request you'll only need (with HTTP 1.0)
         String request =      "POST "+ url + " HTTP/1.0\n" +
              "Content-type: application/x-www-form-urlencoded\n" +
              "Content-Length: " + String.valueOf(data.length()) + "\n" +
              "\n" +
              data;
    Note the Content-type header.
    Fred (Donne les duke�)

Maybe you are looking for