I have a problem.
I am developing (and learning in a same time) website with online store.
For list of products, search and ordering of the books I am suppose to connect to a so called Book Centar, that consists from Server and Interface (port, gateway). I am suppose to develop an application/program that will use this port to connect to server with all the book data.
By the documentation of the book center, by offering Online Gateway they give a possibility to a developer to include all the services that Book Center offers, usage of book catalog, ordering through their system..
In order to use these services special commands(there is a list of commands with definitions) from this gateway are send over internet to Book center server. For the transport of the commands, HTTP protocols are used.
I would like to use this server only when showing list of books or when processing an order. I would like to keep copy of orders and data of customers in my database.
I've only used PHP together with MySQL and this is something that is easy to understand. But I really don't know what PHP functions to use to communicate with this online gateway of the server.
I really need a help , something like an example or suggestion that will help me start.
Here is an example in Java for using createSession command. Maybe that will give you better idea what I am talking about.
// Demo java application for creatSession API command.
// Please change the declaration for the logininfomation
import java.net.;
import java.io.;
public class SBZConnect {
public static void main(String[] args) throws Exception {
// declaring logininformation
String username = "username";
String password = "sbzonline";
// declaring the parameter delimiter
byte[] paramDelim = {3};
String paramDelimiter = new String(paramDelim);
// declaring the command delimiter
byte[] cmdDelim = {4};
String commandDelimiter = new String(cmdDelim);
// connect to sbz
URL sbzURL = new URL("http://sbzonline.sbz.ch/api/Execute.asp");
URLConnection sbzConnection = sbzURL.openConnection();
// enable the output stream for posting
sbzConnection.setDoOutput(true);
PrintWriter out = new PrintWriter(sbzConnection.getOutputStream());
// send the command
String cmd="createSession" + paramDelimiter + username + paramDelimiter + password;
out.print(cmd);
out.close();
// get input stream
BufferedReader in = new BufferedReader(new InputStreamReader(sbzConnection.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)System.out.println(inputLine);
in.close();
}
}
Thanks!
Jelena