Search the Community
Showing results for tags '.net'.
-
Hello, I'm a .net Developer , as well as a Prestashop owner, I have already made a program to do everything i need in C# and Automate all my work, The only part which is not automated yet is that i have to manually check site for Order Details and Status and give it to my C# Application. So i have 2 approach in my mind , but I want advice on which is better or is there any better way other than this two ? So my first idea is, I can set some timer or something on my app and use prestashop's webservice and check for the new Orders, when app hit a new Successful Purchase, it would then take the info and proceed to do the rest of the works. and my 2nd idea , well it came from the Telegram Bot I made last months for my site . just like how it sent new updates through a Json string from a link, I could do the same and make a secret url that show empty results {"ok":true,"result":[]} until there is a new successful purchase which would show up with the details in the result section , and my App would then proceed to do the works and send back a POST to my link to remove the result back to empty [ ]. So which one of these methods is best or is there any better idea ? also is there a way to make a call to the application only when we got a new Successful purchase ? btw, my knowledge of php is not advanced, my best ever creation yet in php, was a custom payment method modules for prestashop. but I'm good at C#. Thanks.
-
Hi all, I'm working on a .NET application I need to update Prestashop via web service. Well I'm able to set product fields I need to manage. Now I need to set categories to each product. My trouble is I cannot understand in which way I can manage categories. Could you give me an example about it? In which way I can set categories to product via web service? thanks in advance to everybody! Dario
-
Hi all, I need to upload product images via XML web service. I've tried with some examples I found in internet but I have errors. Could you give me a working example about loading product images via web service and XML file? I know I have to write a xml file with image converted in byte array.. but I don't know how to make it works. Thanks in advance to everybody!
-
Hi all, I'm newbie in Prestashop integration, I'm looking how to get the reference in .NET. I've tried with add web reference, add service reference and I get the same result. a password request window appears .. I write the key.. I press ok... this happens 3 times. after that a BAD REQUEST MESSAGE is shown. if I use the same url via browser, it asks me the key.. i write it... and then I get the list where am I mistaking? Could you help me about that? I just need to get the reference to understand the webservice objects. I use this reference URL http://mykey@my shop.com/api/ Thanks in Advance for any informations about that Dario
-
Right now, I am implementing mobile application that read products and catalogs from Prestashop webservices. The next step, we need client to add product to cart and do checkout process inside our mobile application. Is it possible to integrate module or api service that allows us to order product inside our application? Constraint: - Use .net as backend to get data from Prestashop
-
Hi, I am developping a Windows service Application in C#.NET that gets and updates informations from prestashop. I can get all the informations but I have a problem when i try to update orders. the error is the error 405. the peace of code is the folowing : var response = Fonctions.GetXML(Url + "orders/950", Key); string xms = response.ToString(); byte[] byteArray = Encoding.UTF8.GetBytes(xms); WebRequest Req1 = WebRequest.Create(Url + "orders/950" ); Req1.Method = "PUT"; Req1.Credentials = new NetworkCredential(Key, ""); Req1.ContentLength = byteArray.Length; Stream postStream = null; postStream = Req1.GetRequestStream(); postStream.Write(byteArray, 0, byteArray.Length); postStream.Close(); HttpWebResponse Resp1 = (HttpWebResponse)Req1.GetResponse(); The xml is the folowing: <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <order> <id><![CDATA[950]]></id> <id_address_delivery xlink:href="http://localhost/api/addresses/675"><![CDATA[675]]></id_address_delivery> <id_address_invoice xlink:href="http://localhost/api/addresses/675"><![CDATA[675]]></id_address_invoice> <id_cart xlink:href="http://localhost/api/carts/3911"><![CDATA[3911]]></id_cart> <id_currency xlink:href="http://localhost/api/currencies/1"><![CDATA[1]]></id_currency> <id_lang xlink:href="http://localhost/api/languages/1"><![CDATA[1]]></id_lang> <id_customer xlink:href="http://localhost/api/customers/677"><![CDATA[677]]></id_customer> <id_carrier xlink:href="http://localhost/api/carriers/103"><![CDATA[103]]></id_carrier> <current_state xlink:href="http://localhost/api/order_states/3"><![CDATA[3]]></current_state> <module><![CDATA[atos]]></module> <invoice_number><![CDATA[777]]></invoice_number> <invoice_date><![CDATA[2014-06-04 17:32:05]]></invoice_date> <delivery_number><![CDATA[0]]></delivery_number> <delivery_date><![CDATA[0000-00-00 00:00:00]]></delivery_date> <valid><![CDATA[1]]></valid> <id_shop_group><![CDATA[1]]></id_shop_group> <id_shop><![CDATA[1]]></id_shop> <payment><![CDATA[Atos]]></payment> <recyclable><![CDATA[0]]></recyclable> <gift><![CDATA[0]]></gift> <gift_message></gift_message> <mobile_theme><![CDATA[0]]></mobile_theme> <total_discounts><![CDATA[0.00]]></total_discounts> <total_discounts_tax_incl><![CDATA[0.00]]></total_discounts_tax_incl> <total_discounts_tax_excl><![CDATA[0.00]]></total_discounts_tax_excl> <total_paid><![CDATA[21.50]]></total_paid> <total_paid_tax_incl><![CDATA[21.50]]></total_paid_tax_incl> <total_paid_tax_excl><![CDATA[19.00]]></total_paid_tax_excl> <total_paid_real><![CDATA[21.50]]></total_paid_real> <total_products><![CDATA[12.50]]></total_products> <total_products_wt><![CDATA[15.00]]></total_products_wt> <total_shipping><![CDATA[6.50]]></total_shipping> <total_shipping_tax_incl><![CDATA[6.50]]></total_shipping_tax_incl> <total_shipping_tax_excl><![CDATA[6.50]]></total_shipping_tax_excl> <carrier_tax_rate><![CDATA[0.000]]></carrier_tax_rate> <total_wrapping><![CDATA[0.00]]></total_wrapping> <total_wrapping_tax_incl><![CDATA[0.00]]></total_wrapping_tax_incl> <total_wrapping_tax_excl><![CDATA[0.00]]></total_wrapping_tax_excl> <shipping_number></shipping_number> <conversion_rate><![CDATA[1.000000]]></conversion_rate> <reference><![CDATA[HODHRCVLD]]></reference> <associations> <order_rows virtual_entity="true" node_type="order_row"> <order_row> <id><![CDATA[1719]]></id> <product_id><![CDATA[36]]></product_id> <product_attribute_id><![CDATA[54]]></product_attribute_id> <product_quantity><![CDATA[1]]></product_quantity> <product_name><![CDATA[Product Name]]></product_name> <product_price><![CDATA[12.500000]]></product_price> <unit_price_tax_incl><![CDATA[15.000000]]></unit_price_tax_incl> <unit_price_tax_excl><![CDATA[12.500000]]></unit_price_tax_excl> </order_row> </order_rows> </associations> </order> </prestashop> Can you help me? Sorry my english. I am using Prestashop 1.5.6.2
- 1 reply
-
- Webservice
- put
- (and 6 more)
-
Hi, I'm try to connect to the Prestashop wb service using C#, I'm doing click on the folder reference of the project and then clik on add web reference then wizard ask me web service Url, in my case is "localhost/prestashop/api", and i have tried whit that "localhost/prestashop/api/customers", "localhost/prestashop/api/customers/1". But the buttom add references it's disable and i can't add web service reference. Please helpeme may be the Url it's wrong.
-
Hello, we are developing an integration solution fo a customer, a backend module to synch with prestashop, I have problems consuming post request to create and update products. Retrieving is just fine, but I'm unable to create or update, I'm using the same xml arriving from the product "get" request, modifying just the name and resending back as a post but I receive "BAd request" 400 errors, this is my code, do you have any advices? target is something like "products/2" for an update or "products" for a create I've seen that I get lots of CDATAs when retrieving a product, I've tried both sending xml with and without CDATA without any success.. doc.Outerxml should be exactly the xml I'm getting from a get request without id in case of create or with just a changed name in case of update. (I get that with a string = doc.LoadXml(responsePayload)) Thanks! public string psPost(string target, XmlDocument doc) { Uri address = new Uri(baseurl + target); HttpWebRequest request = null; NetworkCredential cred = new NetworkCredential(credential, ""); // Create the web request request = WebRequest.Create(address) as HttpWebRequest; // Set type to POST request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; request.Credentials = new NetworkCredential(credential,""); // Create the data we want to send. string context = doc.OuterXml; StringBuilder data = new StringBuilder(); data.Append("xml=" + context); // Create a byte array of the data we want to send byte[] byteData = UTF8Encoding.UTF8.GetBytes(data.ToString()); // Set the content length in the request headers request.ContentLength = byteData.Length; // Write data Stream postStream = request.GetRequestStream(); postStream.Write(byteData, 0, byteData.Length); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream responseStream = response.GetResponseStream(); // Open the stream using a StreamReader for easy access. StreamReader reader = new StreamReader (responseStream); // Read the content. return reader.ReadToEnd (); }
- 2 replies
-
- rest
- webservices
-
(and 3 more)
Tagged with:
-
Hola, Estoy tratando de consumir el web service de prestashop 1.5.2 con C#, pero no consigo hacerlo, lo que estoy haciendo es: Clik derecho sobre la carpeta referencias que esta en mi proyecto de C# Despues clik sobre el agregar referencia web Despues el asistente pide la url del web service que en mi caso es "Localhost/prestashop/api" tambien he probado con "Localhost/prestashop/api/customers", "Localhost/prestashop/api/customers/1". Y las tres URLs me arrojan resultados (xml), pero no se me habilita el boton de agregar referencia para comenzar a uzarlo. Alguien me podria ayudar, o es otro metodo el que tengo que hacer para conectarme con C#. Gracias!
-
Hola a todos, soy nuevo como usuario de Prestashop y escribo este post para ver si alguien que me pueda echar una mano: Mi pregunta es la siguiente: Creeis que es posible atacar la base de datos de prestashop en un servidor remoto desde una máquina cliente utilizando los webservices? Me explico: Mi objetivo es desarrollar una aplicación para gestionar productos y demás desde un ordenador cliente de forma automatizada. Éste debería modificar, eliminar y/o añadir datos a la base de datos de un Prestashop (en un servidor). El programa estará desarrollado en .NET y no estoy seguro que desde una aplicación .NET pueda utilizar los webservices de Prestashop. ¿Alguna idea? ¿Alguien sabe algo al respeto? Gracias de antemano.
- 2 replies
-
- web service
- web services
-
(and 2 more)
Tagged with:
-
Dear Developer, We are looking for expert in PHP programming, who has very good knowledge in prestashop and webservice. (prestashop version 1.4.4.1) The Job is to integrate prestashop website with one of our logistic partners system / application, If the developer have chinese knowledge it's a plus, otherwise it's not a problem we have translator who can assist you each step. In short: Shop is generating the XML : [email protected]/api (copy and paste it on the browser) Need to get a return from this url http://service.gqsscm.com/BYKL_TEST/GQSService.asmx Thanks Vetri
-
- webservice
- module development
- (and 6 more)
-
Bonsoir à tous, Je voudrais interagir avec une application vb.net, mais j'ai un problème lors de l'écriture (POST). Prestashop (en version 1.4.4.1) me renvoie vers une erreur "The remote server returned an error: (500) Internal Server Error." alors que lors que je passe en GET j'arrive parfaitement à interagir avec. Je travail actuellement en local, j'ai soupçonné le serveur WAMP, j'ai donc essayé avec le même programme de dialoguer avec une autre page, et les variables en post fonctionnent parfaitement. J'ai bien sûr autorisé dans mon Prestashop la possibilité d'effectuer des requêtes POST. Voici la fonction qui me permet les requêtes POST en .net : Public Function Post_request(ByVal url As String, ByVal data As String, Optional ByVal cookies As String = "", Optional ByVal proxy As String = Nothing, Optional ByVal proxyport As Integer = Nothing, Optional ByVal timeout As Integer = 30000, Optional ByVal login As String = "", Optional ByVal pass As String = "") As String Dim reader As IO.StreamReader Dim writer As IO.StreamWriter Dim res As String = "" Try Dim hwebrequest As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(url) ' on crée la requete web à partir de l'url If proxy <> "" Then Dim hproxy As WebProxy hproxy = New WebProxy(proxy, proxyport) WebRequest.DefaultWebProxy = hproxy End If If login <> "" Then Dim hcredential As New System.Net.NetworkCredential(login, pass) hwebrequest.Credentials = hcredential End If If cookies <> "" Then hwebrequest.CookieContainer = New CookieContainer hwebrequest.CookieContainer.SetCookies(New Uri(url.Substring(0, url.IndexOf("/", 8))), cookies) End If hwebrequest.Method = "POST" 'on defini la methode à utiliser hwebrequest.ContentType = "application/x-www-form-urlencoded" 'on defini le type de contenu de la requete hwebrequest.ContentLength = data.Length 'on defini la taille des données à envoyé writer = New IO.StreamWriter(hwebrequest.GetRequestStream) 'on crée un objet streamwriter qui va nous permettre d'envoyer nos données writer.Write(data) 'on ecrit les données writer.Close() 'on ferme l'objet streamwriter Dim hwebresponse As System.Net.HttpWebResponse = hwebrequest.GetResponse 'on crée un objet de reponse a notre requete reader = New IO.StreamReader(hwebresponse.GetResponseStream) 'on redefini notre streamreader avec la reponse à la requete en argument res = reader.ReadToEnd() 'on renvoie l'ensemble du resultat reader.Close() 'on ferme l'objet Return res Catch ex As Exception Return ex.Message.ToString End Try End Function Et voici l'appel : Post_request("http://127.0.0.1/prestashop/api/zones/", "name=zonetest", "", Nothing, 0, 30000, "VAXXXBBQAA778TAY79BD1HG5UZM4EK5W", "") Merci d'avance