Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void sendGetInvoice() {
- final String url = "http://10.3.50.48:8069",
- db = "KassaGroepC",
- username ="ricardo.mayorga.mera@student.ehb.be",
- password = "opiq188";
- final XmlRpcClient client = new XmlRpcClient();
- final XmlRpcClientConfigImpl common_config = new XmlRpcClientConfigImpl();
- common_config.setServerURL(
- new URL(String.format("%s/xmlrpc/2/common", url)));
- int uid = (int) client.execute(common_config,"authenticate",Arrays.asList(db,username, password, Collections.emptyMap()));
- final XmlRpcClient models = new XmlRpcClient() {
- {
- setConfig (new XmlRpcClientConfigImpl() {
- {
- setServerURL(new URL (String.format("%s/xmlrpc/2/object", url)));
- }
- });
- }
- };
- final java.util.List<Object> ids= Arrays.asList((Object[])models.execute("execute_kw", Arrays.asList(
- db, uid, password,
- "product.template", "search",
- Arrays.asList(Arrays.asList(
- )))));
- //System.out.println("Person found for userid: " + displayhelp + ":");
- final java.util.List<Object> fields1 = Arrays.asList((Object[])models.execute
- ("execute_kw",Arrays.asList(db,uid,password,"res.partner","read",Arrays.asList(ids),
- new HashMap()
- {{put("fields",Arrays.asList("x_uuid"));}})));
- System.out.println(fields1);
- for (Object object : fields1) {
- HashMap<String,Object> result = (HashMap) object;
- System.out.println("GetInvoice MADE FOR USERID: " + userid + " END OF FLOW\n\n" );
- System.out.println("Building and sending message...\n\n");
- //newPerson messageuitsturen
- message msg = new message();
- getInvoice p = new getInvoice(
- result.get("x_uuid").toString(),1, UUIDHelper.getCurrentDate());
- XStream x = new XStream();
- x.alias("message",message.class);
- msg.setBody(p);
- msg.setMessageType("newPerson");
- x.alias("newPerson", newPerson.class);
- String toSend=x.toXML(msg);
- Sender.Send(toSend);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement