View source | Discuss this page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Add page
Show collection (0 pages)
Collections help

Search

Modules:IDL Load Web Services

Overview

The import process of all available entities in the Initial Data Load module can be accessed as a REST Web Service. This document explains how to use these Web Services.

Web Service access

The import processes available as web services are only the step of the process that saves the data in the Openbravo ERP database. These web services are based on the Openbravo ERP REST framework.

If you have Openbravo ERP installed in the URL http://localhost/openbravo, the Web Service for each entity can be access in the URL http://localhost/openbravo/ws/org.openbravo.idl.process/Entity_Name. Where Entity_Name is the name of the entity you want to import.

The Web Service provides two methods for authentication:

The Web Service is accessed using the HTTP method POST and the rest of HTTP methods are not available. The fields required for the XML file of the content to send to the web service are in the Entities Definition document.

Note that all Web Services process do not include neither the validation step nor the default values replacement step.

Example

To test these web services a good tool is Poster, a Firefox add-on that allows to make HTTP requests and inspect the results.

For example to import one product, first we have to write the XML file with all field values of the product we want to import.

<?xml version="1.0" encoding="UTF-8"?>
<ob:Openbravo xmlns:ob="http://www.openbravo.com">
  <Product>
    <Organization>0</Organization>
    <SearchKey>pfga</SearchKey>
    <Name>Final good A</Name>
    <Description>Final good A for selling</Description>
    <UPCEAN>3344567</UPCEAN>
    <ProductCategory>Final goods</ProductCategory>
    <UOM>Kg</UOM>
    <ProductType>Item</ProductType>
    <Production>False</Production>
    <BillOfMaterial>False</BillOfMaterial>
    <Discontinued>False</Discontinued>
    <CostType>Average</CostType>
    <AttributeSet>Lots</AttributeSet>
    <AttributeValue>123</AttributeValue>
    <Stocked>True</Stocked>
    <Purchase>False</Purchase>
    <Sale>True</Sale>
    <TaxCategory>IVA 16%</TaxCategory>
    <StandardCost></StandardCost>
    <PriceSales>19.90</PriceSales>
    <PricePurchase></PricePurchase>
  </Product>
</ob:Openbravo>

Open the Poster dialog and fill in the required fields:

HTTP request definition

To load the product into Openbravo ERP just press the Post action and it the execution is successful, in the response you will get the product just loaded in Openbravo ERP.

HTTP response definition

Retrieved from "http://wiki.openbravo.com/wiki/Modules:IDL_Load_Web_Services"

This page has been accessed 1,202 times. This page was last modified on 22 October 2012, at 10:20. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.