2. 1. Magento
1.1 Install Xampp
1.2 Install Magento
1.3 Magento Role & User
1.4 Guide to create product in Magento
1.5 Guide to design Homepage in Magento
1.6 Magento API
5. 1.1 Install Xampp
• Link: http://www.apachefriends.org/en/xampp.html
• When install Xampp:
• Control Panel – Change User Account Control Settings
6. 1.1 Install Xampp:
• Can’t Start Apache because duplicated port
• Error: Apache shutdown unexpectedly.
• 11:38:51 PM [Apache] This may be due to a blocked port, missing dependencies,
• 11:38:51 PM [Apache] improper privileges, a crash, or a shutdown by another method.
• 11:38:51 PM [Apache] Check the "/xampp/apache/logs/error.log" file
• 11:38:51 PM [Apache] and the Windows Event Viewer for more clues
• Config – service and port settings – change
main port & ssl port
• Reference: http://www.zend.vn/public/lap-
trinh/php-mysql/webserver-huong-dan-cai-dat-
va-su-dung-xampp/l1l4l56.html
8. 1.2 Instal Magento
• Note: Back end và Cookie
– Firefox:
• Localhost: work
• 127.0.0.1: no work
– Google Chrome, Internet Explorer, Opera:
• Localhost: no work
• 127.0.0.1: work
9. 1.3 Magento role & user
• Add Role:
1. Go to System > Web Services.
a. Magento Community: Select SOAP/XML-RPC-Roles
b. Magento Go: Select Roles
2. Click to add a new role.
3. Give your Role a name, such as “Brightpearl API”.
4. Select the Role Resources menu on the left panel to set
the Role permissions.
5. Select “All” in the Resources Access field, this will allow
your Brightpearl account to send and receive all the
information it needs to.
6. Save the Role.
10. 1.3 Magento role & user
• Add a User:
1. Go to System Web Services.
a. Magento Community: Select SOAP/XML-RPC-Users
b. Magento Go: Select Users
2. Click to add a new user.
3. Enter a user name, such as “brightpearl”; whatever it is keep a note of it, you’ll
need to enter it into the Brightpearl setup.
4. Enter a first and last name, your name, or a made up name, it doesn’t matter.
5. Enter an email address; you can use your own email address if you want.
6. Make up a new API key; make sure you keep a note of this as you’ll need to
enter it into the Brightpearl setup.
7. Confirm the API key.
8. Select the User Role menu from the left hand panel.
9. Select the Role you added above.
10. Save the user.
11. 1.4 Guide to create product in Magento:
View in demo
1.5 Guide to design Homepage in Magento:
View in demo
12. 1.6 Magento API
• Support 2 types:
– SOAP
– XML-RPC
• In case:
– SOAP: http://magentohost/api/soap/?wsdl
– XML-RPC: http://magentohost/api/xmlrpc/
• Reference:
http://www.magentocommerce.com/api/soap/int
roduction.html#Introduction-XMLRPC
13. 1.6 Magento API
• API Methods
Method Description Return Value
startSession() Start the API session and return session ID. string
endSession(sessionId) End the API session. boolean
login(apiUser, apiKey) Start the API session, return the session ID, and authorize the API
user.
string
call(sessionId, resourcePath,array
arguments)
Call the API resource that is allowed in the current session. See
Note below.
mixed
multiCall(sessionId, array calls,array
options)
Call the API resource’s methods that are allowed for current
session. See Notes below.
array
resources(sessionId) Return a list of available API resources and methods allowed for
the current session.
array
globalFaults(sessionId) Return a list of fault messages and their codes that do not depend
on any resource.
array
resourceFaults(sessionId, resourceName) Return a list of the specified resource fault messages, if this
resource is allowed in the current session.
array
14. 2.1 Web service
Web services are a set of tools that let you build
distributed applications on top of existing web
infrastructures. These applications use the Web
as a kind of"transport layer" but don't offer a
direct human interface via the browser. Reusing
web infrastructures can drasticallylower the cost
of setting up these applications and allows you
to reuse all kinds of tools originally built for the
Web
15. 2.1 What is xml-rpc protocol
• XML-RPC is among the simplest (and most foolproof) web service approaches, and
makes it easyfor computers to call procedures on other computers. XML-RPC reuses
infrastructure that was originally created for communications between humans to
support communications between programs on computers. Extensible Markup
Language (XML) provides a vocabulary for describing Remote Procedure Calls
(RPC), which are then transmitted between computers using the HyperText Transfer
Protocol (HTTP).
• XML-RPC can simplify development tremendously and make it far easier for different
types of computers to communicate. By focusing on computer-to-computer
communications, XML-RPC lets you use web technologies without getting trapped in
the focus on human-readable content that has characterized most previous web
development. Most of the XML-RPC framework will be familiar to web developers, but
as a web developer, you will probably use off-the-shelf packages to connect your
programs.
16. 2.1 Activity of xml-rpc
• At the most basic level, XML-RPC lets you make function calls across networks. XML-RPC
isn't doing anything especially new, and that largely explains why XML-RPC is useful. By
combining an RPC architecture with XML and HTTP technology, XML-RPC makes it easy to
for computers to shareresources over a network. This means that you can give users direct
access to the information they need to process, not just read and reuse systems you've
already built in new contexts, or mix and match programs so that each can focus on what
it does best.
• Remote ProcedureCalls (RPC) are a much older technology than the Web. Although the
concept of computers calling functions on other systems across a network has been around
as long as networks have existed, Sun Micro systems is usually given credit for creating a
generic formal mechanism used to call procedures and return results over a network.