Jump to content

Interact ASP.NET with Prestashop


Recommended Posts

Hi there,

 

We are using two sites one is Prestashop and another one is an ASP.NET based site. Now we want to communicate Prestashop from ASP.NET site to add customers, products, list products and much more, We found a solution that Prestashop have inbuilt Webservices. We are currently host the prestashop in IIS7. Now we need to configure the webservice in prestashop to communicate with ASP.NET site. Can anyone tell me the procedure to setup webservice of prestashop in IIS7? Thanks in advance...

 

We are using,

Prestashop 1.4.1 version

IIS 7.0 in windows server 2008

ASP.NET 2.0 Framework

Link to comment
Share on other sites

Never used IIS, but I guess webservice stuff is pretty generic thing across all webservers, be it apache or ngnix. I'd recommend you to go through microsoft site to see how you configure a particular apache configuration on IIS. You need to understand how webservices work on apache and find equivalent configuration on IIS. Or, why not have prestashop run on apache?

Link to comment
Share on other sites

You need to enable webservices from the back office in the Tools | Webservice section. You should probably read through the usage guides in the resource menu to understand how to configure them.

http://doc.prestashop.com/display/PS14/Using+the+REST+webservice

 

Prestashop uses REST, you can read more about them here

http://www.anterp.com/blog/?p=428

 

Basically, you will need to implement a REST interface from your ASP.net application

Link to comment
Share on other sites

First of all thanks to suenda and bellini13 for reply. Now i configured the webservice of prestashop in IIS7. I've followed the steps to do this.

  1. In prestashop administration, goto tools -> webservice.
  2. In this page Under Configuration -> Enable <Your Store> Webservice to Yes, Click Save.
  3. Prestashop webservice can restricted access to end user, For this you need to create access key.
  4. To create an access key, In tools -> webservice page, Click Add new button under Breadcrumb.
  5. In the new key page, Click Generate to Generate new key. Then choose the options to be enabled for the new key. Then click save.
  6. You can edit the key permissions anytime after this.
  7. Now you can access the webservice by http://<Access_Key>@yourshop.com/webservice/dispatcher.php?url=<methods>, or http://<Access_Key>@yourcompany.com/yourshop/webservice/dispatcher.php?url=<method>. Here the first url says you hosted the prestasop in your own domain, and the second url says you hosted the prestashop in a virtual directory of your domain. Here the <Access_Key> means the key generated in tools -> webservice page, and <methods> means the prestashop CRUD methods.

 

If you need to access the webservices by simple readable urls then, you can use URL rewrite methods. Then you need to setup IIS7.

  1. In IIS 7, Go to Default Website. In Right side panel make sure the URL rewrite available.
  2. If URL rewrite is not available in right side panel. Download URL Rewrite Module from Here and install it. After installation close and open the IIS Application. Now you can see URL rewrite when choose a website.
  3. Choose your website or virtual directory in left side tree view.
  4. Then Double Click on URL Rewrite in right side pane.
  5. Now you see URL Rewrite Interface.
  6. In Right side panel you can see a link under Inbound Rules named "Import Rules...".
  7. Click on Import Rules... link, This opens a import wizard.
  8. Download the attached .htaccess file
  9. Open downloaded .htaccess file and make changes as you wish.
  10. Copy all the content inside the modified .htacess file, and paste it into Rewrite Rules Under "Rules to Import" section.
  11. Now you can see the formatted rules under the converted rules section.
  12. Then Click Apply link in right side links pane. To apply the rewrite rules.
  13. Now you can access the webserives like http://<Access_Key>.yourstore.com/api/<Mehtods>, or http://<Access_Key>.yoursite.com/yourstore/api/<Methods>.

Thanks once again to suenda and bellini13.

sample.htaccess.txt

  • Like 1
Link to comment
Share on other sites

  • 4 months later...
  • 3 years later...

First of all thanks to suenda and bellini13 for reply. Now i configured the webservice of prestashop in IIS7. I've followed the steps to do this.

  • In prestashop administration, goto tools -> webservice.
  • In this page Under Configuration -> Enable <Your Store> Webservice to Yes, Click Save.
  • Prestashop webservice can restricted access to end user, For this you need to create access key.
  • To create an access key, In tools -> webservice page, Click Add new button under Breadcrumb.
  • In the new key page, Click Generate to Generate new key. Then choose the options to be enabled for the new key. Then click save.
  • You can edit the key permissions anytime after this.
  • prestashop CRUD methods.

If you need to access the webservices by simple readable urls then, you can use URL rewrite methods. Then you need to setup IIS7.

  • In IIS 7, Go to Default Website. In Right side panel make sure the URL rewrite available.
  • If URL rewrite is not available in right side panel. Download URL Rewrite Module from Here and install it. After installation close and open the IIS Application. Now you can see URL rewrite when choose a website.
  • Choose your website or virtual directory in left side tree view.
  • Then Double Click on URL Rewrite in right side pane.
  • Now you see URL Rewrite Interface.
  • In Right side panel you can see a link under Inbound Rules named "Import Rules...".
  • Click on Import Rules... link, This opens a import wizard.
  • Download the attached .htaccess file
  • Open downloaded .htaccess file and make changes as you wish.
  • Copy all the content inside the modified .htacess file, and paste it into Rewrite Rules Under "Rules to Import" section.
  • Now you can see the formatted rules under the converted rules section.
  • Then Click Apply link in right side links pane. To apply the rewrite rules.
Thanks once again to suenda and bellini13.

 

 

Very good explaination! It must be in docs... Thanks for your time man! 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...