×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    15

    Question problem in comminication with web server

    hi,all
    I'm trying to connect my program with web server on IIS and exchange data between them.
    e.g Mobile phone send some control message to server, and the server gives response after doing some search in database on server site.

    my problem is how to do so, i don't know what should phone-site send?
    any help will be appreciate!!!



    Guanwei

  2. #2
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    51

    Re: problem in comminication with web server

    I've been working on a similar application and gotten things to work with the following steps:

    1. Use RHostResolver (iHostResolver) to convert a servername (http://www.google.com) to an TNameEntry (iHostAddress).

    Code:
    iHostResolver.GetByName(serverName, iHostAddress, iStatus);
    2. Use RSocketServ (iSocketServer) to open an RSocket (iSocket)

    Code:
    iSocket.Open(iSocketServer, KAfInet, KSockStream, KProtocolInetTcp)
    3. Use a simplet GET command to get the web page. Here you can put a GET or POST and format it as you wish.

    Code:
    TBuf8<64> aRequest;
    aRequest.Copy(_L8("GET / HTTP/1.0\r\n\r\n"));
    iSocket.Write(aRequest, iStatus); // write the GET/POST request
    4. Read from the socket the data the server sends back.

    Code:
    iSocket.RecvOneOrMore(iResponseChunk, 0, iStatus, iResponseChunkSizePkg);
    I think that should be enough to get you started. I haven't done anything more complicated than fetching the google website right now.

    I've done this with S60 Feature Pack 2.

    Cheers!

  3. #3
    Registered User
    Join Date
    Mar 2007
    Posts
    15

    Re: problem in comminication with web server

    thanx for your kind reply,bestey!

    I've tried what you said. But, in my app, i need to post my customed message to the server (some thing like *.asmx on APS.NET), and i wonder how to achive this,, I have read HTTPExample in SDK, which i think will help, but the problem is I do not know what to do with the interface, i mean, the method for communicate with the server connected with database, i.e SQL 2000
    frankly , i am a newbie in such field . hope you could understand me and give some suggestion.
    any hints will help!

    thanks in advance!!!


    Guanwei

  4. #4
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    51

    Re: problem in comminication with web server

    Hi Atlantis,

    I believe in the section where I created a request string, ie.

    Code:
    aRequest.Copy(_L8("GET / HTTP/1.0\r\n\r\n"));
    you should be able to modify the GET request to pass data to your server, or to use a POST request. I haven't verified this, but that is what I would try.

    Let me know how it goes for you.

    Cheers!

Similar Threads

  1. client server connection problem
    By jeff4yee in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2006-09-28, 11:11
  2. problem on connection to my server
    By ceehira in forum Symbian
    Replies: 2
    Last Post: 2006-07-17, 14:34
  3. Problem in reconnection from client to server
    By Palermo4Ever in forum Bluetooth Technology
    Replies: 0
    Last Post: 2006-06-19, 16:27
  4. Problem socket server in my nokia phone ....
    By kajinka13 in forum Symbian
    Replies: 0
    Last Post: 2006-01-06, 17:59
  5. Nokia 3650 retrieve data from server problem
    By artjoy in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2004-02-10, 07:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×