Thread: Webservice

Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    2
    Rep Power
    0
    why don't you try to create an web service on your source web and provide the data as json/xml and catch it from your destionation file ..

    contains:
    {data1,data2,..etc}

    than you can get that url to from your server1

    * i can't create json url because i'm still a newbie
  2. #17
  3. No Profile Picture
    Dazed&Confused
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2002
    Location
    Tempe, AZ
    Posts
    506
    Rep Power
    128
    Originally Posted by Sarath_PHP
    Thanks for your reply.

    How should connect different database using php. Because database are hosted in different server.



    My purpose is, with the help of web service, collect products details from www.server2.com and display or store in to www.server1.com.
    You'd just put that server's IP or hostname in your MySQL connection code. php.net should provide you whatever you need to know to do that.

    The only other side would be that the database might limit where you can connect from, so that'd have to be opened up to allow your remote connection.
    LinkedIn: Dave Mittner
  4. #18
  5. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1045
    Originally Posted by Sarath_PHP
    My purpose is, with the help of web service, collect products details from www.server2.com and display or store in to www.server1.com.
    You can stop repeating that sentence. We're not stupid.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  6. #19
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Location
    Jakarta, Indonesia.
    Posts
    192
    Rep Power
    31
    I don't know what webservice is, but this sounds like a CRON job to me. The scheme might look like the following:

    The CRON setup on server#1 routinely triggers a request every couple of days to server#2. Your server#2 will then respond to it by reading all 500 records (this should be easier if all are in one DB table), converting them into XML format and send it to server#1. Based on this XML received, your server#1 will then update its own DB.

    There also should be an authentication between the 2 scripts, to make this scheme private and highly secure.
  8. #20
  9. Web Developer/Musician
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Nov 2004
    Location
    Tennessee Mountains
    Posts
    2,408
    Rep Power
    1031
    If you want to transfer a large number of records do it manually using as mentioned a tool like PHPMyAdmin or Bigdump. However, if there is a need for those two servers to continue to syncronize, then a web service coupled with a cron or the act of adding a product on one server triggering a send to the other should be set up. You don't really want a web service sending more than a few data records at a time, but doing just a few at a time to keep the two servers in sync is a good use of a web service.
  10. #21
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala
    Posts
    72
    Rep Power
    2
    Originally Posted by dmittner
    You'd just put that server's IP or hostname in your MySQL connection code. php.net should provide you whatever you need to know to do that.

    The only other side would be that the database might limit where you can connect from, so that'd have to be opened up to allow your remote connection.

    Thanks.
  12. #22
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala
    Posts
    72
    Rep Power
    2
    Originally Posted by hdewantara
    I don't know what webservice is, but this sounds like a CRON job to me. The scheme might look like the following:

    The CRON setup on server#1 routinely triggers a request every couple of days to server#2. Your server#2 will then respond to it by reading all 500 records (this should be easier if all are in one DB table), converting them into XML format and send it to server#1. Based on this XML received, your server#1 will then update its own DB.

    There also should be an authentication between the 2 scripts, to make this scheme private and highly secure.


    Thanks
  14. #23
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala
    Posts
    72
    Rep Power
    2
    Originally Posted by Hammer65
    If you want to transfer a large number of records do it manually using as mentioned a tool like PHPMyAdmin or Bigdump. However, if there is a need for those two servers to continue to syncronize, then a web service coupled with a cron or the act of adding a product on one server triggering a send to the other should be set up. You don't really want a web service sending more than a few data records at a time, but doing just a few at a time to keep the two servers in sync is a good use of a web service.


    Thanks
  16. #24
  17. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,846
    Rep Power
    6351
    Since these threads had the same title, same OP, and roughly the same question, I've merged them.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo