Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 9 of 9

Thread: How to communicate to/from gateway to stand alone server?( Newbie,pls help)

  1. #1
    Junior Member
    Join Date
    Aug 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to communicate to/from gateway to stand alone server?( Newbie,pls help)

    Hi all,

    Im writing an app that will contact a specified gateway and retrieve info onto our server and perform manipulations on it then return the result back to the gateway for further operations...

    But I'm a newbie and dont have much of an experience in network programming...
    Would like to know what are the paramaters necessary to contact the gateway...(I've got permission to use a gateway from a certain provider.)

    Could anyone please help me...(This is the last bit in my project , that im not too familiar with)

    Regards


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: How to communicate to/from gateway to stand alone server?( Newbie,pls help)

    What exactly do you mean when you say gateway?

    What protocol is the server and the gateway using to talk to each other?

    // Json

  3. #3
    Junior Member
    Join Date
    Aug 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to communicate to/from gateway to stand alone server?( Newbie,pls help)

    The protocol is probably going to be HTTPS...
    We have a choice to choose between that and HTTP... working out the logistics as of now..
    But generally speaking can you give me pointers on how to hook onto the gateway?

    This is however the overview...
    The gateway will be pushing text to our server, we maintain a DB to do the manipulations on the incoming text.
    Process depending on our needs and then push the result back to the gateway which will then take it forward.

    I'll be using Java ...
    Last edited by wrapster; August 2nd, 2009 at 05:02 AM.

  4. #4
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: How to communicate to/from gateway to stand alone server?( Newbie,pls help)

    It would be fairly straight forward then I guess, the server needs to have a servlet which accepts requests and then just prints back an answer to the gateway. Think of it as the gateway is the web browser and the server is just a normal web server.

    You go to a url and you see a result. Thats what the gateway will need to do.

    // Json

  5. #5
    Junior Member
    Join Date
    Aug 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to communicate to/from gateway to stand alone server?( Newbie,pls help)

    So in that case, there is very little of network programming that I'll be doing in java is it (meaning no scripts like the client side /sever side are necessary?)
    can just use servlets to do the job?

  6. #6
    Junior Member
    Join Date
    Aug 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to communicate to/from gateway to stand alone server?( Newbie,pls help)urgent

    wanted to know this as well..

    The gateway that will send the data to us will be in the form of an url, this will be processed by our server(Which will act as a client since the gateway now acts as server).
    So should i be looking at writing a HTTP client app or servlets, because regular socket programming ,Im assuming will only be used for RAW TCP/IP packets..

    Could you shed some light on this ...Its pretty urgent.

  7. #7
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: How to communicate to/from gateway to stand alone server?( Newbie,pls help)

    Well basically, no matter which one is the client server it still works the same, you need to figure out from what machine in your system you want the request to come from (firewall issues etc). Once you've figured this out, this is how it works.

    I will call these client and server.

    The client sends an http request off.

    And then in the server you will have some code that gets the requestdata parameter and processes it using whatever internal logic you have.

    Then the server needs to print a response (a webpage basically) with whatever you want to send back, this could be an XML or just a simple text string.

    Woohoo, the request was processed successfully!
    The client then parses the response and does whatever it needs to do.

    DONE!

    Thats about it. Hope that helps

    // Json

  8. #8
    Junior Member
    Join Date
    Aug 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to communicate to/from gateway to stand alone server?( Newbie,pls help)

    Thanks,
    indeed the logic helped me to understand quite a bit.

  9. #9
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: How to communicate to/from gateway to stand alone server?( Newbie,pls help)

    We tend to use Apache HTTP components for a lot of this stuff at work.

    HttpComponents - HttpComponents Overview

    // Json

Similar Threads

  1. I'm a newbie
    By r12ki in forum Member Introductions
    Replies: 2
    Last Post: June 1st, 2009, 06:38 AM