Difference between revisions of "Integration/REST"
Jump to navigation
Jump to search
old>Admin |
old>Admin |
||
Line 17: | Line 17: | ||
==== Sample code for list view ==== | ==== Sample code for list view ==== | ||
//Create session | |||
FirmabilerClient session = new FirmabilerClient(); | FirmabilerClient session = new FirmabilerClient(); | ||
//Login and set search parameters | |||
FirmabilerList result = session.getList(FirmabilerList.class, "admin", "password1223", "TITEL=Kasper" ); | FirmabilerList result = session.getList(FirmabilerList.class, "admin", "password1223", "TITEL=Kasper" ); | ||
//Retrieve data and print | |||
List <FirmabilerListItem> list = result.getFirmabilerListItem(); | List <FirmabilerListItem> list = result.getFirmabilerListItem(); | ||
for(int i=0; i<list.size(); i++) { | for(int i=0; i<list.size(); i++) { | ||
//Handle single item | |||
FirmabilerListItem item = list.get(i); | FirmabilerListItem item = list.get(i); | ||
System.out.println( item.getDataID() + "\t" + item.getNUMMERPLADE() ); | System.out.println( item.getDataID() + "\t" + item.getNUMMERPLADE() ); | ||
} | } | ||
//Close connection | |||
session.close(); | session.close(); |
Revision as of 13:50, 29 November 2013
This article has not yet been converted to Wiki format.
Please download the original article: Tempus Serva REST interface.pdf
Netbeans quick start guide
Steps to create a simple interaction
- Add Webservice to ide (wadl import)
- URL: [ServerName]/[ApplicationName]/rest/[SolutionSystemName].wadl
- Create a new project
- Add REST Client to project
- Point to newly created webservice: [SolutionSystemName]
- Add JAXB bindings to project (use XSD schema)
- URL: [ServerName]/[ApplicationName]/rest/[SolutionSystemName].xsd
- Add REST Client to project
Sample code for list view
//Create session FirmabilerClient session = new FirmabilerClient();
//Login and set search parameters FirmabilerList result = session.getList(FirmabilerList.class, "admin", "password1223", "TITEL=Kasper" );
//Retrieve data and print List <FirmabilerListItem> list = result.getFirmabilerListItem(); for(int i=0; i<list.size(); i++) { //Handle single item FirmabilerListItem item = list.get(i); System.out.println( item.getDataID() + "\t" + item.getNUMMERPLADE() ); }
//Close connection session.close();