Web services for idempiere as a client

736 views
Skip to first unread message

Nicolas Micoud

unread,
Jun 17, 2014, 10:16:02 AM6/17/14
to idem...@googlegroups.com
Hi,

We starting to study how we can implement web services in our idempiere instance.
Idempiere will be the client for another server.

All tutorials i have found explain how to configure idempiere for being a server.
eg: http://wiki.idempiere.org/en/Web_services , http://wiki.idempiere.org/en/NF1.0_Web_Services_Improvements

But is there something that explain how to configure idempiere as a client ; i think the term is "consume web service".

Thanks,

Nicolas

Alan Lescano

unread,
Jun 17, 2014, 10:24:16 AM6/17/14
to idem...@googlegroups.com
Hi Nicolas

You can use axis. Create a stub using wsdl2java if you have a wsdl of the ws. And it is easy to send a message and receive an xml response.

Alan


--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/6a2ebf09-f969-4eb3-8233-90f61fac355d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nicolas Micoud

unread,
Jun 17, 2014, 10:44:21 AM6/17/14
to idem...@googlegroups.com
Hi Alan,

Thanks for the tip.
Will explore it.

Regards,

Nicolas

Jan Thielemann

unread,
Jun 18, 2014, 9:50:52 AM6/18/14
to idem...@googlegroups.com
It can be even easier. You can use Eclipse. Just click File>New>Other>Web Sevice Client, enter the path to the webservice and let eclipse generate the needed classes for you. I did this with the webservice provided by idempiere for a quick test. for this reason i created a new webservice (queryData on AD_User). heres how a sample call could look like:

ModelCRUD modelCRUD = new ModelCRUD();
modelCRUD.setServiceType("ReadUser");
ADLoginRequest aDLoginRequest = new ADLoginRequest("WebService", "WebService", "192", 11, 50004, 11, 103, 0);
ModelCRUDRequest req = new ModelCRUDRequest(modelCRUD, aDLoginRequest);
try {
ModelADServiceProxy prox = new ModelADServiceProxy("http://bea:8080/ADInterface/services/ModelADService");
WindowTabData data = prox.queryData(req);
System.out.println("Found " + data.getNumRows() + " rows");
DataField[][] fields = data.getDataSet();
for (int i = 0; i < fields.length; i++) {
for (int ii = 0; ii < fields[i].length; ii++) {
DataField field = fields[i][ii];
System.out.println(field.getColumn() + "=" + field.getVal());
}
}
} catch (Exception e) {}
Reply all
Reply to author
Forward
0 new messages