iDempiere web services get installed out of the box. There is no additional installation effort required.
ADempiere - I recommend you purchase the ADempiere Cookbook for more details about installing web services in ADempiere.
Even though iDempiere does not require that you 'install' web services, you do need to configure them. Here is a Pack In for the Web Services Security window. This pack in will give you all the records you need for the below examples. To use this file, go to your client's Pack In window (not System Admin), create a new record, attach the above zip file, and click the button.
If for some reason you get errors while executing any of the below samples, make sure the Web Services Execution role has access to both the Web Service Type record (see Web Services Security window) and the Report & Process (see Role window). Please note that Report & Process is needed if you are executing a process.
Concepts
iDempiere Web Services help other applications communicate with iDempiere. They enable external applications like web stores and point of sale systems (POS) to create, read, update and delete data without human intervention. The actions can be simple like getting the ID for a given Business Partner, or the actions can be complex like creating and completing a multi-line order.
SoapUI
SoapUI is an open-source web service testing application. It makes creating your first web service call very easy. Here are the Linux commands to install SoapUI:
The below sample web service calls on iDempiere's Auto Allocate process. This example assumes you have packed in the above Web Service Security zip file into your client. Doing so creates the "AutoAllocate" Web Service Type record in iDempiere. The below request will perform AR allocation for the GardenWorld "Joe Block" Business Partner.
This post demonstrates how your can run a report and get the report file via the response.
iDempiere Composite Web Services
Note: the below example was created by Deepak Pansheriya. He was also the lead developer in creating the composite interface. Special thanks goes to Deepak and his team. Without him, the world would be a much darker place.
The iDempiere web service composite interface allows you to make multiple iDempiere calls in the same message. Before the composite interface was available, the following bullets were the typical web service flow to create an order:
Call to look up Business Partner ID based on name or email
Call to update/create Business Partner if it does not exist.
Call to look up Business Partner Location ID based on criteria
Call to update/create Location if it does not exist.
Call to look up User ID based on criteria
Call to update/create User if it does not exist.
Call to look up product ID for every product that will go into an order.
Call to create the order header
Call to create each of the order lines
As you can see, this technique is verbose and cumbersome. It requires you to write much process logic.
With composite web services, you can create a single message to perform all the above steps. Here is a sample composite request - copy the contents of this file into a SoapUI request and execute it. Make sure processed the Pack In located at the top of this page.
There are times when you need to call a someone else's web service from within iDempiere. Turning a WSDL into usable java classes is pretty easy. Use Eclipse: File=>New=>Other=>Web Sevice Client. Enter the webservice URL and eclipse will generate classes for you.
Example from Jan
Below is a code example for communicating with iDempiere's web services - writing in Eclipse - provided by Evan:
Package org.idempiere.ADInterface._1_0;
public class EvansCallWebservice
{
public static void main(String[] args)
{
System.out.println("Hello Webservice");
ModelCRUD modelCRUD = new ModelCRUD();
modelCRUD.setServiceType("CreateBPartner");
modelCRUD.setTableName("C_BPartner");
ModelCRUDAction action = new ModelCRUDAction("Create");
modelCRUD.setAction(action);
ADLoginRequest aDLoginRequest = new ADLoginRequest("WebService", "WebService", "192", 11, 50004, 11, 103, 0);
ModelCRUDRequest req = new ModelCRUDRequest(modelCRUD, aDLoginRequest);
try
{
ModelADServiceProxy prox =
new ModelADServiceProxy("http://erpdev.suthbros.co.uk:8080/ADInterface/services/ModelADService");
prox.createData(req);
StandardResponse sResponse = prox.createData(req);
} catch (Exception e) {}
}
}
2014-06-24 AM Introduction to Web Services Discussion
Please read the below NOTE to understand I found an issue during the video that was later resolved after the video.
Introduction
0:01:15 iDempiere Web Services list page - including WSDL
0:06:00 ADempiere Web Services installation
0:09:15 Using SoupUI to make our first web service call
0:15:15 Review first SOAP envelope/message
0:16:15 Review SOAP composite envelope/message
0:19:00 Create new SOAP Project
0:20:45 Make first SoapUI call
0:22:30 Review iDempiere's Web Service Security settings to receive the SOAP call
0:26:15 Using SoapUI to make a Composite SOAP call
Using a Web Service Security pack in to give you all the needed Web Service Security records
0:30:15 Resolve issue relating to not having packed in Web Service Security records
0:31:45 Pack in Web Service Security records
0:32:30 Execute the composite interface successfully
0:34:00 Running this call multiple times - difference between Create and CreateUpdate calls
NOTE: the reason the call failed is because the Web Service Security record for "CreateBPartner" => Web Service Parameters subtab had the action hard coded to "Complete". When I removed this setting (after the video), the system behaved as expected. (see post)
0:37:00 Ability to use Column SQL to find a key
Starting at 44:30, you do not need to make this change. The above note resolves the issue.
Calling iDempiere Web Services from Talend ETL
Here is a Talend project that shows you examples of the above concepts. Download the file, import it as a project into Talend, and play with the examples. Please note these examples depend on the above Web Service Security pack in.
2014-06-06 AM Using Talend to call iDempiere Web Service Run Process Discussion
Introduction - options for generating SOAP messages
0:03:30 String manipulation example discussion
0:06:00 Start the discussion about calling iDempiere from Talend (via web service)